CarlGustaffa 4 Posted September 24, 2007 Hi How can I obtain the unit that set off a "Detected by Trigger"? It shouldn't have to be player, but any of my sides unit, or a specific type of unit. I want to send a patrol to the position the unit causing the trigger to go off was last spotted. Is this doable? Share this post Link to post Share on other sites
RN Malboeuf 12 Posted September 24, 2007 AFAIK if you activate the script via trigger - "this" argument will contain spotted unit Share this post Link to post Share on other sites
Junker 0 Posted September 24, 2007 HiHow can I obtain the unit that set off a "Detected by Trigger"? It shouldn't have to be player, but any of my sides unit, or a specific type of unit. I want to send a patrol to the position the unit causing the trigger to go off was last spotted. Is this doable? detect nearest enemy and get there position. only the AI that has been reported will be detected. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted September 28, 2007 Thank you. I'll check it out. Share this post Link to post Share on other sites
dritz181 0 Posted September 29, 2007 HiHow can I obtain the unit that set off a "Detected by Trigger"? It shouldn't have to be player, but any of my sides unit, or a specific type of unit. I want to send a patrol to the position the unit causing the trigger to go off was last spotted. Is this doable? Hello people.I want to do exactly the same thing but all advice ive read has been to no avail.Please could someone explain to me in simple laymans terms as how to send a unit to attack another unit activating a detected by trigger.Ive heard i might need a script as the standard trigger dosent seem to work execpt for end game and other affects. Share this post Link to post Share on other sites
nuxil 2 Posted September 29, 2007 what about. You make the trigger. activeted by, the side you want. then condition you put, !player and on act you put a script. "nil = thislist execvm "yourscript.sqf" or {player sidechat format["%1 activated trigger",_x]} foreach thislist http://community.bistudio.com/wiki/list Share this post Link to post Share on other sites
CarlGustaffa 4 Posted October 7, 2007 Works nicely. I notice I can ask for "select 1", but I'm not getting anything useful from it. Anyone knows what this is in such a trigger? I was hoping to obtain the unit that detected as well, but it seems to be something else. Share this post Link to post Share on other sites
Op4 BuhBye 0 Posted October 7, 2007 If you name the trigger you can call the trigger array in a script, check the side and select them. Share this post Link to post Share on other sites
fasad 1 Posted October 7, 2007 CarlGustaffa, try using : thislist select 0 , since only one unit is likely to be initially detected. In a "A detected by B" trigger, thislist is a list of units on side A, that are within the trigger area and are sufficiently knownAbout by side B such that their side is known. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted October 8, 2007 So, in order to find out which guardstation is to react on the trigger, I have to use a secondary trigger that lists all? Then in a script compare all side A units of list A who has the greatest knowsabout of the select 0 unit in trigger B? Hmm.. Sounds abit too much for my skills, or lack thereof Thanks anyway, always great to learn something new. Share this post Link to post Share on other sites
fasad 1 Posted October 8, 2007 I'd just compare the detected unit's position to position of the guards/patrols. Whichever is closest can get sent to investigate first. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted January 13, 2008 Ehhm, how? Yes, I'm again trying to work with this. _target = _this select 0; (the detected unit) {player sidechat format["%1 is possible unit that detected enemy.",_x]} foreach list tEastAriFriendlies; How do I find in this list the unit which is closest to _target? My coding skills are not that great, to say the least. Share this post Link to post Share on other sites