Re: Easily Customized Laser Sight Range?
So, I decided to go hack-crazy on the hack. I figured out a quick trick;
I reduced the system to a single AEmitter and a single MOSRotating, with one MOPixel dot per colour. The AEmitter is set to not normally emit any particles... this is where the fun comes in. I re-AddEmission the MOSRotating to the AEmitter when it's attached to the gun, and set the EmittedParticle's Sharpness and Mass values at the same time. I draw the range in pixels from the sharpness, and the colour from the mass (0.1 = red, 0.2 = blue, and so on), since the MOSRotating doesn't hit/get hit by MOs, and has a lifetime of essentially 1 frame, tops.
I have, however, run into something of a snag. I added a bunch of debug print checks to see if the script was running all the way through, which it is. Problem is, regardless of how I define the MOSRotating's Sharpness and Mass values in the AddEmission part, they always return 0 if told to print their current value in the script, or 1 if I don't define the Sharpness in the default MOSRotating that everything else copies from.
If I set the Sharpness to, say, 1000 in the original, then it's all fine... and it's constantly defaulting the colour instead of correctly determining it from the Mass.
Do I need to give the MOSRotating a new PresetName as part of the CopyOf or something? Is this one of CC's weird bugs?Apparently I do, and apparently it is! This game is so weird sometimes.
Now I just need to resolve colour properly...Cortex Command, why are you
so bizarre sometimes? I can't get the laser colour from the exact mass - it defaults to red?! - but it works fine if I determine if it's in a range between <x> and <y> - ex, mass is 2, between 1.9 and 2.1.
Then it fetches the colour just fine.
Oh well. Done with this, at last!