[TOTPP] Lua Scenario Template

Get the music option "on" ? (game/game option/"music" box)

Advice from the guy who hardly played music :D .
You could check if it works by doing (game/pick music).
Otherwise, you can also launch a music using Lua and, per exemple, a onKeyPress.

Please notice that, while sounds are overlapping, only one music is played at a time. ;)
Ugh... so silly! Did not have that box ticked. I don't know how it "un-ticked" though. Anyway, all good now. :) Thanks @Dadais !
 
In LuaParameterFiles/customMusicIntegration.lua, there is a line
Code:
local useCustomMusic = false
which must be set to true (in addition to the TOTPP music patch being enabled). Otherwise, the game will refer to whatever playlist is in <Test of Time Directory?\lua\extendedMusicSettings.lua.

I'm pretty sure that the end user doesn't need to have the Extended Music Patch installed to get custom music with customMusicIntegration.lua. The older version needed it, because files would be overwritten in the Test of Time\Music folder, and I didn't want everyone shipping code that overwrites files.
Ah OK, this is helpful to hear. So I can keep my "ToT/lua" files as they are?
 
It has come to my attention that the Legacy Event Engine has a bug. The TURN event doesn't work for parameter turn=every. The template has been updated with the fix, which is attached here as well.
 

Attachments

Hello @Prof. Garfield,

could you have a look at your LUA template files please?
I`ve downloaded them from your github server and the game shows me the following error message when I start a savegame.
1726340126416.png


I didn't change anything, I only downloaded the files and copied them into my scenario folder.
 
Hello @Prof. Garfield,

could you have a look at your LUA template files please?
I`ve downloaded them from your github server and the game shows me the following error message when I start a savegame.
View attachment 703399

I didn't change anything, I only downloaded the files and copied them into my scenario folder.
Check your rules under COSMIC2, particularly the railroad multiplier. The changeRules module expects the rules.txt file to be correct (and maybe complete). Perhaps I should make the module more permissive of errors...

Let me know if you can't fix the issue, and I'll have a closer look.
 
I've checked the multiplier entries and fixed them.
It seems that LUA has a problem with 'no' entries in rules file. I've a lot of technologies as well as units which can't be build and therefor set to 'no'.
I'm not really sure but I still remember that we had this problem already but I don't really know how we fixed it.

In my Reformation scenario I've also values within the rules file set to 'no' and LUA never showed an error message.

I've tested it on a clean rules file. When everything is set to 'nil' no problems. But if I set one value to 'no' LUA shows the following error message:
1726514818611.png
 
It seems that LUA has a problem with 'no' entries in rules file. I've a lot of technologies as well as units which can't be build and therefor set to 'no'.
I'm not really sure but I still remember that we had this problem already but I don't really know how we fixed it.

In my Reformation scenario I've also values within the rules file set to 'no' and LUA never showed an error message.

I've tested it on a clean rules file. When everything is set to 'nil' no problems. But if I set one value to 'no' LUA shows the following error message:
The changeRules module can deal with "no" as a prerequisite tech, but not as an expires tech. Perhaps I should change that.
 
If I had realised that "no" was allowed, but invalid tech codes caused the game to crash, I probably would have programmed things a bit different. "no" as an expires tech is now allowed.

I've updated the template on GitHub, but here's the specific file.

Let me know if you have any further problems.
 

Attachments

Back
Top Bottom