Over The Reich is a scenario that uses the template, if you want a general example of file placements.
Over the Reich
doesn't use the template. The template was a response to how disorganised OTR's events became after "one more feature" syndrome took hold. JPetroski's
Hinge of Fate does use an older version of the template.
I also may be dealing with the lua template incorrectly. Is that .zip file meant to be extracted into the scenario folder? I wonder this because in other scenarios, i.e. Napoleon and Caesar, those lua folders are not placed into the scenario folders. Are they meant to be extracted in the ToT folder more generally?
You should be extracting the Lua Scenario Template into the folder of your scenario (the same place as the custom rules.txt).
As Knighttime mentioned, not all scenarios use the Lua Scenario Template, so they will be organised differently. If you want, you can place everything in a single events.lua file. The problem is that it quickly becomes an organisational nightmare (and you run into the 200 local variable per function limit). In older scenarios, there may be instructions to change files in the TestOfTime/lua folder. This is because when we started using Lua, the game would look for extra "required" lua files in that folder first. Now, we know how to override that functionality, so the game can be made to look only in the scenario's directory (and designated subdirectories). Tools and best practices have been evolving over the past few years.
I see, that is very clear, thank you. So I wrote into object.lua the following:
Code:
object.bDesert = civ.getTerrain(0,0,0)
Does this make sense? And then the added code to events.lua will pick that up and process it as desert on map 0, with no resources?
Yes, this is correct. However, you don't have to build the whole object table yourself. The beginning of this
video shows how to install the Lua Scenario Template to an existing scenario and generate an object.lua file with a script. Since the template has changed a bit, you have to move legacyEvents.txt to the EventsFiles directory instead of LuaTriggerEvents.