I'm thinking about creating a mod but from what little modding i've done so far you need to edit control.lua and reload the game to see if it works, this slows things down quite a bit.
Is there anyway to do my write a function in the console, and then once it works copy it to control.lua? I think this would help speed up development.
on_tick from the console
Re: on_tick from the console
Yes, you can write it the same way as in control.lua.
Writing it again overwrites your old function.
Note that you won't have access to any of your mod variables unless you build a getter.
Code: Select all
/c
script.on_event(defines.events.on_tick, function(event)
game.player.print(game.tick)
end)
Code: Select all
/c
script.on_event(defines.events.on_tick, nil)
Re: on_tick from the console
Hi JoeSchmoe,
do you reload the entire game, or just the save?
My observation was, that control.lua is reloaded on each save game load.
do you reload the entire game, or just the save?
My observation was, that control.lua is reloaded on each save game load.