Page 1 of 1

Problem with lua script file- NEED HELP

Posted: Sun Jan 03, 2021 11:49 pm
by Ezequiel1996
i added a lua script to an scenario that i did, the script spawn waves of enemies like in the dlc´s but when i put the script in the same folder of the scenario when i try to play it from the editor it doesn't starts and sends me to the main menu of the game what could be wrong? if i remove the lua file from the folder where the scenario is, it loads normally again.
here is the lua file.

Re: Problem with lua script file- NEED HELP

Posted: Mon Jan 04, 2021 12:39 am
by Kerensky
If LUA files are not 100% perfect, they will fail to load entirely. This is seen when loading a scenario just dumps you to main menu screen.

Something as innocent as a misplaced ' or " can cause this failure to load. When I need to troubleshoot my LUA, I start from the ground up. Pick one function to test at a time, and test them by making them trigger on turn 1. Only by testing each script one at a time do I know they all work, and then can put them all together into a scenario.

Re: Problem with lua script file- NEED HELP

Posted: Mon Jan 04, 2021 1:22 am
by Ezequiel1996
thank you! one more question i want to create a custom equipment list, where i can find the ones used on the dlc's for reference?

Re: Problem with lua script file- NEED HELP

Posted: Mon Jan 04, 2021 1:27 am
by Kerensky
DLC don't use them.

But the solo scenario Prague and Multiplayer Scenario Maresal at War do. Those are examples that can be looked at.

Re: Problem with lua script file- NEED HELP

Posted: Mon Jan 04, 2021 1:58 am
by Ezequiel1996
while looking on the scw scenarios i found that it uses a custom file named iberia, and also what are the rule files?
PD: thank you so much for the earlier answer i found the issue, i missed one { and that was crashing the scenario. now it works properly