starting spawn
This commit is contained in:
parent
bd292e4489
commit
b78485eaa5
5 changed files with 26 additions and 1 deletions
|
@ -3,6 +3,8 @@ Version: 0.1.4
|
|||
Date: 2022-12-02
|
||||
Fixes:
|
||||
- Finite oil no longer produces gas when combined with some other mods
|
||||
Changes:
|
||||
- Add some gas to the starting area if there isn't any yet. (Can turn off in Map settings)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.1.3
|
||||
Date: 2022-10-23
|
||||
|
|
15
control.lua
15
control.lua
|
@ -14,3 +14,18 @@ function on_console_chat(event)
|
|||
end
|
||||
end
|
||||
script.on_event(defines.events.on_console_chat, on_console_chat)
|
||||
|
||||
function on_init()
|
||||
if global.starting_spawn then return end
|
||||
if settings.global["bzgas-force-spawn"].value then
|
||||
local gas = game.surfaces["nauvis"].find_entities_filtered({area = {{-100, -100}, {100, 100}}, name="gas"})
|
||||
if #gas == 0 then
|
||||
local position=game.surfaces["nauvis"].find_non_colliding_position("gas", {math.random(-100,100),math.random(-100,100)}, 0, 1)
|
||||
if position then
|
||||
game.surfaces["nauvis"].create_entity({name="gas", amount=math.random(400000, 999999), position=position})
|
||||
end
|
||||
end
|
||||
end
|
||||
global.starting_spawn = true
|
||||
end
|
||||
script.on_init(on_init)
|
||||
|
|
|
@ -43,12 +43,14 @@ bzgas-list=Make a list of modified recipes
|
|||
bzgas-more-intermediates=Enable more intermediates
|
||||
bzgas-handcraft=Add hand-craft circuit recipe
|
||||
bzgas-boiler=Enable ElAdamo's fluid boiler
|
||||
bzgas-force-spawn=Force starting spawn
|
||||
|
||||
[mod-setting-description]
|
||||
bzgas-recipe-bypass=Skip modifying these recipes (comma-separated list).
|
||||
bzgas-list=If enabled, the text command [color=orange]BZList[/color] will dump a file to the script-output directory with a full list of recipes modified.\nRecommended to turn this off after you are done configuring your other settings.
|
||||
bzgas-boiler=Natural gas mod currnelty can incorporate ElAdamo's public domain fluid boiler. If that mod is updated to 1.1, this may be removed.
|
||||
bzgas-handcraft=This enables an alternative wood-based handcrafting-only recipe for electronic circuits. Defaults to off, as bakelite only takes a few steps to make, but provided to enable varying playstyles.
|
||||
bzgas-force-spawn=Force a spawn of natural gas in the starting area, if the game does not spawn one.
|
||||
|
||||
[string-mod-setting]
|
||||
bzgas-more-intermediates-no=No
|
||||
|
|
|
@ -156,5 +156,4 @@ if util.me.finite() then
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
end
|
||||
|
|
|
@ -32,4 +32,11 @@ data:extend({
|
|||
setting_type = "startup",
|
||||
default_value = true,
|
||||
},
|
||||
|
||||
{
|
||||
type = "bool-setting",
|
||||
name = "bzgas-force-spawn",
|
||||
setting_type = "runtime-global",
|
||||
default_value = true,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue