I need to be able to make them alternate fire (left, right, left, right, etc.) . I've tried the VTM method of using tick, and it didn't work - the guns fired basically simultaneously. One of the issues is that the Raptor code already has a Tick function in it to run the streamers/thrusters.
How can I make the guns fire with even intervals without using tick?
You could cheat and throw a counter in tick. Or 2, leftCounter and rightCounter.
Then when you fire, you could zero the counters, and not allow them to fire until they reach some given amount. Start one of the counters at 0, and one at the arbitrary amount. Then only increment the counters when the vehicles are firing.
Actually, does weapon firing for weapons have firecount like player weapons? You could fire the left one if the firecount % 1 = 0 and right right one if firecount % 1 = 1.
Could you give me a code sample? My coding is very, VERY weak. I'm a modeller/designer/texturer, not a coder, but I really want to get this working soon since BigCheese (my usual coder) is currently swamped with MSU stuff.
An easy way to get them to fire like that is to copy how the manta fires. If you look at the manta code(hoverbike) you'll see that it fires from one bone(look in the default properties at the bottom of the class), and has a dual fire offset. It looks like what you have isn't too complex(i.e. doesn't have 30 animations to export), so it' prolly would be to much to add a bone center (from the front view) of the places you want it to fire. Then export/import. There is a lot of things that use the cheap dual fire which looks like what you could use there.
Thanks, CIpen, but the cannons on this vehicle are both individual weapon spawns (like the FlakRat or the Buggy in the VTM's). They each rotate and pivot. Each gun also has a firing animation (only one, and it's only 10 frames).
I'm well aware of the DualOffset (it's what I used on the NodeRunner), but I really wanted both guns to move and rotate (I didn't want to take the cheaper way out ).
To implement a dual fire you're going to have to keep track of which gun you're going to fire with. with this decided, you should be able to just do an if check and call a different spawnprojectile function based on the outcome. You could even just modify your spawn projectile to do the dual firing instead.
Yeah, the reason I suggested using % is because firecount is a variable that already exists. Although Im not sure if it does in vehicle weapons. In "normal" weapons, firecount is incremented during the PlayFire() function (I think).
So by using firecount % 1, the firecount variable is already in place, and is already incremented by other functions.