Transport Fever

Transport Fever

Locomotive Price Adjuster
25 Comments
Devilhunter  [author] 4 Dec, 2019 @ 9:07am 
@Rafn, I guess yes. I've already bought TF2 and waiting its release.
Rafn 4 Dec, 2019 @ 8:44am 
Will you make this for Transport Fever 2?
TheViper492 3 Jun, 2019 @ 4:47pm 
@Devilhunter I'd really still like to be able to see the aging effects. Basically my problem is this: In real life railroads are still using diesels from the 60s, and then when they're done with them they sell them to short line railroads and they continue using them. In the game, however, if you keep a train for longer than 5 years than the maintenance cost increase makes it impossible to make a profit you know? Like I have loaded 30 car ore trains but because the locomotives are halfway through their life cycle it doesn't make a profit anymore. That's my problem and I don't know if there's a way to fix it. Thanks for replying btw it's nice to talk to someone that knows more about how the game works than I lol.
Devilhunter  [author] 3 Jun, 2019 @ 7:02am 
@TheViper492, Nope. The game itself defines how to change running costs over time. I can only change the initial value. That changes work both vinalla and modded vehicles.

However, there is a way to do what you want. If we increase lifespan of vehicles to, let's say 99999 years, then running costs will grow much, MUCH slowly. But then you won't see that aging effects like rust. Are you OK with that?
TheViper492 3 Jun, 2019 @ 1:22am 
Could you make this so that maintenance costs don't change over the life of a vehicle? Can you do this for modded vehicles?
zerghnandus 4 Feb, 2019 @ 1:14pm 
@Devilhunter Thanks man ! Its working fine now ! Cheers ! :steamhappy:
zerghnandus 28 Jan, 2019 @ 3:02am 
Hello mate ! I tested it and it seems to be ok, but your other mod is now the culprit:

error: error: ...team/steamapps/workshop/content/446800/850852117/mod.lua:14 : attempt to index field 'capacities' (a nil value)
stack traceback:
[C](-1): __index
...team/steamapps/workshop/content/446800/850852117/mod.lua(14) : v
res/scripts/mod.lua(69): ?
Devilhunter  [author] 27 Jan, 2019 @ 2:41pm 
@danielsevcik, @zerghnandus, I updated the mod. Please, check how it works.
zerghnandus 24 Jan, 2019 @ 11:13pm 
Very nice mod man thanks ! Its causing a problem with 2 other mods though: ÖBB Railjet and Seamons train pack. Both give the same error:
error: error: ...team/steamapps/workshop/content/446800/846533912/mod.lua:113 : attempt to perform arithmetic on field 'power' (a nil value)
stack traceback:
[C](-1): __mul
...team/steamapps/workshop/content/446800/846533912/mod.lua(113) : v
res/scripts/mod.lua(69): ?
danielsevcik 24 Jan, 2019 @ 3:38am 
Hi. Game crash with this mod after "Thank you update"
Problem is with this line (113):

cost = speedCost(data.metadata.railVehicle.topSpeed) * 2415 * data.metadata.railVehicle.engines[1].power
...attempt to perform artihmetic on field "power" (a nil value)

Maybe the field power has new name after update. Can you help?
josecarvalihno42 12 Sep, 2018 @ 4:26pm 
rttretre
Devilhunter  [author] 15 Nov, 2017 @ 7:23am 
hmm..Maybe you could send me your lua file via some file-sharing service?
jmcleaver 15 Nov, 2017 @ 6:39am 
I ran my test with a vanilla game (no mods) and also with only this mod active. Same map, same assets.
Devilhunter  [author] 15 Nov, 2017 @ 5:31am 
@jmcleaver, yes. Are you sure this mod is not overwritten with some other? Maybe it is not last in the list of mods.
jmcleaver 14 Nov, 2017 @ 7:33pm 
I have tried this mod, and I am not sure it is working. Here is what i changed in the lua file:

local buy = {dieselPowerPrice = 0.25,
electricPowerPrice = 0.25,
steamPowerPrice = 0.25,
}
local OandM = {dieselPowerPrice = 0.25,
electricPowerPrice = 0.25,
steamPowerPrice = 0.25,
}

I figured that this should reduce cost and maintenance to 25%; but I do not see any difference in maintenance costs anyway with this mod and vanilla. I should see a drastic change I would think.
ylij174 27 Jan, 2017 @ 5:14am 
Devilhunter проверил твои рекомендаци - все работает. Ошибка в следующем: по умолчанию в файле в строке electricPowerPrice = 1., указаны точка и запятая, так вот если убрать в конце точку и сделать как у тебя то все работает. Почему так не знаю. Но получается что нужно убирать точку которая есть по умолчанию. Короче как в радиоигре разведки " точка в конце текста - провал" )))) ахааа. СПАСБО тебе ещё раз.
Devilhunter  [author] 26 Jan, 2017 @ 3:37pm 
Check >this< out.
Devilhunter  [author] 25 Jan, 2017 @ 10:38am 
проклятье. В комментариях не работает нормальное форматирование текста.
Devilhunter  [author] 25 Jan, 2017 @ 10:37am 
Менял 1. на 0.8, вроде бы всё работало.
Сейчас стоимость обслуживания выглядит так:
[code]local OandM = {dieselPowerPrice = 1.,
electricPowerPrice = 1.,
steamPowerPrice = 1.,
}[/code]
Меняю 1. на 0.8, например
[code]local OandM = {dieselPowerPrice = 1.,
electricPowerPrice = 0.8,
steamPowerPrice = 1.,
}[/code]
Важно чтобы целая и дробная части разделялись точкой.
ylij174 25 Jan, 2017 @ 8:56am 
автор не подскажешь как правильно менять стоимость обслуживани. Опробовал. По умолчанию electricPowerPrice = 1.,, меняю на 0,90,,080 - выдает ошибку мол нужно {.,}. а не дргуой знак. Проверяю, точка с запятой как были так и есть. я поменял только 1 на 0.80. Меняю на 1 - все в норме. Меняю на что то другое - ошибка. А вот с изменением стоимости полный порядок. Почему при тестировании смены обслуживания не работает с другими цифрами так и не понял.
Devilhunter  [author] 24 Jan, 2017 @ 11:33pm 
I found some formula that is quite precise. The maximum error (deviation) between in-game prices and formula prices is less then 5%. So some other price adjusting mod must be released in a couple of days.
Rafn 24 Jan, 2017 @ 3:08pm 
There is a mod that adjust waggon price, called "Wagon Speed and Cost Balance v1.1"

I have used it for a while and it works okay.but the solution could be improved upon.
Devilhunter  [author] 23 Jan, 2017 @ 5:03am 
For wagons I don't know the precise formula. Although technically it is possible and dependencies (capacity and top speed) are known. I'll try to present something
Mulligan 23 Jan, 2017 @ 3:58am 
Nice... Is this possible to expand it for wagons?
ylij174 21 Jan, 2017 @ 11:01am 
Вот уж СПАСИБО! То что нужно!