So I built a few planes that shoot automatic cannons, but i need a code so the cannon only automaticly fires in a ten degree radius to the front, (like the lock circle of missles)
So I built a few planes that shoot automatic cannons, but i need a code so the cannon only automaticly fires in a ten degree radius to the front, (like the lock circle of missles)
@Kendog84 Got it!
@winterro
Via the "X" icon right above the connection icon. (Not the one at the bottom, that's variable setter)
This icon (pic)
When you name this TatorA, for example, now the word "TatorA" equals the angle of this rotator in XML/Funky Tree.
So you can write activationGroup FT like "TatorA > 50"
Some things to note:
-You can't use numbers (1,2,3...) at the beginning of the name
-As long as it's different from other xml attributes, you can name it however you like (but shorter the better)
-Don't give the same name to more than one part (FT can break if you do)
-I find it easier to make adjustment when I have the rotator range set to 100, and change actual range by changing the input value (input multiplier)
If you want to know the exact angle of the rotator, you can create a label (cockpit interior part) that says {X} (replace X with your variable name).
Here's an example that uses this if you need one (link)
*You must first create the part variable. If you create a label first then create the variable, label won't work.
@Kendog84 how to name rotators?
@winterro
Glad to help, you're welcome
@Kendog84 ah thx
If you're talking about some kind of auto aim cannon on a rotator, you can use rotator's current angle variable.
Name them TatorA and TatorB or something, and replace cannon's activation group with something like:
abs(TatorA) < 10 & abs(TatorB) < 10
(abs(TargetElevation-PitchAngle) + abs(TargetHeading-Heading) ) less than 10
Try this, insert it in activation group of cannon part.
Hey winterro, do u remember a really cringe user named autumnus? Or something like that? Bc he's actually my little brother. Fun fact. Not sure about the code though, hopefully you'll find someone who can answer your question
I'm not sure what the code would look like, but maybe something like
x>(heading - targetheading)
and then the same for elevation?