That did it!
Thank you!
I changed the code to run off the "
side" variable instead and it appears to be working correctly.
var int currentUnitSide;
# [=] Only run during their own turn [=]
unit.getFaction currentUnitSide;
if neq side currentUnitSide;
return;
end;
I also tried without success using
BattleGame.getTurnSide and
unit.getFaction to pass the values to variables first:
var int currentTurnSide;
var int currentUnitSide;
# [=] Only run during their own turn [=] (In theory)
BattleGame.getTurnSide currentTurnSide;
unit.getFaction currentUnitSide;
if neq currentTurnSide currentUnitSide;
return;
end;
But that produced this error.
[08-10-2021_05-52-12] [ERROR] Can't match overload for operator 'BattleGame.getTurnSide' for:
[08-10-2021_05-52-12] [ERROR] [var int]
[08-10-2021_05-52-12] [ERROR] Expected:
[08-10-2021_05-52-12] [ERROR] [ptr BattleGame] [var int]
[08-10-2021_05-52-12] [ERROR] Error in parsing script 'newTurnUnit' for 'Global Event Script': invalid operation in line: 'BattleGame.getTurnSide currentTurnSide;'
Although I'm not using the
BattleGame.getTurnSide unit.getFaction version I'm still interested in understanding what went wrong with it so as to avoid repeating the error.
Both variables are defined before the section of code that assigns them a value and only the variables are now used in the
IF comparison line instead of the
.get operations.
The error message seems to read that the line where
BattleGame.getTurnSide assigns its value to the
currentTurnSide variable is the problem.
If I'm reading it correctly the verbose version of the
openxcom.log's
newTurnUnit section list
BattleGame.getTurnSide as requiring only the variable it assigns its value to.
Name: BattleGame.getTurnSide Args: [ptr BattleGame] [var int] Desc: Return the faction whose turn it is.
How should I have phrase this line instead?
BattleGame.getTurnSide currentTurnSide;
(Fixed version of the example mod) (Uses "side" variable.)TestModStatusEffects (Fixed).zip(Broken version of the example mod) (Uses BattleGame.getTurnSide)TestModStatusEffects (Broken).zip