-- all functions below are optional and can be left out
--[[
functionOnModPreInit()
print("Mod - OnModPreInit()")-- First this is called for all mods
end
functionOnModInit()
print("Mod - OnModInit()")-- After that this is called for all mods
end
functionOnModPostInit()
print("Mod - OnModPostInit()")-- Then this is called for all mods
end
functionOnPlayerSpawned(player_entity)-- This runs when player entity has been created
GamePrint("OnPlayerSpawned() - Player entity id: "..tostring(player_entity))
end
functionOnWorldInitialized()-- 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.
functionOnMagicNumbersAndWorldSeedInitialized()-- this is the last point where the Mod* API is available. after this materials.xml will be loaded.
localx=ProceduralRandom(0,0)
print("===================================== random "..tostring(x))
end
-- This code runs when all mods' filesystems are registered
ModLuaFileAppend("data/scripts/gun/gun_actions.lua","mods/example/files/actions.lua")-- Basically dofile("mods/example/files/actions.lua") will appear at the end of gun_actions.lua
ModMagicNumbersFileAdd("mods/example/files/magic_numbers.xml")-- Will override some magic numbers using the specified file
ModRegisterAudioEventMappings("mods/example/files/audio_events.txt")-- Use this to register custom fmod events. Event mapping files can be generated via File -> Export GUIDs in FMOD Studio.
ModMaterialsFileAdd("mods/example/files/materials_rainbow.xml")-- Adds a new 'rainbow' material to materials