Syntax Error
Posted: Thu Aug 12, 2021 4:19 am
Hello Folks,
So, I am constantly getting this error in my debugging log, for many of my maps, in various files such as the AI.con, the AIPathfinding.con, the StrategicAreas.con, etc:
Warning: Io: Error bf1942/levels/Coral_sea/ai.con: Can not have an "endIf" without an "if"!
Warning: Io: Error bf1942/levels/Coral_sea/ai.con (35): if v_arg1 == host
Engine\Io\Console.cpp
Warning: Io: Error bf1942/levels/Coral_sea/ai.con: Error: Syntax error in expression!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Below, I have copied and pasted my AI.con file for Coral_Sea as an example of what I have. Please tell me if anything is incorrect or how to correct these errors. Thank You.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rem ************** LEVEL SPECIFIC AI SETTINGS ***************************
if v_arg1 == host
aiSettings.setWorldMapSize 2048 2048
aiSettings.viewDistance 600
aiSettings.setInformationGridDimension 64
rem ********************** START THE AI *********************************
rem *** Init AI using current settings ****
ai.init 2
rem *** init Botmanager ***
AIBotManager.setLodLevelTicks 6 6 6
AIBotManager.setLodLevelPriority 3 3 3
AIBotManager.setPlannedDecisionMakingThreshold 0.5 0.5 0.5
AIBotManager.setUnplannedDecisionMakingThreshold 0.3 0.4 0.4
AIBotManager.setDecisionMakingInterleave 2 2
AIBotManager.setSensingQuotient 1 1
AIBotManager.setSystemQuotient 40 40 20
rem *** Strategic map dimension, MUST BE DONE BEFORE CREATING SAI! ***
ai.saiMapXDimension 64
ai.saiMapYDimension 64
rem *** Create Strategic AI ***
ai.createSAI
rem *** Bot statistic ***
ai.botStatisticUpdateSpeed 3
rem *** Enabled or disabled as default ***
ai.saiEnable 1
game.showAIstats 0
ai.showBotStats 0
endIf
run AIPathFinding.con
run ai/StrategicAreas.con
rem *** Load and set strategies for each side ***
run ai/conditions.con
run ai/prerequisites.con
run ai/Strategies.con
rem run ai/AIBehavioursTweaks.con
if v_arg1 == host
ai.addSAIStrategy 1 TeamAAttack
rem ai.addSAIStrategy 1 TeamADefend
rem ai.addSAIStrategy 1 TeamARepulse
ai.addSAIStrategy 2 TeamBAttack
rem ai.addSAIStrategy 2 TeamBDefend
rem ai.addSAIStrategy 2 TeamBRepulse
endIf
So, I am constantly getting this error in my debugging log, for many of my maps, in various files such as the AI.con, the AIPathfinding.con, the StrategicAreas.con, etc:
Warning: Io: Error bf1942/levels/Coral_sea/ai.con: Can not have an "endIf" without an "if"!
Warning: Io: Error bf1942/levels/Coral_sea/ai.con (35): if v_arg1 == host
Engine\Io\Console.cpp
Warning: Io: Error bf1942/levels/Coral_sea/ai.con: Error: Syntax error in expression!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Below, I have copied and pasted my AI.con file for Coral_Sea as an example of what I have. Please tell me if anything is incorrect or how to correct these errors. Thank You.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rem ************** LEVEL SPECIFIC AI SETTINGS ***************************
if v_arg1 == host
aiSettings.setWorldMapSize 2048 2048
aiSettings.viewDistance 600
aiSettings.setInformationGridDimension 64
rem ********************** START THE AI *********************************
rem *** Init AI using current settings ****
ai.init 2
rem *** init Botmanager ***
AIBotManager.setLodLevelTicks 6 6 6
AIBotManager.setLodLevelPriority 3 3 3
AIBotManager.setPlannedDecisionMakingThreshold 0.5 0.5 0.5
AIBotManager.setUnplannedDecisionMakingThreshold 0.3 0.4 0.4
AIBotManager.setDecisionMakingInterleave 2 2
AIBotManager.setSensingQuotient 1 1
AIBotManager.setSystemQuotient 40 40 20
rem *** Strategic map dimension, MUST BE DONE BEFORE CREATING SAI! ***
ai.saiMapXDimension 64
ai.saiMapYDimension 64
rem *** Create Strategic AI ***
ai.createSAI
rem *** Bot statistic ***
ai.botStatisticUpdateSpeed 3
rem *** Enabled or disabled as default ***
ai.saiEnable 1
game.showAIstats 0
ai.showBotStats 0
endIf
run AIPathFinding.con
run ai/StrategicAreas.con
rem *** Load and set strategies for each side ***
run ai/conditions.con
run ai/prerequisites.con
run ai/Strategies.con
rem run ai/AIBehavioursTweaks.con
if v_arg1 == host
ai.addSAIStrategy 1 TeamAAttack
rem ai.addSAIStrategy 1 TeamADefend
rem ai.addSAIStrategy 1 TeamARepulse
ai.addSAIStrategy 2 TeamBAttack
rem ai.addSAIStrategy 2 TeamBDefend
rem ai.addSAIStrategy 2 TeamBRepulse
endIf