RyanM 0 Posted July 13, 2009 Is there a way to make a trigger that can only be activated by the player unit? :confused: Trigger keeps getting activated by the AI. Share this post Link to post Share on other sites
Inkompetent 0 Posted July 13, 2009 I think that you can add the following in the Condition field: {isPlayer _x} forEach thisList So that if you have set up a trigger to say... trigger for WEST PRESENT, then make sure the Condition field looks like: this && ({isPlayer _x} forEach thisList) The double '&'-letters means 'AND' in generall programming-terms (it can be written with the word instead if you prefer), and the above line would mean that if the trigger settings are true (i.e. a WEST unit is in the trigger area), and if any of the people ('thisList' contains a list of all units in the trigger area) in the trigger area is a player, then both conditions for the trigger are true, and it'll activate. For multiplayer it becomes a bit more complex since you need to check what side the player belongs to, but for singleplayer the above should work fine. Share this post Link to post Share on other sites
magicpanda 19 Posted July 13, 2009 Yes you simply group or sync ( I cant remember which off the top of my head.) the trigger to the player. The options in the trigger will change to ones related to your squad. Share this post Link to post Share on other sites
Inkompetent 0 Posted July 13, 2009 Yes you simply group or sync ( I cant remember which off the top of my head.) the trigger to the player. The options in the trigger will change to ones related to your squad. Think you would need to group the trigger to the unit. But indeed, if there's only one single player squad in the mission this is an easy solution. Share this post Link to post Share on other sites
CombatComm 10 Posted November 11, 2009 (edited) Hey yall I tried this in condition field and get this error &&: type any, expected bool Whatsup with this? Thanks Edited November 12, 2009 by CombatComm Share this post Link to post Share on other sites
H3NRY 10 Posted November 12, 2009 i guess you have to use the boolean "AND" instead of "&&" for that ? guessing lol Share this post Link to post Share on other sites
shuko 59 Posted November 12, 2009 Nah, it's because of using foreach. Try: {isplayer _x} count thislist > 0 Edit: Without the whole "this &&" part as it's pointless, thislist already narrows the units down. Share this post Link to post Share on other sites
H3NRY 10 Posted November 13, 2009 Nah, it's because of using foreach.Try: {isplayer _x} count thislist > 0 Edit: Without the whole "this &&" part as it's pointless, thislist already narrows the units down. ah yeah that does make more sense, was just looking at the one part :) had those weird problems that sometimes the word works but the symbolic representation doesnt... annoying Share this post Link to post Share on other sites
shuko 59 Posted November 13, 2009 Symbolic operators works, but you have to remember that Arma 2 does not support lazy evaluation. Meaning, it checks every part of the condition instead of going through it one by one. For example, having an undefined variable will break a condition, even if another part of it would be true. Like, if we have a trigger with condition: condA || condB It means the trigger should fire when either of the conditions becomes true. But, if we set one to true, the trigger will not fire. condA = true; Now the condition is basically: true || condB The reason is that condB is undefined. The trigger will fire as soon as we give it a value, any value. condB = false will make the condition: true || false And off goes the trigger. Share this post Link to post Share on other sites
jw custom 56 Posted November 13, 2009 To make trigger activate on certain units simply use: unitName in thisList Share this post Link to post Share on other sites
shuko 59 Posted November 13, 2009 Yes, it's all nice and simple in SP, but in MP "player" can be one of many units. And using "player" in a condition will not fire a trigger on server, even if it goes off on the client. Share this post Link to post Share on other sites
CombatComm 10 Posted November 13, 2009 O shiot really? Cuz my mission is suppose to be online cooop? What kind of crazy magician shit needs to go down for it to work on server bro? Share this post Link to post Share on other sites
shuko 59 Posted November 13, 2009 Depends on what you are trying to check for. Of course, it doesn't matter even if server doesn't execute the trigger's onAct if there is nothing that needs to be done on the server side. Share this post Link to post Share on other sites
CombatComm 10 Posted November 14, 2009 checking for A player to activate. So if any one player on the server walks into this player present activated trigger it will act. Id want it to work. Share this post Link to post Share on other sites
shuko 59 Posted November 14, 2009 Did you try this yet? {isplayer _x} count thislist > 0 Share this post Link to post Share on other sites
CombatComm 10 Posted November 14, 2009 Yes I did and it works offline. Havent tested with other players yet online. It should work right? Share this post Link to post Share on other sites
shuko 59 Posted November 14, 2009 AFAIK, but haven't tested or used it. Share this post Link to post Share on other sites