Firing 88mm guns

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Thirty-O-Six
Lance Corporal
Posts: 11
Joined: Tue Jan 28, 2003 1:57 am

Firing 88mm guns

Post 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
[253RID]General-Haines
Sergeant Major
Posts: 114
Joined: Fri Jan 17, 2003 7:46 pm
Location: New Jersey USA
Contact:

Post 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
253rd Regimental Infantry Division
Image
Our Spearhead Total conversion mod is now recruiting. http://www.thegreendevils.tk
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

$flak anim fire

Where 'flak' is the targetname of your Flak-88 gun.
Image
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

firing 88s and AA guns

Post 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?
Desert-Eagle
....The Eagle Has Landed...
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Maybe........
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Your 'threadset' key is invalid and useless :roll:.

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 ;).
Image
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

It works!!

Post 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.
Desert-Eagle
....The Eagle Has Landed...
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

jv_map wrote:Your 'threadset' key is invalid and useless :roll:.

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..........:P
Live to map, not map to live.
-mohaa_rox, .map
moderator
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

The test scr

Post 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
//-----------------------------------------------------------------------------
Desert-Eagle
....The Eagle Has Landed...
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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 :(
hope this helps, prob not cos it's all foreign 2 me :-/
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Just A Test

Post 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.
Desert-Eagle
....The Eagle Has Landed...
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 
Image
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Post 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.
Desert-Eagle
....The Eagle Has Landed...
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :).
Image
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Post 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.
Desert-Eagle
....The Eagle Has Landed...
Post Reply