[Done] Supply Challenge Scenario Question

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[Done] Supply Challenge Scenario Question

Post by TheSAguy »

Hi,

Can someone please explain to me how the chests for the Supply challenge Scenario are created?

I only see this code:

Code: Select all

  global.chests = {}
  for k, chest in pairs (game.surfaces[1].find_entities_filtered{name = "red-chest"}) do
    chest.minable = false
    chest.destructible = false
    global.chests[chest.unit_number] = chest
  end
So I assume it's something to do with the fact that it's a Scenario and somehow a starter chest is hard coded?

What would be the best way to re-produce some starting chests that will work with the challenge code?

Thanks.
Last edited by TheSAguy on Thu Jun 13, 2019 4:32 pm, edited 1 time in total.

kingarthur
Smart Inserter
Smart Inserter
Posts: 1459
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: Supply Challenge Scenario Question

Post by kingarthur »

if you look in the entities file way down near the bottom is code to create the chest.

Code: Select all

local red_chest = util.table.deepcopy(data.raw["logistic-container"]["logistic-chest-passive-provider"])
red_chest.minable = nil
red_chest.type = "container"
red_chest.name = "red-chest"
red_chest.picture = red_chest.animation
red_chest.order = "r-e-d"
data:extend({red_chest})
after that i assume the blueprint in the folder contains the chests to be placed down

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Supply Challenge Scenario Question

Post by TheSAguy »

Thanks KingArthur,
I did not think of looking in there!

Post Reply

Return to “Modding help”