Basically you need to use a remote interface to Freeplay.
This lets you access the stuff already there and add new stuff.
Here is a thread that discusses this.
viewtopic.php?t=113643
I think this is where I got the information to make my own early start mod.
I don't remember where all this code came from. Some of it inspired from the above thread.
This mod consists entirely of one file.
The contents of Control.lua:
Code: Select all
script.on_event(defines.events.on_player_created,
function(event)
local player = game.players[event.player_index]
-- need these researched
player.force.technologies["robotics"].researched = true --
player.force.technologies["logistic-system"].researched = true --
player.force.technologies["logistic-robotics"].researched = true --
player.force.technologies["construction-robotics"].researched = true --
player.force.technologies["worker-robots-storage-1"].researched = true
player.force.technologies["worker-robots-speed-1"].researched = true
end
)
local crashsite_disable = false
local skip_intro = true
local function add_CreatedItem_to_Freeplay(new_items)
if remote.interfaces["freeplay"].get_created_items
then
local items = remote.call('freeplay','get_created_items')
for name,count in pairs(new_items)
do
if (not items[name]) or (items[name] and items[name] < count)
then
items[name] = count
end
end
remote.call('freeplay','set_created_items', items)
end
end -- function add_CreatedItem_to_Freeplay
local function add_DebrisItem_to_Freeplay(new_items)
if remote.interfaces["freeplay"].get_debris_items
then
local items = remote.call('freeplay','get_debris_items')
for name,count in pairs(new_items)
do
if (not items[name]) or (items[name] and items[name] < count)
then
items[name] = count
end
end
remote.call('freeplay','set_debris_items', items)
end
end -- function add_DebrisItem_to_Freeplay
local function doStuff()
if remote.interfaces["freeplay"]
then
remote.call("freeplay", "set_skip_intro", skip_intro)
add_CreatedItem_to_Freeplay(
{
--["light-armor"]=1, -- 4x4
--["heavy-armor"]=1, -- 6x6
--["modular-armor"]=1, -- 8x8
["power-armor"]=1, -- 10x10
-- ["power-armor-mk2"]=1, -- 12x12
-- ["fusion-reactor-equipment"]=4, -- early power
-- ["exoskeleton-equipment"]=1,
["personal-roboport-equipment"]=2,
["battery-equipment"]=4,
["solar-panel-equipment"]=16,
["construction-robot"]=20,
["logistic-robot"]=100,
["passive-provider-chest"]=50,
--["active-provider-chest"]=20,
["storage-chest"]=50,
--["buffer-chest"]=20,
["requester-chest"]=20,
["roboport"]=50,
--["lab"]=2,
--["assembling-machine-1"]=12,
-- sometimes need this to make items that need a fluid input
--["assembling-machine-2"]=2,
-- ["burner-mining-drill"]=10,
-- ["stone-furnace"]=50,
["wooden-chest"]=10,
["small-electric-pole"] = 50,
-- ["iron-plate"]=1000,
-- ["iron-stick"]=200,
-- ["iron-gear-wheel"]=250,
-- ["iron-chest"]=100,
-- ["copper-plate"]=500,
-- ["copper-cable"]=400,
["electronic-circuit"]=100,
["boiler"]=8,
["steam-engine"]=16,
-- ["pump"]=10,
["pipe-to-ground"]=10,
["pipe"]=50,
-- ["steel-plate"]=500,
-- ["steel-chest"]=10,
["transport-belt"]=200,
["underground-belt"]=20,
["splitter"]=20,
["inserter"]=50,
["burner-inserter"]=20,
["long-handed-inserter"]=50,
--["small-lamp"]=10,
--["landfill"]=500,
}
)
end
end -- function doStuff
script.on_init(doStuff)
-- script.on_configuration_changed(doStuff)