I have a very simple demonstration mod with three files. One of the files is a ReadMe, and the other two
and
When I load the mod (keeping all others disabled), set up a new game, play a couple turns and quit, nothing from
Simple Test Mod.modinfo
:
XML:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="12345678-abcd-4321-abcd-1234567890ab" version="1">
<Properties>
<Name>Logger Test</Name>
<Teaser>Logs a message on activation and during the first turn of the game.</Teaser>
<Description>Logs a message on activation and during the first turn of the game.</Description>
<Authors>Me</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>0</AffectsSavedGames>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsHotSeat>1</SupportsHotSeat>
<SupportsMac>1</SupportsMac>
<ReloadAudioSystem>0</ReloadAudioSystem>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
<ReloadUnitSystem>0</ReloadUnitSystem>
</Properties>
<Files>
<File md5="10AB29183716351BD291039187351002" import="1">LoggerTest.lua</File>
</Files>
<Actions>
<OnModActivated>
<File>LoggerTest.lua</File>
</OnModActivated>
<InGameActions>
<!-- <ImportFiles>LoggerTest.lua</ImportFiles> -->
<!-- <File>LoggerTest.lua</File> -->
<AddGameplayScript>LoggerTest.lua</AddGameplayScript>
</InGameActions>
</Actions>
</Mod>
LoggerTest.lua
:
Code:
print("Hello from LoggerTest.lua!")
GameEvents.PlayerDoTurn.Add(function(iPlayer)
print("LoggerTest function ran!")
if iPlayer == 0 then
print("Turn started for player 0")
end
end)
LoggerTest.lua
is printed to Lua.log
. I cannot understand why this is not working. Throughout my troubleshooting with ChatGPT and Perplexity, <AddGameplayScript>
has been a common refrain, yet it seems for all the world like <AddGameplayScript>
just doesn't do anything. I can get things to print if I do <EntryPoint type="InGameUIAddin">
, but I can't hook into GameEvents.TeamTechResearched
with a UI addin, which is ultimately what I want to do. Can anyone please explain what I'm doing wrong?
Last edited: