zwobot 22 Posted August 19, 2007 I've got a bit of a hangover here. I want to spawn an explosion for a roadside bomb using a trigger and a function. the trigger's onActivation line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this, "grenade"] call IED IED is defined in the init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">IED = preprocessFile "scripts\ied.sqf" The bomb function itsself: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// example call inside a trigger: [this, "grenade"] call IED private ["_ied", "_pos", "_ammo"]; _pos = getPos (_this select 0); _ammo = _this select 1; _ied = _ammo createVehicle [_pos select 0, _pos select 1, 5]; _ied setDammage 1; deleteVehicle _ied; When I activate the trigger nothing happens, what am I doing wrong? Share this post Link to post Share on other sites
Linker Split 0 Posted August 19, 2007 there's no "grenade", only "HandGrenade" or try "Shell125" to see if it works Share this post Link to post Share on other sites
zwobot 22 Posted August 19, 2007 Negative, "Shell125" does not work. I have tried "Shell73" before and it did not work either. Alternatively I also tried to put this into the onActivation field of the trigger: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">bomb = "Shell73" camCreate getPos this Neither did that create an explosion EDIT: "Grenade" is supposed to be the ammo class name of some grenadelauncher ammo btw. Look it up here: Ofp weapon class names Share this post Link to post Share on other sites
Pulverizer 1 Posted August 19, 2007 There is a "grenade" (for grenade launchers) but I think you need to name the trigger, "this" doesn't work with them iirc. [triggername, "grenade"] call IED Also, I'm not sure if it will explode when you setdammage 1 it. You could create a pipebomb on the same pos so the grenade will hit it and explode, then delete the pipebomb a 0.5s later by executing a script such as: ;call with: _ammo exec "delpipebomb.sqs" ~0.5 deleteVehicle _this exit You don't need to delete the grenade (or a tank shell), it'll be removed automaticly once it hits something and explodes. It would be easier if you just let it go off by touching the ground. Share this post Link to post Share on other sites
zwobot 22 Posted August 19, 2007 Thanks Pulverizer, naming the trigger worked Share this post Link to post Share on other sites