Run a script on load-time

Howdy all,

If I were to want to run a script as soon as the game is done loading, how would I go about this?

Currently I have
Manifest.json

{
"info" : {
	"name" : "Test Monkey Patch Mod",
	"namespace" : "blablabla",
	"version" : 3,
	"steam_file_id" : "1510607338"
},
"default_locale" : "en",
"aliases" : {},
"mixintos" : {},
"overrides" : {},
"components" : {

},
"classes" : {
},

"game": {

},
"server_init_script": "file(my_monkey_patch)",

}

my_monkey_patch.lua

local log = radiant.log.create_logger('kai')
log.error("my monkey patch would go here")
assert(false)

I have tried with with "server_init_script": "file(my_monkey_patch.lua)".

I am sure I am missing something obvious, as until now I have got away with being able to put my monkey patches inside the controller of my traits.

And it magically started working after a while… I guess I will never know what i was doing wrong

2 Likes