Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Whiteraven

Trouble attaching triggers...

Recommended Posts

Hi everyone (My first post)

I'm having trouble attaching a trigger to the player, The problem is, the trigger remains static on the map, i need a constant radius around the player so, when and enemy unit comes within 50metres of the player, the trigger will activate. I've been searching everywhere including comref with no success.

So far I've made the trigger like so:

html>

Edited by Whiteraven

Share this post


Link to post
Share on other sites

What you want is that the trigger moves with the player all the time.

The first step required you did already by giving the trigger a name (PredatorPresent), the player unit we call "playername" here.

What you now need is a script which is relocating the trigger to the players position:

predatortrigger.sqf

while {true} do 
{
 PredatorPresent setPos getPos playername;
 sleep 1;
};

Not tested but in theory should work. Also might work only in SP, not sure if and how it works on a dedicated server.

However, if there is only one enemy unit which shall activate the trigger (I presume "Predator" is the name of the enemy unit) then you can have that much easier:

Trigger condition: Predator distance playername < 50

Share this post


Link to post
Share on other sites

Welcome Whiteraven. :)

Give the unit a name, give the trigger a name. Then in the unit's init:

triggername attachTo [unitname, [0,0,0]];

Besides, your post should probably be in:

Bohemia Interactive Forums > BI MILITARY GAMES FORUMS > ARMA 2 EDITING > ArmA 2 & OA - MISSION EDITING & SCRIPTING

It's a section dedicated to editing stuff, and there will be a lot more people reading it. ;)

Share this post


Link to post
Share on other sites

Thank you VERY much both of you, this' been doing my head in.

Tried both and they work fine, I was initially using triggername attachTo [unitname, [0,0,0]]; tho i was typing it into the trigger condition feild instead of the players init (What a doughnut)

Im unsure how to add sqfs for now i'll just incorporate the two... triggername attachTo [unitname, [0,0,0]]; in the players init and Predator distance playername < 50 to set my distance.

Thx again. :)

ps, soz for double posting

Share this post


Link to post
Share on other sites
Sign in to follow this  

×