Hi all
I am stuck on something here. I am using a script to create random objects. I am attaching a trigger to those objects to see if they are still alive (not present).
In the triggerstatements I have set a script to execute on those objects if they are not alive (not present). However, I cant get it to work. If I use
[this] exec ""GRF_iedcreator\ied_desroyed.sqs"
the script will execute over a complete different unit which is also on my map�Â
If I give the created object a name, check the name and change "this" into the name of the object it wont work since when I am creating 10 objects the trigger will work on the last created object.
Here is part of the script of what I am trying:
_test_object = selected out of an array
GRF_name = "GRF"
_i = 0
#loop
_i = _i + 1
_object = createvehicle [_test_object,[_PosX, _PosY, _PosZ],[],0,"NONE"]
_object setDir random 360
_gamble = random 100
?_gamble < 0 : goto "skip"
_trigg = createTrigger ["EmptyDetector", [_PosX, _PosY, _PosZ]]
_trigg setTriggerActivation ["WEST", "PRESENT", false]
_trigg setTriggerArea [_radius, _radius, 0, false]
_trigg setTriggerStatements ["this", "[thislist select 0] exec ""GRF_creator\test.sqs""", ""]
GRF_name = GRF_name+format ["%1",_i]
_object� setVehicleVarName format ["%1",GRF_name]
player sidechat format ["name object should get = %1",GRF_name]
GRF_test_name = vehicleVarName _object
player sidechat format ["name added to the object =%1",GRF_test_name]
_trigg2 = createTrigger ["EmptyDetector", [_PosX, _PosY, _PosZ]]
_trigg2 triggerAttachVehicle [GRF_ied]
_trigg2 setTriggerArea [_radius, _radius, 0, false]
_trigg2 setTriggerActivation ["VEHICLE", "NOT PRESENT", false]
_trigg2 setTriggerStatements ["this", "player sidechat ""created trigger works, how about the script""; [this] exec ""GRF_creator\test_desroyed.sqs""", ""]
goto "loop"
As explained above, if I change
_trigg2 setTriggerStatements ["this", "player sidechat ""created trigger works, how about the script""; [this] exec ""GRF_creator\test_desroyed.sqs""", ""]
into
_trigg2 setTriggerStatements ["this", "player sidechat ""created trigger works, how about the script""; [GRF_test_name] exec ""GRF_creator\test_desroyed.sqs""", ""]
it always returns on the last created object, even though the name of each object created is different each time.
I hope someone knows how I can check if my created object is not alive anymore and than execute a script on it.
I cant use on ongoing looping script, it must be done with a trigger that executes when the attached object is not present.
Thanks again for the help�Â