Transport Fever 2

Transport Fever 2

Demand Overhaul Mod
GordonDry 12 May, 2022 @ 1:42pm
Do cargo types in vehicles by script only
I just recognized that you provide
res\models\models.zip
within your mod with vanilla vehicle clones and manually added the cargo types to them.

Do it by script only, as in
res\scripts\vehiclecargo.lua
but for all cargo types.

Overwriting vanilla resources never is a good idea.

And actually no mod vehicle will work with your mod.
Last edited by GordonDry; 12 May, 2022 @ 1:52pm
< >
Showing 1-15 of 19 comments
mauporte  [developer] 12 May, 2022 @ 8:59pm 
yes because it was so complicated that updateFn wouldn't work: the game kept crashing and crashing trying to look for it all; I tried different methods and could never get past 3% in the loading screen, so I changed it to the models. I even have a series of categories that I was going to use for this but I couldn't get it to work.
Last edited by mauporte; 12 May, 2022 @ 9:07pm
doug 13 May, 2022 @ 3:48am 
The documentation on resource modifiers is here:
https://www.transportfever2.com/wiki/doku.php?id=modding:modifiersfilters

You can also use this method to modify the initWeight parameter of your industries, based on the climate selected by the user.
Last edited by doug; 13 May, 2022 @ 3:49am
phobos2077 14 May, 2022 @ 2:57pm 
I agree. Should use approach of other industry mods otherwise it will be a deal breaker for many players, because a lot of people use vehicle mods.
christian 15 May, 2022 @ 2:37am 
ne marche pas avec senseless industries u a t il une solution car le mod est interressant
GordonDry 15 May, 2022 @ 3:27am 
Originally posted by christian:
ne marche pas avec senseless industries u a t il une solution car le mod est interressant
Bien sûr, il ne fonctionne pas avec l'autre mod. Lisez la description et utilisez au moins un quart de votre cerveau.
mauporte  [developer] 15 May, 2022 @ 5:06pm 
yes I did look into others, but they do simple "if coal is here" add waste and "if goods is here add mail"; that won't work in this case as there's overlaps that shouldn't happen.
Here you can see all the categories I want to implement regarding vehicle cargo: https://www.transportfever.net/index.php?thread/17311-introducing-demand-overhaul-mod/
I also already have all of the vehicles categorized in an excel spreadsheet (like everything else I worked on) but as I said I could never get it to work, the game kept crashing and crashing trying to find the names of each vehicle to apply the modifiers (and I hate how in lua apparently syntax changes easily, it just confuses me).

Now, of course the solution I want is to just have a file because it is more elegant (a script), but even without it other mods would still have to modify their codes to add the categories that represent the cargo groups of this mod; and the idea that right now it would be impossible to add other vehicles is false even if it is not the best solution.

And when it comes to modifiers, I've read that documentation so many times, truth is that it tells me very little, a lot of it is outdated and a lot of other things are missing.
Last edited by mauporte; 15 May, 2022 @ 5:18pm
mauporte  [developer] 15 May, 2022 @ 5:16pm 
PS: I will try again, and there are still other things I want to do, but in a couple of weeks as I have 2 new projects that came in last monday and I neglected for a couple of days because I was finishing this. You should also know that if I've learned anything is that i don't like lua at all; it is too weird, redundant and the whole threading thing just makes things frustrating imo.
mauporte  [developer] 15 May, 2022 @ 5:29pm 
ok, I just thought of a way it could work with known methods:
instead of "if coal is there add this", it would have to be a series of
"if this and this and this and this is here, then: do this"
"elseif this and this and this and this is here, then: do this"
etc.
phobos2077 16 May, 2022 @ 1:28am 
Hey if you need help with Lua, let me know. I'll try to help if I can.
mauporte  [developer] 16 May, 2022 @ 5:13am 
Thanks for offering help Phobos; as I said I won't be able to work on it for at least 1-2 weeks (maybe less if I can get some GIS drafters); but I'll keep you guys updated into more specifics so that maybe you can help me find the errors in my codes (so for example, how am I using modifiers wrong with the climate thing?).
As some of you probably have experienced before: when one is struggling to do something one's brain shuts down in a way and it isn't until you relax a bit that ideas pop back and one even realizes that there was an easier solution one wasn't thinking of, so this might be beneficial.
Last edited by mauporte; 16 May, 2022 @ 5:14am
fun.baker 20 May, 2022 @ 8:39am 
There are collections with vehicles, it is also a possibility to add a compatibility script to them, I guess.
Couch_Lord_Xenos 3 Apr, 2023 @ 9:44pm 
Any luck on getting this done? I'd like to be able to use this with the Industrial Railways cargo tram mod.
doug 18 Dec, 2023 @ 7:29am 
I have now developed a script for this feature, if you're still interested in pursuing it.
mauporte  [developer] 18 Dec, 2023 @ 7:42am 
Originally posted by doug:
I have now developed a script for this feature, if you're still interested in pursuing it.

that sounds great, I have time this week to work on the mod
< >
Showing 1-15 of 19 comments
Per page: 1530 50