Jump to content
Sign in to follow this  
Guest

How do i trigger an explosion in the editor?

Recommended Posts

I made a simple script called "strike.sqf"

This is it:

_bomb = "Bo_GBU12_LGB" createVehicle [(getPosASL bombsite1 select 0),( getPosASL bombsite1 select 1), 3];

It works but now i wont add a delay so that the bomb spawns not so quick...

i added ~10 and sleep 10; but it dont work...

Can someon help me ?

Share this post


Link to post
Share on other sites
I made a simple script called "strike.sqf"

This is it:

_bomb = "Bo_GBU12_LGB" createVehicle [(getPosASL bombsite1 select 0),( getPosASL bombsite1 select 1), 3];

It works but now i wont add a delay so that the bomb spawns not so quick...

i added ~10 and sleep 10; but it dont work...

Can someon help me ?

It's a little too simple, your not calling it right or passing the variables. Try it this way

call it with the following place in the init script of the unit or game logic

nul=["grenade",unitname,5,0] execVM "strike.sqf"

and in the scrip it should be

_ammo      = _this select 0;
_bombsite1 = _this select 1;
_delay     = _this select 2;
_height    = _this select 3;

sleep _delay;

_bomb = _ammo createVehicle [(getPosASL _bombsite1 select 0),( getPosASL _bombsite1 select 1),_height];

I've changed it a bit to make it more useful.

Variables Passed are

1 Ammo ,can be changed from the editor

2 name of unit or gamelogic you wish to target

3 the delay before it goes off

4 is the height at which the explosive is dropped

There a many better scripts than this but I do like to keep things simple, I use it as a template and build on it.

Share this post


Link to post
Share on other sites

thank you for this aswell was trying to work out how to make a land mine, and it works great with this thanks

Share this post


Link to post
Share on other sites

Works great with rabbits - they can cover alot of ground quickly! "All, avoid that bunny":)

Share this post


Link to post
Share on other sites

Anyone figured out how to spawn a bomb with a Mapklick showing a marker that marks the targetposition and gets deleted automatic when bomb spawns ?

I mean something like that:

- Go to the Radio and click at "Airstrike".

- Click somewhere at the Map, a Marker appears that shows "Target Location".

- Bomb spawns after x sec and hits at the marked target.

- The "Target Location" Marker disappears.

That would be really great. I think that would be one the most realistic way to simulate a airstrike at the moment until much better scripts will come.

Edited by Wiggum

Share this post


Link to post
Share on other sites

There are scripts around for that, maybe not remove the maker but that shouldn't be difficult as there is a deletemarker command.

I did fiddle with my own script to target a falling bomb and it worked ok. Didn't someone do some bomb addons, I don't know if they'ed work as I haven't tried them.

Share this post


Link to post
Share on other sites

Iv checked the classname forum post and the arma2 library but no joy in finding bombs and explosive shell classnames. Like the stinger, 155 mm shell etc. Anyone wana throw me a link?

Share this post


Link to post
Share on other sites

So, here's one. What if I wanted to have a situation as part of a map where BLUFOR is moving in to clear a facility, but as they enter they walk into a "trigger" and a countdown begins with multiple warnings of a large IED in the area. So you've got a limited amount of time. How can I rig that count down timer to display the count, and then after the count is complete how do I get it to explode?

Share this post


Link to post
Share on other sites

like this thread,i also got a little problem with simulating mortar fire..

I want to simulate some rounds on a base.Tried it the easiest way.

Making 15 markers,target1 - target15.

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "target";

is in the onactivation,now i want a small delay like 5 secounds between the mortar impacts,sleep 5 or ~5 is not working..;-(

is it possible to trigger all these impacts with a delay in one trigger.

Also Mortar magazine class as impacts are nto working somehow,anybody knows why?

Mortar impact not working..=:

bomb = "ARTY_8Rnd_82mmHE_2B14" createVehicle getmarkerPos "target";

Share this post


Link to post
Share on other sites

@ Grimes [3rd ID]

1) Place an invisible H on your map and give it a name - let's say "ETarget".

2) Create the following script and call it "explosion.sqf":

_count = _this select 0;
_target = _this select 1;
_ammo = _this select 2;

while {_count > 10} do {
sleep 1;
_count = _count - 1;
hintSilent format ["%1 seconds left!",_count];
};

while {_count > 0} do {
sleep 1;
_count = _count - 1;
hint format ["Warning: only %1 seconds left!",_count];
};

det = _ammo createvehicle [( getpos _target select 0),(getpos _target select 1), 0];

3) Simply call it with:

nul = [300,ETarget,"Bo_GBU12_LGB"] execVM "explosion.sqf"

300 is the timelimit in seconds and "Bo_GBU12_LGB" is the kind of explosion - in this case it's the biggest one. The script will countdown the time and show it in silent hints until the counter is down to 10 seconds. Then it will show it as a hint but you will hear a "beep" every second. When the time is over a bomb will explode at the destination of the invisible H. ;)

Edited by IndeedPete

Share this post


Link to post
Share on other sites

Sorry for the late response. That worked exactly how I wanted it. Thank you very much! :)

Share this post


Link to post
Share on other sites

Im using that explosion script and it is awesome thank you so much, but i have one complication...yeah i can think outside the box but more minds the better.

i have it set up where you're approaching a barrel and the time starts to tick down through a trigger, now however, i want to be able to destroy said barrel and the bomb goes off, i made another trigger for that, but i dont know how to make the time stop going down and the second explosion on the barrel to cease.

(basically you enter the area, can't find it and it goes off, or you find it, blow it up and it sets off the explosion with time stopping and time going away off the screen)

any ideas, this is kind a tough one i know, but i know some of you guys are brilliant with this stuff sooo let's see what happens.

Share this post


Link to post
Share on other sites

_count = _this select 0;
_target = _this select 1;
_ammo = _this select 2;

while {_count > 10 and alive _target} do {
sleep 1;
_count = _count - 1;
hintSilent format ["%1 seconds left!",_count];
};

while {_count > 0 and alive _target} do {
sleep 1;
_count = _count - 1;
hint format ["Warning: only %1 seconds left!",_count];
};

If (alive _target) then {

det = _ammo createvehicle [( getpos _target select 0),(getpos _target select 1), 0];
};

That should do it.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Cmon guys. You should also tell them to use if (isserver) then {bomb...};

So they dont get 10 IEDs when they try the mission in MP.

Share this post


Link to post
Share on other sites

thanks a bunch, kinda figured it would be adjustment in code, but im not that well versed in it yet...(GSP major at Devry)

Share this post


Link to post
Share on other sites
How do you get it to work like that? This is the only way I get the above to work:

bomb = "Bo_GBU12_LGB" createVehicle getPos bombcar;

This is awesome. :D

Share this post


Link to post
Share on other sites
ok, place a game logic over the building you want gone and name it targ1

add the following command to your trigger.

buildings = nearestObjects [targ1,["building"], 50];{_x setDamage 1} foreach buildings;

Where it says 50 that's the damage radius, it will destroy most buildings within that range. Adjust it to get the range you require.

- Is there a way to make the 'BOOOM' sound, louder?

Share this post


Link to post
Share on other sites

The bigger the bang the bigger the PC needed.

buildings = nearestObjects [targ1,["building"], 100];{_x setDamage 1;bomb = "Bo_GBU12_LGB" createVehicle [(getPosASL _x select 0),( getPosASL _x select 1),1];  } foreach buildings;

Share this post


Link to post
Share on other sites

I know this is a pretty old post but, I have yet another question about explosions in the editor. Is there a way to make a unit explode as he is killed, I've got the !alive trigger set, I just need the actual explosion thing down.

Edited by Halt

Share this post


Link to post
Share on other sites

_pos = whatever position you want...

"HelicopterExploSmall" createVehicle _pos;

There are also a few others.

Share this post


Link to post
Share on other sites

Id like to create a series of simulated mortar strikes.. I can make a single explosion and I can make a number of them but I really want a delay of a few seconds between each... how is this done?

Also I would like the scream of the incoming round to be heard too - is this possible and if so how?

Share this post


Link to post
Share on other sites

You can just use a repeating trigger, which isn't the same as setting it using the repeating option in the tigger.

http://forums.bistudio.com/showpost.php?p=1575581&postcount=6

If you then use the triggers timers you can give it randomness 0,2,4 so it should go off between 0 -4 secs.

Downside is it will spawn in the same place unless you randomise the x,y co-ords.

plave var1= true into a game logic,unit or init.sqf

Set the triger name to trig1

on act

var1

on con

_bomb = "grenade" createVehicle[((getpos trig1 select 0)+ random 30)-30/2, ((getpos  trig1 select 1)+ random 30)-30/2,140];var1=false

on dea

var1=true

If you name the game logic and use that name in place of trig1 the bombs will fall onto gamelogic position and not the trigger.

Now you should forget all that and do a search for virtual artillery or put the code it into a script where you have more control, as for sound maybe it's possible as you can make custom sounds but not my area.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×