(Goal)I've been trying to modify Yankes "
Poison Script" into one that reduces all armor on an effected unit instead.
(Problem). The mod is producing an "End of map not found." error.
ERROR: failed to load 'Testing Mod: Acid Script'; mod disabled
./user/mods/TestModAcid/Ruleset/scriptAcid.rul: yaml-cpp: error at line 70, column 13: end of map not found
(What I've tried so far)So far I've check that:
. All the code is indented via two spaces.
. All
IF statements have a corresponding
end; command.
. All lines end in a
; to close them.
(Example Mod)For convenience I've attached the mod I'm working with that contains the modified script to this post:
TestModAcid V0-1.zipLast time I was working with a script and it produced an "End of map not found." the error was an
IF statement without an
end; command.
This time all
IF statements appear to be properly closed with an
end; and if I remove the section of code that is referenced by the error message it just changes the line that is producing the error to be later in the
.rul file.
I'm at a loss with this.
I tried removing sections of the code that had the "error at line" message but the error continued to occur:
scriptAcid.rul: yaml-cpp: error at line 70, column 13: end of map not found.
As line 70 is this block of code:
# Make sure Armor is not Less than 0
if lt frontarmor 0;
set frontarmor 0;
end;
if lt leftarmor 0;
set leftarmor 0;
end;
if lt reararmor 0;
set reararmor 0;
end;
if lt rightarmor 0;
set rightarmor 0;
end;
if lt underarmor 0;
set underarmor 0;
end;
my first thought was that perhaps you cannot nest
IF statements, example:
if lt X 0;
if lt Y 0;
set underarmor 0;
end;
end;
However I've seen scripts with nested
IF statements so I don't think that is the problem.
When I removed the section of code that was mentioned in the error message a new one was produced:
scriptAcid.rul: yaml-cpp: error at line 90, column 13: end of map not found.
Line 90 is the following code:
Unit.setArmor 0 frontarmor;
Unit.setArmor 1 leftarmor;
Unit.setArmor 2 reararmor;
Unit.setArmor 3 rightarmor;
Unit.setArmor 4 underarmor;
From what I've read in the
openxcom.log with
verboseLogging: true the
BattleUnit.setArmor variable requires two variables.
The first is the direction of the armor to be effected and the second is a variable with the value to give the selected armor.
I've noticed that in other scripts the "
BattleUnit." part is abbreviated to "
Unit."
if I'm using the wrong command please let me know.I tried removing that section of code as well. I need it for the script to work but I wanted to see if it would load without an error.
Unfortunately this caused the same error but with a different line referenced:
scriptAcid.rul: yaml-cpp: error at line 96, column 13: end of map not found.
Line 96 is:
sub frontarmor acid;
sub leftarmor acid;
sub reararmor acid;
sub rightarmor acid;
sub underarmor acid;
These commands should be simple subtraction of the "
acid" value from each of the five "
armor" variables.
Again I tried removing the code section and again the error appeared:
scriptAcid.rul: yaml-cpp: error at line 102, column 13: end of map not found.
Line 102 is:
sub duration 1;
unit.setTag Tag.ACID_REMAINING duration;
After removing the code around line 102 the error directed me to line 105:
scriptAcid.rul: yaml-cpp: error at line 105, column 13: end of map not found.
Line 105 is an
end; command for an
IF statement earlier in the code so it shouldn't be a problem.
I checked the indentation and it should match the
IF statement that it belongs to so I'm not sure why it is throwing the error.
I could keep removing lines of code but it seems like that would created additional problems as the
IF end; code block would be broken.
What am I missing?