Reply To: [MOD] Cost Mod (made by Gwinda)

Home Forums Modding [MOD] Cost Mod (made by Gwinda) Reply To: [MOD] Cost Mod (made by Gwinda)

#18414
Traian Trante
Participant

Me again.

 

I tried doing it myself. I took your file from the cost mod : main.lua and added this:

  if c == ‘model/vehicle/waggon’ then

data.metadata.transportVehicle.capacities.capacity = data.metadata.transportVehicle.capacities.capacity / 4

  end

to the metadataHandler function. however, as expected, it got an error. My guess is the error is because the data.metadata.transportVehicle.capacities is actually an array, not a variable.

How do i sole this ? How do i call all the variables in the array ?

 

For reference, the open wagon ‘s metadata looks like this:

capacities = {

{ type = “COAL”, capacity = 32, loadIndicator = { type = “LEVEL”, params = { id = 2, maxHeight = 0.88 } } },

{ type = “IRON_ORE”, capacity = 32, loadIndicator = { type = “LEVEL”, params = { id = 3, maxHeight = 0.88 } } },

},