OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Hellbender on 28 Jun 2007, 07:37:46

Title: Grenade Trigger
Post by: Hellbender on 28 Jun 2007, 07:37:46
Okay, could someone tell me how to make triggers that make grenades, smoke, flares, and those kind of things based on proximity or timer?

I could do this easily in OFP, but I guess it doesn't work the same way in Arma!
Title: Re: Grenade Trigger
Post by: Mandoble on 28 Jun 2007, 12:03:04
It is the same, but use createVehicle instead of camCreate and the corresponding new name of the grenade object class ("grenadeHand" ?"). Check here (http://www.ofpec.com/COMREF/armaweapons.php) the different weapon classs names in ArmA.
Title: Re: Grenade Trigger
Post by: LeeHunt on 28 Jun 2007, 17:58:38
Hi Hellbender,

Ok, if you want a proximity or timer, make a trigger and set it to activate when the bad guys or the player comes close. For proximity you could have a minimum time of say 10 seconds or whatever. then in the activation line you could execute a script with some of the lines below:

Here's a way to create a small bomb at say, a gamelogic called "target1".

BOMB1 = "Bo_GBU12_LGB" createVehicle getpos target1

To create a flare 100 meters in the air, (in this case for my mission at a gamelogic called "tresflare"):

flare1 = "F_40mm_Red" createVehicle [getPos tresflare1 select 0, getPos tresflare1 select 1, 100]

You can change the color of the flare from Red to Green etc.  This looks really cool at night in the game!!!!  Thanks SharkAttack and Mandoble for teaching me how.
Title: Re: Grenade Trigger
Post by: Mandoble on 28 Jun 2007, 18:10:09
Here's a way to create a small bomb at say, a gamelogic called "target1".

BOMB1 = "Bo_GBU12_LGB" createVehicle getpos target1

Well, not so small, that is the biggest bomb present in ArmA till this date  :D


There is something you may want to consider here, in ArmA you will not make an ammo to explode just creating the same ammo twice in the same position. This is just because both ammos will not collide. If you want to create a mid.air explosion, you'll need a bomb and something that may make that bomb explode, something to collide with it. In some cases you may try the "Bomb" object (wich explodes as soon as you creates it and keep burning there).
Title: Re: Grenade Trigger
Post by: Hellbender on 30 Jun 2007, 02:59:07
Thanks guys! Lots of good ideas here!  :clap:

Lee's flare solution is what I used in OFP with flares, smoke, and tankshells. Just needed to hear what I should do differently in Arma!

Problem solved I guess!
Title: Re: Grenade Trigger
Post by: LeeHunt on 30 Jun 2007, 16:47:15
Hopefully it works  :).  Mandoble has a good point about objects (there are few who understand this game as well as he does!)