Page 1 of 1

[Done] Supply Challenge Scenario Question

Posted: Thu Jun 13, 2019 2:06 am
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.

Re: Supply Challenge Scenario Question

Posted: Thu Jun 13, 2019 7:36 am
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

Re: Supply Challenge Scenario Question

Posted: Thu Jun 13, 2019 4:32 pm
by TheSAguy
Thanks KingArthur,
I did not think of looking in there!