Jump to content

Photo
- - - - -

How do i trigger an explosion in the editor?


  • Please log in to reply
57 replies to this topic
Thread Starter
richiespeed13
richiespeed13

    The Official ArmA2 Pied Piper

  • Members
  • 1300 posts

Posted 03 July 2009 - 19:04 #1

Hey fellas,

I'm working on a mission where me and my squad is ambushed. What i want to happen, is as my squad moves past a car it explodes, a bit like an IED.

I know this is going to require scripting/commandlines of some sort, but could anyone tell me how to do this?

Any help gratefuly apreciated,

Rich.

My Youtube
Feel free to add me on Steam!


SaBrE_UK
SaBrE_UK

    First Sergeant

  • Members
  • 989 posts

Posted 03 July 2009 - 19:08 #2

Sorry can't help you right now but I hope it's going towards one of your excellent YouTube videos!

deadfast
deadfast

    Moderator

  • 3175 posts

Posted 03 July 2009 - 19:23 #3

The best way is to create a grenade/rocket/bomb (depending on the strength you want) on top of the vehicle:

"Bo_GBU12_LGB" createVehicle getPos bombcar;
The above will spawn an LGB on vehicle called bombcar

Murphe
Murphe

    Sergeant

  • Members
  • 136 posts

Posted 03 July 2009 - 20:06 #4

"Bo_GBU12_LGB" createVehicle getPos bombcar;


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;

Also to get an explosion to happen over a marker you use:

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "makername";


Thread Starter
richiespeed13
richiespeed13

    The Official ArmA2 Pied Piper

  • Members
  • 1300 posts

Posted 03 July 2009 - 20:47 #5

The best way is to create a grenade/rocket/bomb (depending on the strength you want) on top of the vehicle:

"Bo_GBU12_LGB" createVehicle getPos bombcar;
The above will spawn an LGB on vehicle called bombcar


I see, thanks!

But now could you tell me what field of what unit to put that in, and how to make the explosion happen via a triggered event?

Thanks!

---------- Post added at 09:47 PM ---------- Previous post was at 09:46 PM ----------

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;

Also to get an explosion to happen over a marker you use:

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "makername";


Thanks, mate, i posted my question above ^^

My Youtube
Feel free to add me on Steam!


Murphe
Murphe

    Sergeant

  • Members
  • 136 posts

Posted 03 July 2009 - 21:20 #6

But now could you tell me what field of what unit to put that in, and how to make the explosion happen via a triggered event?


That depends on the event, you can set a trigger to go off anyway you can imagine really, but it takes a bit of searching to find the code for the more complicated stuff.

Example;
Say you want a bomb to go off when a soldier walks over a certain area, simulating an anti-personnel mine. You start off placing a trigger where you want it to be activated. You then set how big you want the area of activation you want, for this it would be quite small, between 2 and 5 maybe. Then you set who you want to set it off. For this it would be anyone, so you set activation to 'Anybody'. Then in the 'On Activation' box you add the line:

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "explosion";


You also need to add a marker where you want to set off the bomb and name the marker something suitable, make sure it is the same as in the code you put in the trigger.

I would suggest playing around with triggers as it doesn't take long to figure out the basics. For instance you could group the trigger to a single unit, so only that unit will set it off. Or you can change the activation to 'Radio Alpha' so you set it off using the radio. Click 'Repeatedly' to set it off over and over again.

As stated before you can use the same trigger to set it of on top of a unit using:

bomb = "Bo_GBU12_LGB" createVehicle getPos bombcar


Just remember to make sure the name of the unit you want to blow up and the name in trigger (in bold) are the same. For me this is why most of the stuff I try doesn't work as spelled the name differently for each item.

"Bo_GBU12_LGB" is a little big for a this purpose but right now I can't get anything smaller to work, I don't whether it's the weapon name or the 'bomb' bit at the front. In Arma I used this technique to get bullet implacts where ever you want them, but i never got round to making any proper movies to use it in.

Hope that helps and I look forward to what you do with it.

Thread Starter
richiespeed13
richiespeed13

    The Official ArmA2 Pied Piper

  • Members
  • 1300 posts

Posted 04 July 2009 - 11:39 #7

Thanks mate that did the trick! Here is my final result:

<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/F5L5UaBFtbM&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/F5L5UaBFtbM&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

My Youtube
Feel free to add me on Steam!


Ringhejm
Ringhejm

    Corporal

  • Members
  • 78 posts

Posted 05 July 2009 - 05:01 #8

For instance you could group the trigger to a single unit, so only that unit will set it off.



How do you do this??? are you just syncronising the trikker whit a sertin unit. ???

My sys.
Core 2 Duo E8400 6MB 2x3,00GHz FSB1333MHz OC to 2x3,35 GHz
GeForce 8800GT 1GB
8 GB DDR2-800 PC6400 RAM
Windows 7 Ultimate DK 64-bit
Member of www.deadecho.dkTjek my youtube http://www.youtube.com/user/ringhejm1


JW Custom
JW Custom

    Chief Warrant Officer

  • Members
  • 3263 posts

Posted 05 July 2009 - 09:32 #9

That depends on the event, you can set a trigger to go off anyway you can imagine really, but it takes a bit of searching to find the code for the more complicated stuff.

Example;
Say you want a bomb to go off when a soldier walks over a certain area, simulating an anti-personnel mine. You start off placing a trigger where you want it to be activated. You then set how big you want the area of activation you want, for this it would be quite small, between 2 and 5 maybe. Then you set who you want to set it off. For this it would be anyone, so you set activation to 'Anybody'. Then in the 'On Activation' box you add the line:

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "explosion";


You also need to add a marker where you want to set off the bomb and name the marker something suitable, make sure it is the same as in the code you put in the trigger.

I would suggest playing around with triggers as it doesn't take long to figure out the basics. For instance you could group the trigger to a single unit, so only that unit will set it off. Or you can change the activation to 'Radio Alpha' so you set it off using the radio. Click 'Repeatedly' to set it off over and over again.

As stated before you can use the same trigger to set it of on top of a unit using:



Just remember to make sure the name of the unit you want to blow up and the name in trigger (in bold) are the same. For me this is why most of the stuff I try doesn't work as spelled the name differently for each item.

"Bo_GBU12_LGB" is a little big for a this purpose but right now I can't get anything smaller to work, I don't whether it's the weapon name or the 'bomb' bit at the front. In Arma I used this technique to get bullet implacts where ever you want them, but i never got round to making any proper movies to use it in.

Hope that helps and I look forward to what you do with it.


Thanks for that mini tutorial, i'm very new to this editor but i actually got something working thanks to you :P

A question though: where do i find the name of the bomb i wanna use, where did you get the bomb name "Bo_GBU12_LGB" from?

hund
hund

    Gunnery Sergeant

  • Members
  • 599 posts

Posted 05 July 2009 - 09:49 #10

It is the ammo class names - they haven't been uploaded onto the biki yet, but here are the ones from ArmA1 (who knows, some of them might work):

http://community.bis...i/ArmA:_Weapons

One thing you have to be very careful about when using this is the global/local relationship. You might inadvertantly end up spawning a GBU for each player if you're not careful, which for full servers is not a nice thing really.

Murphe
Murphe

    Sergeant

  • Members
  • 136 posts

Posted 05 July 2009 - 12:42 #11

It is the ammo class names - they haven't been uploaded onto the biki yet, but here are the ones from ArmA1 (who knows, some of them might work):

http://community.bis...i/ArmA:_Weapons


Thats the place, hopfully they will update it with an Arma 2 one soon. So far I only have got one or two to work, big ones though. A lot them from Arma 1 just create an explosion with no sound, I haven't checked if they even do damage, it may just be smoke.

To link a trigger to a single unit you use the group mode (not sure what to call it actually) in the editor by pressing F2. Then in the same way as grouping units together you group the trigger to a single unit (you can only link one trigger to one unit). If you open up the trigger again you will notice the 'Activation' drop down box has changed and now contains 'Vehicle', 'Group Leader', Whole Group' and 'Any Group Member'. These are all pretty self-explanatory except that 'Vehicle' means the specific unit you grouped it to, regardless of whether they are in a vehicle or not.

A small trick I use to ensure that the trigger is set up properly and activated when it should be, is I use this line

player sidechat "Trigger Activated"

This will make it so that when the trigger is activated you character says "Trigger Activated" so you know the trigger has definatly been activated.

E.g.

bomb = "Bo_GBU12_LGB" createVehicle getmarkerPos "explosion"; player sidechat "Trigger Activated"

So is your character says "Trigger Activated" but nothing happens then you know it's the code you used that is the issue and not the trigger parameters.

This:

Armed Assault Editing Guide - Deluxe Edition
(most should still apply to Arma 2)

combined with this:

Arma 2 Command Reference

should help a lot with other aspects of editing.

For a grenade sized explosion, this should work:

grenade = "grenade" createVehicle getmarkerPos "Markername";

Edited by Murphe, 05 July 2009 - 15:34.


JW Custom
JW Custom

    Chief Warrant Officer

  • Members
  • 3263 posts

Posted 06 July 2009 - 08:50 #12

Thanks for the hints :)

Aeviv
Aeviv

    Rookie

  • Members
  • 6 posts

Posted 06 July 2009 - 16:08 #13

Does anyone know how i could spawn the bomb at a certain altitude above the target? So it could look like an airstrike? Eg radio command, drop bomb, triggers the bomb to be spawned 300m up, message confirms, few seconds later, impact

Murphe
Murphe

    Sergeant

  • Members
  • 136 posts

Posted 06 July 2009 - 17:11 #14

Does anyone know how i could spawn the bomb at a certain altitude above the target? So it could look like an airstrike? Eg radio command, drop bomb, triggers the bomb to be spawned 300m up, message confirms, few seconds later, impact


To do this you use this:
bomb = "Bo_GBU12_LGB"  createVehicle [(getmarkerPos "bombsite1" select 0),( getmarkerPos "bombsite1" select 1), 300];

However my editing know-how on this subject ends there for the time being. This will cause a LGB to be spawned 300m in the air facing North. The LGB will then being to fall Northward at a very slow speed (you may need to spawn them much higher than this to allow them to get up to speed) and so land North of where the marker that they spawned over is. I don't know how to change the direction or the initial velocity but I know these commands exisit.

Edited by Murphe, 06 July 2009 - 17:14.


The_Angry_Canadian
The_Angry_Canadian

    Sergeant

  • Members
  • 112 posts

Posted 10 July 2009 - 23:08 #15

I've been starting to experience with the mission builder in the last 12 minutes and i'm trying to build a small training mission for my 57 year old dad :)

My question is probably a very basic one, but how can one do the same kind of effect with a building. Each of them have an ID.

So, let's say i want to make the building with ID 511 blow-up, can I link that bomb with the building instead of a car ?

Please, excuse the noob ;) Once I get the syntax, I should be able to figure stuff on my own.

f2k sel
f2k sel

    Chief Warrant Officer

  • Members
  • 3947 posts

Posted 10 July 2009 - 23:41 #16

I've been starting to experience with the mission builder in the last 12 minutes and i'm trying to build a small training mission for my 57 year old dad :)

My question is probably a very basic one, but how can one do the same kind of effect with a building. Each of them have an ID.

So, let's say i want to make the building with ID 511 blow-up, can I link that bomb with the building instead of a car ?

Please, excuse the noob ;) Once I get the syntax, I should be able to figure stuff on my own.



You can still use the above script from Murphe just set the height of the bomb much lower, I set the following code to 3 meters above ground.

bomb = "Bo_GBU12_LGB"  createVehicle [(getmarkerPos "bombsite1" select 0),( getmarkerPos "bombsite1" select 1), 3];

recap place the code in the trigger and set up your conditions, name a marker bombsite1 and place over the building you wish destroyed.


Don't be confused with the createVehicle part.

Edited by F2k Sel, 10 July 2009 - 23:46.


The_Angry_Canadian
The_Angry_Canadian

    Sergeant

  • Members
  • 112 posts

Posted 10 July 2009 - 23:47 #17

Ok. So I set a marker first.

How can you attach a trigger to a building ID then ?

Let's say I want the winning condition to be the succesfull destruction of building ID 511 ?

I'm going through the arma2 commands list but havent found a definition of the object ids yet

f2k sel
f2k sel

    Chief Warrant Officer

  • Members
  • 3947 posts

Posted 11 July 2009 - 00:25 #18

just group the trigger to the building by dragging a line from the trigger to the centre of the building while the group item is highlighted. Then open your trigger and it should say in the activation box Static Object.

Now set the other options to "Not Present" and where it says Type choose an End.

Object ID never seems to work for me and may have been removed as an option but I could be wrong.

The_Angry_Canadian
The_Angry_Canadian

    Sergeant

  • Members
  • 112 posts

Posted 11 July 2009 - 00:31 #19

just group the trigger to the building by dragging a line from the trigger to the centre of the building while the group item is highlighted. Then open your trigger and it should say in the activation box Static Object.

Now set the other options to "Not Present" and where it says Type choose an End.

Object ID never seems to work for me and may have been removed as an option but I could be wrong.



Ha, thank you very much for your help. Now it's looking even better ! I'm still stuck on object selection however. When I blow up the cow in the middle of the road the building on the side does not blow up.

I could spawn a bomb in the building, but that makes it look weird since there would be 2 explosion. I would rather set the building damage to 1. Is that possible ?

Edited by The_Angry_Canadian, 11 July 2009 - 00:35.


Mc Speedfreak
Mc Speedfreak

    Sergeant

  • Members
  • 126 posts

Posted 11 July 2009 - 00:39 #20

uh.. i usually do it in this manner:

name the vehicle "car1"

set the trigger and enter in the init:

"car1 setdamage 1"
this works wonders with fueltrucks :)


ps: love your vids btw

edit... 100posts YAY :)

Edited by Mc Speedfreak, 11 July 2009 - 02:47.
edit... 100posts YAY :)

Dysphoria, Borealis, Gleis19, Goodbye, Springtime? , Erinnerungen , Homeward Bound by Mc Speedfreak / Henry Sanner is licensed under a Creative Commons Attribution-No Derivative Works 3.0 Unported License.