Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnModPreInit()
- print("PenTest - OnModPreInit()") -- First this is called for all mods
- end
- function OnModInit()
- print("PenTest - OnModInit()") -- After that this is called for all mods
- end
- function OnModPostInit()
- print("PenTest - OnModPostInit()") -- Then this is called for all mods
- end
- function OnPlayerSpawned( player_entity ) -- This runs when player entity has been created
- GamePrint( "PenTest - OnPlayerSpawned() - Player entity id: " .. tostring(player_entity) )
- end
- function OnWorldInitialized() -- This is called once the game world is initialized. Doesn't ensure any world chunks actually exist. Use OnPlayerSpawned to ensure the chunks around player have been loaded or created.
- GamePrint( "PenTest - OnWorldInitialized() " .. tostring(GameGetFrameNum()) )
- end
- function OnWorldPreUpdate() -- This is called every time the game is about to start updating the world
- --GamePrint( "PenTest - Pre-update hook " .. tostring(GameGetFrameNum()) )
- end
- function OnWorldPostUpdate() -- This is called every time the game has finished updating the world
- --GamePrint( "PenTest - Post-update hook " .. tostring(GameGetFrameNum()) )
- end
- local outstr = ""
- local function out(str)
- outstr = outstr..str.."\n"
- end
- local function dump(tbl, seen, indent)
- seen[tbl] = true
- for k, v in pairs(tbl) do
- out(indent..string.format("(%s) %q = (%s) %q", type(k), tostring(k), type(v), tostring(v)))
- if type(k) == "table" and seen[k] ~= true then
- seen = dump(k, seen, indent.."\t")
- end
- if type(v) == "table" and seen[v] ~= true then
- seen = dump(v, seen, indent.."\t")
- end
- seen[k] = true
- seen[v] = true
- end
- return seen
- end
- dump(_G, {}, "")
- error("\n"..outstr)
Add Comment
Please, Sign In to add comment