Problem with lua script file- NEED HELP

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Post Reply
Ezequiel1996
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Sat Jun 13, 2020 6:58 am

Problem with lua script file- NEED HELP

Post 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.
Attachments
05Piatek.rar
(1.54 KiB) Downloaded 67 times
Kerensky
Content Designer
Content Designer
Posts: 8649
Joined: Wed Jan 12, 2011 2:12 am

Re: Problem with lua script file- NEED HELP

Post 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.
Ezequiel1996
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Sat Jun 13, 2020 6:58 am

Re: Problem with lua script file- NEED HELP

Post 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?
Kerensky
Content Designer
Content Designer
Posts: 8649
Joined: Wed Jan 12, 2011 2:12 am

Re: Problem with lua script file- NEED HELP

Post 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.
Ezequiel1996
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Sat Jun 13, 2020 6:58 am

Re: Problem with lua script file- NEED HELP

Post 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
Post Reply

Return to “Panzer Corps 2 Scenario Design”