Simple question about rotations

Started by cpaca, July 17, 2017, 10:48:15 PM

Previous topic - Next topic

cpaca

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.
To use [OUR] Custom Modules, go to Forums/Knuckle Cracker/PFE/Map Makers, Ship Builders, and Coders, Go to the pinned posts, find the one named "Custom Modules Thread", Open it, Scroll down until you find ShipModule, Apply that into your map, do not apply it into map if one copy already exists, Apply the Adder script (Sometimes named "Master.prpl, sometimes [shipname]Adder, etc.) and the actual used scripts [which i will state in my posts]. If one copy already exists, do not apply another copy. -The CMC :-)

planetfall

Rotations in CRPL/PRPL are measured in radians.
A full circle (360 degrees) is equivalent to 2*pi radians.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

GoodMorning

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.
A narrative is a lightly-marked path to another reality.

cpaca

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.
To use [OUR] Custom Modules, go to Forums/Knuckle Cracker/PFE/Map Makers, Ship Builders, and Coders, Go to the pinned posts, find the one named "Custom Modules Thread", Open it, Scroll down until you find ShipModule, Apply that into your map, do not apply it into map if one copy already exists, Apply the Adder script (Sometimes named "Master.prpl, sometimes [shipname]Adder, etc.) and the actual used scripts [which i will state in my posts]. If one copy already exists, do not apply another copy. -The CMC :-)

GoodMorning

Short answer: "mult" is not a valid PRPL command, so your script is not compiling at all. You need "mul".
A narrative is a lightly-marked path to another reality.

cpaca

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.]
To use [OUR] Custom Modules, go to Forums/Knuckle Cracker/PFE/Map Makers, Ship Builders, and Coders, Go to the pinned posts, find the one named "Custom Modules Thread", Open it, Scroll down until you find ShipModule, Apply that into your map, do not apply it into map if one copy already exists, Apply the Adder script (Sometimes named "Master.prpl, sometimes [shipname]Adder, etc.) and the actual used scripts [which i will state in my posts]. If one copy already exists, do not apply another copy. -The CMC :-)