Howdy - I’m trying to debug why my scripts are not loading correctly into my mod, but unable to determine why. I think there might be something fundamentally wrong with my file structure, but only the scripts do not work, all dbr-based changes are working.
The goal is to give a xp potion to a new character as soon as they appear in town after being created.
Can someone please help me debug? What I’ve done so far:
- Downloaded Grim Internals to enable print outputs into the game console (nothing is printing)
- Set up asset manager
- Created the following file structure for scripts (main is the name of the mod in this case - know, poor name choice but please bear with me):
- MAIN/source > scripts > game > main
- in scripts, I have main.lua (unrelated to mod, entry point from grim dawn)
- in scripts/game, grimdawn.lua
- in scripts/game/MAIN, mainmod.lua
Contents:
main.lua:
– Libs
Script.Load(“scripts/libs/shared.lua”)– Game
Script.Load(“scripts/game/grimdawn.lua”)
grimdawn.lua (the fact that the prints here are not triggering tells me it hasn’t loaded, but unsure if that’s just the print flat out not working)
print “aaa”
print(“aaanother format”)
gd = {}// Mod - starter items Script.Load("scripts/game/MAIN/mainmod.lua") // Endless Dungeon Script.Load("scripts/game/endlessdungeon.lua") // Quests Script.Load("scripts/game/quests.lua") Script.Load("scripts/game/dungeonchestsgdx1.lua") Script.Load("scripts/game/dungeonchestsgdx2.lua") Script.Load("scripts/game/dungeonchests.lua") Script.Load("scripts/game/events/waveevent.lua")
mainmod.lua
print “aaa inside mainmod”
print("aaanother format inside mainmod ")
gd.MAIN = {}function gd.MAIN.StarterItems(id)
print(“inside func”)
local player = Game.GetLocalPlayer()if(player:GetLevel() > 1 || Game.GetGameDifficulty() ~= Game.Difficulty.Normal) then
return
endplayer:GiveItem(“records/items/crafting/consumables/gdl_xppotion_malmouth.dbr”, 2, false)
end
A follow-up question:
Where do I actually trigger the script to execute on start? I have the function but I’m not calling it yet, because I don’t know where to yet.