How to Apply LUA file to campaign scenario

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

Moderator: Panzer Corps 2 Moderators

Post Reply
Franc Peinovich
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 5
Joined: Fri Jul 23, 2021 12:40 pm

How to Apply LUA file to campaign scenario

Post by Franc Peinovich »

Hello,

I am making a custom campaign. I have made several scenarios and am using >my documents >campaigns to have them appear in the game as a custom campaign. All is working fine, including the campaign script tree and campaign LUA file.

Problem is, individual LUA trigger files (ex: Wlodawa.Lua in same campaigns folder directory as Wlodawa.pzc2) does not seem to apply to levels when played in the game, despite applying to them when run from the editor.

Example: I have a Lua trigger file for a map, I run the map from the editor and all the custom triggers work (ex: player gets notifications and rewards for certain tasks). However, I run the level from selecting the custom campaign in the game menu and the triggers do not fire (the rest of the map works as intended).

Do the Lua files for triggers need to be placed somewhere other than within the same directory as the map files with the same name? Or is there a certain function/Lua script that I need to add/remove from the files to have them apply when played from the game?

I am using edited versions of script from the DLC and main campaign as a base, as I am new to LUA.

Any suggestions are appreciated.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1955
Joined: Mon Aug 04, 2014 10:07 pm

Re: How to Apply LUA file to campaign scenario

Post by Grondel »

hi franc,

some ideas that might cause ur issue.


have u tried to give ur campaign a folder structure for each map?

like this:
\campaign\01scenario\...

this is how it is done in the ao campaigns for the game and how we do it in our mods. never had the issue ur talking about. maybe this will solve it for u.


another possible issue is the campaigns.csv that needs a path for ur campaign, that might be missing.


sers,
thomas
Post Reply

Return to “Panzer Corps 2 Scenario Design”