It's fairly simple to make bursts fire from different points mid-burst. For reference,
this is the unit using this code. First the top barrels fire, then the bottom barrels. It uses the projectiles weapon tag instead of burst, but as far as I understand they work basically the same way (projectiles just spawns all the projectiles in one frame) so it should work on a burst weapon. Just keep in mind that I'm only speaking in terms of svn; I don't remember or care to find out how much of this was in 75b2.
First, initialize the static-var you're using for the barrel switch to -1. This can be done differently, depending on where your "++gun_1;" is later in the script, but it really makes no difference if it works.
Then set up queryweapon normally. Nothing special here.
Code: Select all
QueryWeapon1(piecenum) {
if(gun_1 == 0) {
piecenum = firept1;
}
if(gun_1 == 1) {
piecenum = firept3;
}
if(gun_1 == 2) {
piecenum = firept2;
}
if(gun_1 == 3) {
piecenum = firept4;
}
}
Here's the interesting bit. ShotX() is called for each projectile in the burst, unlike FireWeaponX(), which is only called once per burst. We first increase gun_1 by one, and if it's greater than 3 (remember, gun_1 = 0 is barrel1, = 3 is barrel4) we reset it to 0 so the process begins again. As you can see, I do this at the beginning of the function, which is why we had to initialize to -1 above; putting it at the end and initializing to 0 should work just as well. Because ShotX is called for each projectile, gun_1 is increased for each projectile, meaning QueryWeaponX above fires from the correct spot.
Since the unit uses the projectiles tag, I only have to check for two specific values of gun_1 here: 0 and 2, and then play the animations in a block. But checking for gun_1 == 1 and so on should work just as well. Finally, note that FireWeapon1() has nothing.
Code: Select all
Shot1() {
++gun_1;
if(gun_1 > 3) {
gun_1 = 0;
}
if(gun_1 == 0) {
emit-sfx MED_MUZZLE_FLASH_FX_GREEN from firept1;
emit-sfx MED_MUZZLE_FLASH_FX_GREEN from firept3;
move barrel1 to z-axis [-7.5] now;
move barrel3 to z-axis [-7.5] now;
sleep 150;
move barrel1 to z-axis [0] speed [37.5];
move barrel3 to z-axis [0] speed [37.5];
}
if(gun_1 == 2) {
emit-sfx MED_MUZZLE_FLASH_FX_GREEN from firept2;
emit-sfx MED_MUZZLE_FLASH_FX_GREEN from firept4;
move barrel2 to z-axis [-7.5] now;
move barrel4 to z-axis [-7.5] now;
sleep 150;
move barrel2 to z-axis [0] speed [37.5];
move barrel4 to z-axis [0] speed [37.5];
}
}
FireWeapon1() {
}
That's pretty much it for iterating through barrels mid-burst. I don't know why your hovercraft can't fire over water without seeing the model and script.