Jump to content
Kieran Hayns

How do i target Trigger effects on the uni that triggered it?

Recommended Posts

I need to know this for a whole host of Triggers.

 

However once specific example is i have a trigger setup to define the end of the operational area. If the player steps into this area they are give a message warning them to go back within 5 seconds otherwise they are killed.

 

This is done under the guide of an ordinance strike but for simplicity it just spawns an explosive on top of them.

 

This worked perfectly in multiplayer when testing by myself however when testing with a friend the message did not appear.

 

In addition when i then went into the area after him(and he went back into the engagement area to continue the mission) the count down worked fine. However for some reason when the trigger activated it spawned the explosive on him instead.

 

While highly amusing to watch my friend unexpectedly explode from a distance im unsure why this happened.

 

Here is the code used:

 

Activation settings = AnyPlayer, Present, Repeatable

 

Condition = This

 

Activation code =

 

PLAYER_WAS = getPos player;  
any=[   
 [   
  ["Warning!","<t align = 'center' size = '1'>%1</t><br/>"],   
  ["Incoming enemy Ordnance","<t align = 'center' size = '0.7'>%1</t><br/>"],  
  ["impact in 5","<t align = 'center' size = '0.7'>%1</t><br/>"],  
  ["4","<t align = 'center' size = '0.7'>%1</t><br/>"],  
["3","<t align = 'center' size = '0.7'>%1</t><br/>"],  
["2","<t align = 'center' size = '0.7'>%1</t><br/>"],  
["1","<t align = 'center' size = '0.7'>%1</t><br/>"]  
 ]   
] spawn BIS_fnc_typeText;  

 

 

A second Trigger activats using:

 

Condition = triggerActivated ABOVETRIGGERNAME

 

and the Timeout function of 5 seconds

 

Activation Script:

 

if (isServer) then {
;Enemy_unit_4 = [getPos Roadblock_1, OPFOR, ["Bo_GBU12_LGB"]] call BIS_fnc_spawnGroup;}

 

 

 

 

How to a tidy this up specifically but also how do i generally target specifially the player that activated the trigger?

 

Thanks

Share this post


Link to post
Share on other sites

trigger's condition is checked every 0.5 sec by default. Since 20.6, you can modify this parameter in editor.

AnyPlayer present is a "preset" condition for this as specific variable. When the condition is met, you  can use thisList in on activation field of the trigger. ThisList is always an array, here with all players who fired the trigger. Usually, it's quite impossible to have 2 or more players entering the trigger's area (so the condition) during the same 0.5 sec slot... but not impossible.

Anyway, just pick (thisList select 0) as 1st player (even if the order is not guaranteed).

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

×