Page 1 of 1

How to Apply LUA file to campaign scenario

Posted: Tue Apr 19, 2022 3:11 am
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.

Re: How to Apply LUA file to campaign scenario

Posted: Tue Apr 19, 2022 11:59 am
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