Jump to content

Recommended Posts

Guys, good afternoon! (or good night or good morning :])

I have a question about how I can create a script to activate a trigger to spawn a group of enemies.
I believe that to activate the trigger I have to use this script:

 

private _trigger1 = createTrigger ["EmptyDetector", _triggerMarker];
_trigger1 setTriggerActivation ["east", "not present", false];
_trigger1 setTriggerStatements [_opfor1 = [getMarkerPos _spawnTes1, EAST, _opfor1] call BIS_fnc_spawnGroup];
_trigger1 setTriggerTimeout [10,10,10];

 

However I would like this group of enemies to be deleted when the player leaves the area... I keep in mind that for that I would have to use the script "this && !(player in thisList) deletVehicle _opfor1" but I don't know where I would put it this command since I didn't find anything about something like "setDeactivation".

Does anyone have any idea how I could do this?

 

I appreciate the help!

  • Like 1

Share this post


Link to post
Share on other sites

setTriggerActivation and the condition set in setTriggerStatements define when the trigger activates. It deactivates if those settings are not fullfilled anymore.

You can define what happens on activation and deactivation with setTriggerStatements as well.

  • Like 1

Share this post


Link to post
Share on other sites

Your problem is hard to understand:
how I can create a script to activate a trigger to spawn a group of enemies

_trigger1 setTriggerActivation ["east", "not present", false]; // That's probably for checking if enemies are already inside the area....

I would like this group of enemies to be deleted when the player leaves the area. Nothing to do with thisList here!

 

* A preset "not present" is hard to manage because it can fires at start. The regular way is to spawn at player's presence, de-spawn at leave.

* ThisList is exactly same for "not present" and "present" preset condition.
* But, all preset condition can throw a thisList array, only in condition field or in activation field, never in in deactivation field.

* And thisList is linked to the preset condition only, not the whole condition.
* a non-repeatable trigger will not fire any deactivation code!

* in setTriggerStatements, you can't use previous local variables as is. You need to use global ones or setVariable on trigger itself...


Note: consider the right way: spawn on player(s)' presence. Your "not present" condition for opfor needs a check for player's presence anyway (the solution exists).
 

 

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

×