Transport Fever 2

Transport Fever 2

Yeol's Senseless Industries
GordonDry Sep 12, 2021 @ 1:49pm
Also clone loading animation entries when adding new cargo types by script?
For example, this structure is not fully cloned:

compartments = { { { { capacity = 19, customCargoModels = { configurations = { { slotLevels = { { }, { 0, }, { 1, }, { 2, }, { 3, }, }, }, }, }, type = "COAL", }, }, { { capacity = 19, customCargoModels = { configurations = { { slotLevels = { { }, { 4, }, { 5, }, { 6, }, { 7, }, }, }, }, }, type = "STONE", }, }, }, },

customCargoModels / configurations / slotLevels is ignored by senselessCB.lua

Is it even possible to clone that by script when adding new cargo types?
< >
Showing 1-1 of 1 comments
GordonDry Sep 21, 2021 @ 3:23pm 
Yes, I should be ashamed because the solution is so simple ...

...
local foundStonecustomCargoModels = null

...
foundStonecustomCargoModels = data.metadata.transportVehicle.compartments[j][k].customCargoModels
...
table.insert(data.metadata.transportVehicle.compartments, { { type = "LIMESTONE", capacity = foundStoneCapacity, cargoBay = foundStoneCargobay, customCargoModels = foundStonecustomCargoModels } })


Stuff like that.
< >
Showing 1-1 of 1 comments
Per page: 1530 50