The side command returns the value guer for all greenfor units. When making comparisons to the value guer, it will return (bool) as a value, not true or false. {F20374}
Description
Details
- Legacy ID
- 2041666326
- Severity
- None
- Resolution
- No Bug
- Reproducibility
- Always
- Category
- Scripting
I've uploaded the mission folder for you to try. The map contains three units, a bluefor unit (named BlueUnit), opfor unit (named RedUnit), greenfor unit (named GreenUnit). The comparison script is executed via Radio Alpha command.
The script gets the side value from each of those units and does comparisons on the returned side value:
_sideBlue = side BlueUnit;
_sideRed = side RedUnit;
_sideGreen = side GreenUnit;
diag_log format ["_sideBlue (%1) == west (%2)",_sideBlue,_sideBlue == west];
diag_log format ["_sideBlue (%1) == blufor (%2)",_sideBlue,_sideBlue == blufor];
diag_log format ["_sideRed (%1) == east (%2)",_sideRed,_sideRed == east];
diag_log format ["_sideRed (%1) == opfor (%2)",_sideRed,_sideRed == opfor];
diag_log format ["_sideGreen (%1) == resistance (%2)",_sideGreen,_sideGreen == resistance];
diag_log format ["_sideGreen (%1) == guer (%2)",_sideGreen,_sideGreen == guer];
diag_log format ["_sideGreen (%1) == independent (%2)",_sideGreen,_sideGreen == independent];
The result from my test run is as follows:
"_sideBlue (WEST) == west (true)"
"_sideBlue (WEST) == blufor (true)"
"_sideRed (EAST) == east (true)"
"_sideRed (EAST) == opfor (true)"
"_sideGreen (GUER) == resistance (true)"
"_sideGreen (GUER) == guer (bool)"
"_sideGreen (GUER) == independent (true)"
As you can see, guer cannot compare to itself...
Another fast repro:
- Enter debug console.
- Track variables:
[[OPFOR,EAST],[BLUFOR,WEST],[GUER,RESISTANCE]]
Observed
[[EAST,EAST],[WEST,WEST],[any,GUER]]
Expected
[[EAST,EAST],[WEST,WEST],[GUER,GUER]]
or
[[OPFOR,OPFOR],[BLUFOR,BLUFOR],[GUER,GUER]]
Event Timeline
Quite important issue.
Another fast repro:
- Enter debug console.
- Track variables:
[[OPFOR,EAST],[BLUFOR,WEST],[GUER,RESISTANCE]]
Observed
[[EAST,EAST],[WEST,WEST],[any,GUER]]
Expected
[[EAST,EAST],[WEST,WEST],[GUER,GUER]]
or
[[OPFOR,OPFOR],[BLUFOR,BLUFOR],[GUER,GUER]]
'Guer' is not a scripting command and it has never been. Therefore it's no surprise it does not return anything. See list of Arma 3 commands, wou won't find it there: http://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
'Resistance' and 'Independent' are only valid commands returning the green side.