Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: cpaca on July 17, 2017, 10:48:15 PM

Title: Simple question about rotations
Post by: cpaca on July 17, 2017, 10:48:15 PM
What kind of value is a rotation? 
I know it's a float, but I see all these things where it's like "mult by QuarterPi" "mult by HalfPi" and etc. 
This just seems like the best place to ask this.
Title: Re: Simple question about rotations
Post by: planetfall on July 17, 2017, 11:21:51 PM
Rotations in CRPL/PRPL are measured in radians.
A full circle (360 degrees) is equivalent to 2*pi radians.
Title: Re: Simple question about rotations
Post by: GoodMorning on July 17, 2017, 11:34:51 PM
Just to extend this for those unused to radians.
A right-angle is HALFPI or PI 2 div
A one-eighth circle is QUARTERPI
A full circle is TAU or TWOPI

Radians do not neatly subdivide, but are useful for technical constructions. It is said in some courses that "degrees are a crutch for those who do not yet understand radians". Everyday conversation tends to use "180 degrees", but computers understand numbers better.
Title: Re: Simple question about rotations
Post by: cpaca on July 18, 2017, 08:09:14 PM
Ok, just tried to apply this info. 
You can see that in the scripts. 
FocusedParticleMaker WORKS, I have tested it, it is even used in Pass The Map 1. 
The only thing I changed is that, for CreateParticle, instead of the Rotation = <-ShipAngle I did Rotation =
randfloat 0.5 sub pi mult 
Randfloat: Random float between 0 and 1 [right?] 
0.5 sub [so that 50% of the time it's above, 50% it's below. Range is now -0.5 to 0.5] 
pi mult [So that it can create the Particle at random degrees] 
Now it doesn't spawn a particle at ALL. 
I am, while making this message, realising pi mult = 180 degrees [since it's multiplied by -0.5 to 0.5] and that i should have done tau mult for 360 degrees. 
Still, that will change the direction, which isn't changing the output of this at all.
Title: Re: Simple question about rotations
Post by: GoodMorning on July 18, 2017, 08:37:16 PM
Short answer: "mult" is not a valid PRPL command, so your script is not compiling at all. You need "mul".
Title: Re: Simple question about rotations
Post by: cpaca on July 19, 2017, 01:11:28 AM
OH MY GOD. 
This would explain why about, oh, i don't know, FIVE other scripts of mine weren't working [and thus I manually did <-var add <-var add etc.]