Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function give-player(player,item_name,count)
- if game.item_prototypes[item_name] ~= nil then
- player.insert{item_name, count=count}
- end
- end
- function changefilter(inventory,slot,item_name)
- if game.item_prototypes[item_name] ~= nil then
- inventory.set_filter(slot,item_name)
- end
- end
- -- first we establish starting inventory and filters upon player first joining a game
- function give_starting_equipment(event)
- game.players[event.player_index].color = {r = 0, g = 0, b = 1, a = .7}; -- change player color to blue
- local player = game.players[event.player_index]
- local inventory = player.get_inventory(defines.inventory.player_quickbar)
- inventory.clear()
- changefilter(inventory, 1,"transport-belt")
- changefilter(inventory, 2,"inserter")
- changefilter(inventory, 3,"underground-belt")
- changefilter(inventory, 4,"hacked-splitter")
- changefilter(inventory, 5,"small-electric-pole")
- changefilter(inventory, 6,"assembling-machine-1")
- changefilter(inventory, 7,"long-handed-inserter")
- changefilter(inventory, 8,"blueprint")
- changefilter(inventory, 9,"deconstruction-planner")
- changefilter(inventory,10,"steel-chest")
- -- materials
- give-player{player, item_name="steel-axe", count=10}
- give-player{player, item_name="iron-plate", count=592} -- 8 extra are added by freeplay scenario starting items
- give-player{player, item_name="copper-plate", count=400}
- give-player{player, item_name="electronic-circuit", count=200}
- give-player{player, item_name="iron-gear-wheel", count=200}
- give-player{player, item_name="underground-belt", count=50}
- give-player{player, item_name="hacked-splitter", count=50}
- give-player{player, item_name="small-electric-pole", count=148} -- 48 required for furnace setup, 100 extra == 148
- -- logistics
- give-player{player, item_name="assembling-machine-1", count=20}
- give-player{player, item_name="long-handed-inserter", count=50}
- give-player{player, item_name="blueprint", count=1}
- give-player{player, item_name="deconstruction-planner", count=1}
- give-player{player, item_name="steel-chest", count=50}
- give-player{player, item_name="inserter", count=182} -- 2 inserters per stone furnace, 52 stone furnaces to start with in 2 layouts of 2x13 = 2*2*2*13 == 104 + 28 for boilers + 50 spare
- give-player{player, item_name="transport-belt", count=800}
- -- smelting/mining
- give-player{player, item_name="electric-mining-drill", count=36} -- 13 for iron, 13 for copper, 2 for stone, 8 for coal == 36
- give-player{player, item_name="stone-furnace", count=52} -- two setups of 2x13 == 52
- -- power
- give-player{player, item_name="boiler", count=28} -- two rows of 14 boilers == 28
- give-player{player, item_name="coal", count=1400} -- 50 coal per boiler * 28 == 1400
- give-player{player, item_name="steam-engine", count=20} -- two rows of 10 steam engines == 20
- give-player{player, item_name="offshore-pump", count=2} -- two power chains
- give-player{player, item_name="pipe-to-ground", count=50}
- give-player{player, item_name="pipe", count=50}
- -- car
- give-player{player, item_name="car", count=1}
- give-player{player, item_name="coal", count=200} -- coal for car
- -- robot
- give-player{player, item_name="power-armor", count=1}
- give-player{player, item_name="construction-robot", count=50}
- give-player{player, item_name="fusion-reactor-equipment", count=1}
- give-player{player, item_name="personal-roboport-equipment", count=5}
- give-player{player, item_name="battery-mk2-equipment", count=3}
- -- science
- give-player{player, item_name="lab", count=10}
- give-player{player, item_name="science-pack-1", count=10}
- end
- script.on_event( defines.events.on_player_created, give_starting_equipment(event))
- -- then we establish a new inventory if player should respawn
- function give_respawn_equipment(event)
- --filters
- local player = game.players[event.player_index]
- local inventory = player.get_inventory(defines.inventory.player_quickbar)
- changefilter(inventory, 1,"transport-belt")
- changefilter(inventory, 2,"inserter")
- changefilter(inventory, 3,"underground-belt")
- changefilter(inventory, 4,"hacked-splitter")
- changefilter(inventory, 5,"small-electric-pole")
- changefilter(inventory, 6,"assembling-machine-1")
- changefilter(inventory, 7,"long-handed-inserter")
- changefilter(inventory, 8,"blueprint")
- changefilter(inventory, 9,"deconstruction-planner")
- changefilter(inventory,10,"steel-chest")
- -- materials
- give-player{player, item_name="steel-axe", count=10}
- -- logistics
- give-player{player, item_name="blueprint", count=1}
- give-player{player, item_name="deconstruction-planner", count=1}
- -- car
- give-player{player, item_name="car", count=1}
- give-player{player, item_name="coal", count=200} -- coal.... for car
- -- robot
- give-player{player, item_name="power-armor", count=1}
- give-player{player, item_name="construction-robot", count=50}
- give-player{player, item_name="fusion-reactor-equipment", count=1}
- give-player{player, item_name="personal-roboport-equipment", count=5}
- give-player{player, item_name="battery-mk2-equipment", count=3}
- end
- -- script.on_event(defines.events.on_player_respawn, give_respawn_equipment(event))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement