OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Zipper5 on 16 Sep 2010, 16:21:19

Title: Can't get rid of spawned IR Strobes
Post by: Zipper5 on 16 Sep 2010, 16:21:19
In a mission I'm working on I've set it up so that 4 IR strobes in the shape of a square mark the LZ for units high above the ground if they look through their NVGs. Now, since this is in enemy territory and the enemy could easily have NVGs themselves, the guy who set them up will want to get rid of them at the earliest convenience. Here's what I did to create them:
Code: [Select]
strobe1 = "IRStrobe" createVehicle getMarkerPos "IR1";
strobe2 = "IRStrobe" createVehicle getMarkerPos "IR2";
strobe3 = "IRStrobe" createVehicle getMarkerPos "IR3";
strobe4 = "IRStrobe" createVehicle getMarkerPos "IR4";
And when I want him to walk around and look like he's actually removing them himself, I use this script called when he reaches each waypoint:
Code: [Select]
_taker = _this select 0;
_strobe = _this select 1;

_taker disableAI "ANIM";
_taker disableAI "MOVE";
_taker playMove "AmovPercMstpSlowWrflDnon_gear";

waitUntil {animationState _taker == "AmovPercMstpSlowWrflDnon_gear"};

sleep 1;

//deleteVehicle _strobe;
_strobe setDamage 1;

_taker enableAI "ANIM";
_taker enableAI "MOVE";
And is called by:
Code: [Select]
null = [<unit name>, <strobe name>] execVM "takeIRStrobe.sqf";I've double and triple checked to see that the way I'm calling the script is correct, and no errors appear as a result of running the script. The issue is that the IR strobe won't go away no matter if I use deleteVehicle or setDamage. The blinking light always remains.

So basically, I'm wondering if anyone has any idea how you're supposed to get rid of them? Or do you figure BIS hasn't really taken into account the idea of getting rid of them? If that's the case I'll probably create a ticket about it on the CIT.

Thanks in advance! :D
Title: Re: Can't get rid of spawned IR Strobes
Post by: F2kSel on 16 Sep 2010, 23:56:26
Nothing wrong with your script, the strobe does get deleted but it's light remains.   

Even if you move the strobe or place it underground it's light remains.

I'd have to say it's a bug.
Title: Re: Can't get rid of spawned IR Strobes
Post by: Zipper5 on 17 Sep 2010, 08:16:39
Bah, just what I was afraid of. Guess it's time to create a ticket on the CIT.

Edit: Created. (http://www.dev-heaven.net/issues/13742)
Title: Re: Can't get rid of spawned IR Strobes
Post by: kju on 18 Sep 2010, 09:50:26
Just a note: 'null =' is not recommended to use.

_nul / _dump

and in init lines:

MyTag_Nul / MyTag_Dump
Title: Re: Can't get rid of spawned IR Strobes
Post by: Zipper5 on 18 Sep 2010, 11:53:52
How come? I've yet to come across an issue with using null.
Title: Re: Can't get rid of spawned IR Strobes
Post by: Wolfrug on 18 Sep 2010, 15:53:32
Well, it's unnecessary for the same reason as using nil is. Null is the object counterpart to variable nil, after all.

I usually use nul, with a single l. :)

Wolfrug out.
Title: Re: Can't get rid of spawned IR Strobes
Post by: Zipper5 on 18 Sep 2010, 16:01:21
Guess you learn something new every day! :D
Title: Re: Can't get rid of spawned IR Strobes
Post by: h- on 18 Sep 2010, 16:55:04
Nowadays it's possible to use local variables in for example trigger activation fields, so you could use something like _nil = []execVM "blaah.sqf".
This was news to me, dunno how well known feature this is :dunno:

The use of local variables seems to be limited to assigning values only; if you put in one trigger _hint = "blah" and then in a second trigger try to use hint format ["%1",_hint] you get the old "error: local variable in global space"..
Title: Re: Can't get rid of spawned IR Strobes
Post by: Zipper5 on 18 Sep 2010, 17:52:58
Yup, that error is why I have always used null. Guess I'll use local variables from now on.