Teutch 3 Posted February 14, 2023 Is there a way to ensure that a trigger is activated when a certain number of sectors are in the hands of one side ? A sort of mixture between these two codes : _sector getvariable "owner" == east ({side _x == blufor} count allsector) == 10 Thank you in advance ! Share this post Link to post Share on other sites
pierremgi 4850 Posted February 14, 2023 count (allMissionObjects "logic" select {_x getVariable "owner" == WEST}) 2 Share this post Link to post Share on other sites
Teutch 3 Posted February 14, 2023 Clear and precise, thanks for your quick answer pierremgi ! Share this post Link to post Share on other sites
Teutch 3 Posted February 14, 2023 25 minutes ago, pierremgi said: count (allMissionObjects "logic" select {_x getVariable "owner" == WEST}) It seems to work! But one last question my good man: How do you get a trigger to activate when, lets say, 10 sectors are in the hands of one side ? ie : What will we have in it condition ? Share this post Link to post Share on other sites
Larrow 2820 Posted February 14, 2023 12 minutes ago, Teutch said: What will we have in it condition ? [ west ] call BIS_fnc_moduleSector == 10 1 Share this post Link to post Share on other sites
Teutch 3 Posted February 14, 2023 Wow two legends answered my simple question ! its working now. Thanks guys for your patience ! Share this post Link to post Share on other sites
Larrow 2820 Posted February 14, 2023 6 hours ago, Teutch said: Is there a way to ensure that a trigger is activated when a certain number of sectors are in the hands of one side ? There is no need for the trigger if you want, you can get sectors to run an event when they change owner... //initServer.sqf //For each sector in the mission { //Add a owner changed event to the sector [ _x, "ownerChanged", { params[ "_sector", "_owner" ]; //If the sector changed owner to west if ( _owner == west ) then { //And west now own 10 sectors if ( [ west ] call BIS_fnc_moduleSector == 10 ) then { //Do what ever here }; }; } ] call BIS_fnc_addScriptedEventHandler; }forEach ( [ true ] call BIS_fnc_moduleSector ); 3 Share this post Link to post Share on other sites
Teutch 3 Posted February 14, 2023 It's perfect! thank you very much Larrow ! Share this post Link to post Share on other sites