56Curious 23 Posted August 11, 2017 Hello, so I gathered some help with a condition that went along the lines of: count thisList > 0 && {count (thisList select {side _x isEqualTo west})/count thisList isEqualTo 0.75} however I want to intergrate OPFOR both having the ablity to do the above, as well as effect it. Outline: I am hoping to create a conquest-esque gamemode, however the double trigger set-up I have isn't really optimal. 2 BLUFOR units enter a trigger with 1 OPFOR unit. BLUFOR have the control, therefore the script to set an objects texture is exectued. If 2 OPFOR units enter, BLUFOR are out numbered and therefore the objects texture is changed accordingly. The trg act isn't being forfilled either which makes me think that the condition maybe incorrect? Maybe i've been over thinking things, however any help would be appricated. Share this post Link to post Share on other sites
davidoss 552 Posted August 11, 2017 Maybe this can help you out. This example is about defining flagpole side according to which side control the area. if (isServer) then { _flagspos = []; _flags = allMissionObjects "FlagPole_F"; { _x setVariable ["flagowner","noowner",false]; _flagspos pushBack (position _x); } forEach _flags; null = _flags spawn { _compare_array = { _cntblue = _this select 0; _cntred = _this select 1; _cntgreen = _this select 2; _array = [_cntblue, _cntred, _cntgreen]; if ( ((_array select 0) isEqualTo (_array select 1) && (_array select 2) <= (_array select 0)) || ((_array select 0) isEqualTo (_array select 2) && (_array select 1) <= (_array select 0)) || ((_array select 1) isEqualTo (_array select 2) && (_array select 0) <= (_array select 1)) ) exitWith {false}; _arraySlided = + _array; _arraySlided sort false; _arraySlided params ["_max"]; _return = _array find _max; _return }; while {true} do { sleep 2; { _allunitsinside = allunits select {alive _x && ((position _x) inArea [position _x, 300, 300, 360, false, -1])}; _unitsblueinside = _allunitsinside select {alive _x && side _x == WEST}; _unitsredinside = _allunitsinside select {alive _x && side _x == EAST}; _unitsgreeninside = _allunitsinside select {alive _x && side _x == INDEPENDENT}; _result = [count _unitsblueinside, count _unitsredinside, count _unitsgreeninside] call _compare_array; diag_log str _result;// 0||1||2 || false switch _result do { case 0: { hint "blue"; _x setVariable ["flagowner","blue",false]; }; case 1: { hint "red"; _x setVariable ["flagowner","red",false]; }; case 2: { hint "green"; _x setVariable ["flagowner","green",false]; }; case (false): { hint "equal"; }; default {}; }; sleep 2; } forEach _this; }; }; }; Share this post Link to post Share on other sites
56Curious 23 Posted August 11, 2017 Great help! Thank you. Share this post Link to post Share on other sites