Transport Fever 2

Transport Fever 2

Yeol's Senseless Industries 2.21a
GordonDry 28 Jun, 2022 @ 5:24am
FIXED: STEEL not cloned to COPPER and ALUMINIUM on specific wagon
This wagon
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2609986471
contains a compartmentsList with TOOLS, STEEL and MACHINES, but the Yeol's Senseless Industries senselessCB.lua script does not recognize STEEL as there is no COPPER and ALUMINIUM available ingame.
See snippet from a wagon mdl:
compartmentsList = { { loadConfigs = { { cargoEntries = { { capacity = 144, seats = { }, type = "TOOLS", }, }, toHide = { }, }, { cargoEntries = { { capacity = 88, seats = { }, type = "STEEL", }, }, toHide = { }, }, { cargoEntries = { { capacity = 124, seats = { }, type = "MACHINES", }, }, toHide = { }, }, }, }, { loadConfigs = { { cargoEntries = { { capacity = 144, seats = { }, type = "TOOLS", }, }, toHide = { }, }, { cargoEntries = { { capacity = 88, seats = { }, type = "STEEL", }, }, toHide = { }, }, { cargoEntries = { { capacity = 124, seats = { }, type = "MACHINES", }, }, toHide = { }, }, }, }, { loadConfigs = { { cargoEntries = { { capacity = 144, seats = { }, type = "TOOLS", }, }, toHide = { }, }, { cargoEntries = { { capacity = 88, seats = { }, type = "STEEL", }, }, toHide = { }, }, { cargoEntries = { { capacity = 124, seats = { }, type = "MACHINES", }, }, toHide = { }, }, }, }, },

What could be the cause?
Last edited by GordonDry; 29 Jun, 2022 @ 10:13am
< >
Showing 1-6 of 6 comments
Yeol  [developer] 28 Jun, 2022 @ 5:37am 
Hello GordonDry, STEEL nor MACHINES are a criteria in searching for vehicle types. I'll modify the code to add the support of these cars this evening. You'll see the update appear... ;)
Yeol  [developer] 28 Jun, 2022 @ 2:26pm 
I've updated this mod to version 2.13. All vehicles that can transport STEEL, will now also be able to transport COPPER and ALUMINIUM.
GordonDry 29 Jun, 2022 @ 1:41am 
You know what? In my edit pack https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/2799634962/3271311587269153940/ I already did exactly that and with this bedrock it did not work. I even used the same exact syntax, but including the customCargoModels*:

compartments
local foundSteelCapacity = 0
local foundSteelCargobay = null
local foundSteelcustomCargoModels = null
elseif (string.upper(data.metadata.transportVehicle.compartments[i][j][k].type) == "STEEL") then
foundSteelCapacity = data.metadata.transportVehicle.compartments[i][j][k].capacity
foundSteelCargobay = data.metadata.transportVehicle.compartments[i][j][k].cargoBay
foundSteelcustomCargoModels = data.metadata.transportVehicle.compartments[i][j][k].customCargoModels
foundNotOil = true
if (foundSteelCapacity>0) then
table.insert(data.metadata.transportVehicle.compartments[i], { { type = "COPPER", capacity = foundSteelCapacity, cargoBay = foundSteelCargobay, customCargoModels = foundSteelcustomCargoModels } })
table.insert(data.metadata.transportVehicle.compartments[i], { { type = "ALUMINIUM", capacity = foundSteelCapacity, cargoBay = foundSteelCargobay, customCargoModels = foundSteelcustomCargoModels } })
end

compartmentsList
local foundSteelCapacity = 0
local foundSteelCargobay = null
elseif (string.upper(data.metadata.transportVehicle.compartmentsList[h].loadConfigs[i].cargoEntries[j].type) == "STEEL") then
foundSteelCapacity = data.metadata.transportVehicle.compartmentsList[h].loadConfigs[i].cargoEntries[j].capacity
foundSteelCargobay = data.metadata.transportVehicle.compartmentsList[h].loadConfigs[i].cargoEntries[j].cargoBay
foundNotOil = true
if (foundSteelCapacity>0) then
table.insert(data.metadata.transportVehicle.compartmentsList[h].loadConfigs, {cargoEntries = { { type = "COPPER", capacity = foundSteelCapacity, cargoBay = foundSteelCargobay }}})
table.insert(data.metadata.transportVehicle.compartmentsList[h].loadConfigs, {cargoEntries = { { type = "ALUMINIUM", capacity = foundSteelCapacity, cargoBay = foundSteelCargobay }}})
end

*I added the customCargoModels to all entries to have clones of loading animations.

I will test the new version now but I assume the behaviour does not change.
Last edited by GordonDry; 29 Jun, 2022 @ 1:56am
Yeol  [developer] 29 Jun, 2022 @ 4:46am 
I admit I did not test the modifications because they seem trivial. But now you say it does nothing, I will investigate this evening what is happening. Maybe I'll be able to fix it. We'll see.
Yeol  [developer] 29 Jun, 2022 @ 8:47am 
I've found the cause of the problem. The mod did not install the files in the conventional "vehicles" directory. I've added an exception in the code to support the specific directory of the "schnabel" mod.

I published version 2.14 with the modification.
< >
Showing 1-6 of 6 comments
Per page: 1530 50