JacobJ 10 Posted February 26, 2012 Hey all Don't know if this has been up before, but can't seem to find anything about it. I think its a simple one, but I can't figure it out. If I need to refer to the unit that triggers and trigger, how would I do that? /Jacob Share this post Link to post Share on other sites
demonized 16 Posted February 26, 2012 http://community.bistudio.com/wiki/list or directly in trigger: thisList in both you will get a list of units inside trigger wich meets the conditions: _unit_Who_triggered = (list triggername) select 0; Share this post Link to post Share on other sites
JacobJ 10 Posted February 26, 2012 Oh I see, so the unit that triggers the trigger will always be the first in the array list. I get the system. Thank you very much. Can I somehow change triggername to this? And that will then refer to the trigger? Then I wouldnt have to put a name to many triggers, if I was using a lot of triggers. Share this post Link to post Share on other sites
riouken 14 Posted February 26, 2012 (edited) You can use: [left][color=#3E3E3E]unit_Who_triggered = [/color]thisList [color=#3E3E3E]select 0;[/color][/left] It has to be used in the init/condition or deactivation of the trigger. Its not documented to well but it does work, you just have to be careful with the settings of the trigger or it might not return what your expecting. http://community.bistudio.com/wiki/Mission_Editor:_Triggers#Condition http://forums.bistudio.com/showthread.php?105511-count-thislist-question&p=1718973&viewfull=1#post1718973 Edited February 26, 2012 by Riouken Share this post Link to post Share on other sites
demonized 16 Posted February 27, 2012 Can I somehow change triggername to this? And that will then refer to the trigger? Then I wouldnt have to put a name to many triggers, if I was using a lot of triggers. thisList in the trigger fields refer to the list of things triggering it. thisTrigger in the trigger fields refer to the trigger itself. Both only work in the trigger fields, not in any script, as Riouken said, its not very documented. lets say you have a trigger with no name with bluefor present as condition: in on act field of trigger you can use the 2 above commands, and pass them on to other scripts etc. hint format["%1 is this trigger, and %2 is the trigger list",thisTrigger,thisList]; or you can pass them to a script: on act: [thisTrigger,thisList] execVM "script.sqf"; script.sqf: _trigger = _this select 0; _triggerList = _this select 1; // now its not really needed to pass the list as you can gather it here now by using the "list _trigger" command. Share this post Link to post Share on other sites