Page 1 of 1
Firing 88mm guns
Posted: Sat Feb 01, 2003 5:53 pm
by Thirty-O-Six
I'm working on my map, and the objective is to destroy 3 88mm guns. So far I'm happy with setting them up as objectives thanx to the tutorials etc.
Does anyone know if theres a way to script something where the guns can be made to fire...as in say every 15 seconds a trigger or similar creates a firing sound and a muzzle flash from the gun?
Im just trying to create the impression that the guns are firing until the allies get near the objective then the firing stops ( otherwise it would look a bit daft with the guns firing and no-one near it).
Ive just read the ambient sounds tutorial and probably got carried away lol
Chris
Posted: Sat Feb 01, 2003 7:03 pm
by [253RID]General-Haines
haha whittman same thing i posted before but no 1 new! like in ardennes i wanted to have the flak move and fire but no luck so far if.... i figure it out ill let ya know
Posted: Sat Feb 01, 2003 7:39 pm
by jv_map
$flak anim fire
Where 'flak' is the targetname of your Flak-88 gun.
firing 88s and AA guns
Posted: Wed Mar 26, 2003 4:27 am
by Desert Eagle
so if I have in map:
targetname of flak is flakone
threadset flakone
in scirpt would this make the gun fire randomly with sound and muzzle flash?
level waittill spawn
thread flakone
end
flakone:
wait (randomfloat 13 + 23) <---the 13 is minimum # of seconds it waits, and 23 is the max # of seconds it will wait!
$flakone anim fire
goto flakone
end
Could this work for aa guns to?
Posted: Wed Mar 26, 2003 5:05 am
by mohaa_rox
Maybe........
Posted: Wed Mar 26, 2003 9:31 am
by jv_map
Your 'threadset' key is invalid and useless

.
the 13 is minimum # of seconds it waits, and
36 is the max # of seconds it will wait!
Like mohaa rox said, maybe it will work

.
It works!!
Posted: Wed Mar 26, 2003 11:52 pm
by Desert Eagle
Well I created a quick test map and script and it works!!.
I now have random flak cannons firing, mg42s, mortars, and aa guns. I assume anything with an animation can be made to fire randomly.
Looks neat when flak cannons firing skyward and then using a trigger to use the flak burst in the air in Spearhead.
Thanks for input, now on my way to getting my parachute spawn points working correctly in multiplayer.
Posted: Thu Mar 27, 2003 1:01 am
by mohaa_rox
jv_map wrote:Your 'threadset' key is invalid and useless

.
the 13 is minimum # of seconds it waits, and
36 is the max # of seconds it will wait!
Like mohaa rox said, maybe it will work

.
HAHAHA!!!! I was just guessing..........

The test scr
Posted: Thu Mar 27, 2003 1:32 am
by Desert Eagle
mgs only fire one bullet, and aa gun does not warm up enough to fire...
But the flak guns really look good along with flak burst.
Here is the test scr I used:
level.script = maps/dm/flaktest.scr
exec global/ambient.scr m4l1
exec global/door_locked.scr::lock
level waittill spawn
thread flakone
thread flaktwo
thread flakthree
end
flakone:
wait (randomfloat 13 + 23)
$flakone anim fire
wait 2
$flakflash anim start
goto flakone
end
flaktwo:
wait (randomfloat 13 + 23)
$flaktwo anim fire
wait 4
$flakflash2 anim start
goto flaktwo
end
flakthree:
wait (randomfloat 13 + 23)
$flakthree anim fire
wait 2
$flakflashthree anim start
goto flakthree
end
end
//-----------------------------------------------------------------------------
Posted: Thu Mar 27, 2003 1:47 am
by nuggets
you have a stray "end" at the bottom...
and also, using goto is really bad scriting... admitidly is does what you want it 2 do, but you also need pieces of script for it not 2 fire if friendlies have overrun the "missile file", repeating a script over and over will kill your map sonner or later

Just A Test
Posted: Thu Mar 27, 2003 2:22 am
by Desert Eagle
It was just a test scr to see if it actually would work, and the flak animation would work. In my real map it will be set up with triggers not threads. thread was the quickest way to show that it works, the anim fire with the 88 flak.
Posted: Thu Mar 27, 2003 6:46 am
by jv_map
There's nothing wrong with threads (as long as you don't start thousands), but the goto command is harmful.
Better:
Code: Select all
flakone:
while(1)
{
wait (randomfloat 13 + 23)
$flakone anim fire
wait 2
$flakflash anim start
}
end
Posted: Fri Mar 28, 2003 12:38 am
by Desert Eagle
Thanks JV your the man...

Now maybe you can help me with one other thing.
This also works for firing the mg42 without a gunner, ony problem is it shoots only one shot. I have tried a few things but nothing working. I just wanted the mg42 to fire some rounds for like 6 or 7 seconds.
Trying to put some random tracer fire in my map over the players head.
Posted: Fri Mar 28, 2003 1:40 pm
by jv_map
Can't you just use 'startfiring'?
Or make it shoot in a while loop like the above example, but with a smaller delay.
If the fire is for fx only, make sure to set 'tracerfrequency 1' to make it look special

.
Posted: Sat Mar 29, 2003 12:26 am
by Desert Eagle
Thanks again Jv, that did not work, but I tore apart the first single player mission in Spearhead and now using the Projetilce Geneator. That is what is for, to fake large battles. So if all goes well, maybe I can write up a tut on them.