- New commands during/after script.on_init and script.on_load using commands.add_command
Code: Select all
function add_commands()
commands.add_command("test", 'test', function()
game.print("test")
end)
end
script.on_init(add_command)
script.on_load(add_command)
- Download and place it as scenario
- Load "test_add_command" as a scenario
- Try to type in /test in the chat
- Save the game
- Load the save
- Try to type in /test in the chat
- There are no new commands after script.on_init and script.on_load
- I didn't check other Factorio versions