Freeplay Scenario player joined message interface
Posted: Sun Jan 20, 2019 7:02 pm
Can the Freeplay scenario control.lua include an interface/commands to disable the default new game behaviour, in the same manner as the silo script can be disabled. As this scenario is the default used by most servers it would be helpful for mods that use different win conditions or starting conditions to be able to prevent these behaviours and implement only their own.
code in control.lua from Freeplay scenario
I am aware that the player inventory items can be removed by mods, but the win conditions message cannot be undone and the charter chunks in Multiplayer would be problematic to unchart appropriately when new players join mid game.
I know this isn't a strict modding interface request, but it is part of the core game so seemed the best place for it.
code in control.lua from Freeplay scenario
Code: Select all
script.on_event(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
player.insert{name="iron-plate", count=8}
player.insert{name="pistol", count=1}
player.insert{name="firearm-magazine", count=10}
player.insert{name="burner-mining-drill", count = 1}
player.insert{name="stone-furnace", count = 1}
player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}})
if (#game.players <= 1) then
game.show_message_dialog{text = {"msg-intro"}}
else
player.print({"msg-intro"})
end
silo_script.on_player_created(event)
end)
I know this isn't a strict modding interface request, but it is part of the core game so seemed the best place for it.