trying to create new game surface
Posted: Sat May 12, 2018 8:41 am
im attempting to create a new surface layer and apon starting a new game i get an error stating that it can not index game.
this is the code from the control.lua file inside the mods folder. as far as i can tell according to the api doc it should be game.create_surface to make a new surface but it doesnt seem to work. most of the code has been commented out as i kept getting errors trying to generate a surface when the rocket silo is built.
this is the code from the control.lua file inside the mods folder. as far as i can tell according to the api doc it should be game.create_surface to make a new surface but it doesnt seem to work. most of the code has been commented out as i kept getting errors trying to generate a surface when the rocket silo is built.
Code: Select all
--script.on_event(defines.events.on_built_entity, function(event)
--local entity = event.created_entity
--local surface = game.surfaces
--if entity.name == "rocket-silo" then
--if game.surfaces["Space"] == nil then
game.create_surface("Space")
--surface.daytime = 0.5
--end
--end
--)