Jump to content
Sign in to follow this  
NGagedFX

[this] exec "" trigger problem

Recommended Posts

I was just making a simple IED script for my mission, and I can't get it activated by a trigger. As an IED object, I'm using an Explosive Charge (dumb object without any functionality).

IED.sqf:

hint "start";
_this = _this select 0;
_bomb = nearestObject [_this, "Explosive"];
sleep 20;
_charge = "Bo_GBU12_LGB" createVehicle (getPos _bomb);
deleteVehicle _bomb;
hint "end";

Trigger Settings:

BLUFOR, Once, Present
Condition: this
OnAct: [this] exec "IED.sqf"

I'm facing 2 unexplainable problems here:

1: If I place this trigger practically on top of the "Explosive", it will activate as soon as I walk in the trigger circle, and it immediatly displays the "end"-hint. It doesn't create a GBU, the "Explosive" won't be deleted, it doesn't wait atleast 20 seconds before saying end, the message is just there as soon as I get in trigger range.

2: If I put the OnAct line in the INIT of my own unit (player), then there is a deadly explosion, the "Explosive" is deleted, but there is no delay of 20 seconds.

Does anyone know what the hell is going wrong here? Cause I'm totally confused right now. :confused:

Share this post


Link to post
Share on other sites

OnAct: this doesn't exist. Try using thislist instead. Thislist itself is an array, containing all units that matches the condition (Blufor). So in the script (if called by [thislist] exec...) you have to obtain that using _unit = (_this select 0) select 0;

Also, you're starting an .sqf script using exec. Try execVM instead.

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  

×