Transport Fever 2

Transport Fever 2

VehicleTweaker
51 Comments
WernerK  [author] Sep 24, 2024 @ 12:27pm 
I will test this a little before I do this, but I will do this. For bug reports look at the discussion.
bottle Sep 24, 2024 @ 12:22pm 
Great. Can you also add the link to it to the mod description please. As this is a great mod and I think more people will use it when they realise it's easier to tweak the vehicles
WernerK  [author] Sep 23, 2024 @ 2:04pm 
@bottle: For questions about your Tweaker App I've opened a discussion.
WernerK  [author] Sep 23, 2024 @ 1:44pm 
Oh, sorry, only now I noticed your app. I'll take a look at it. I suppose it's also great. :steamthumbsup: A long time ago I thought about adding an option for clicking on a vehicle in the game and then get an input dialog. But I never found the time because of other projects.
bottle Sep 23, 2024 @ 3:59am 
Brill thanks. I'll update the UI with that info too
WernerK  [author] Sep 22, 2024 @ 1:26pm 
@bottle: At the moment you cannot add a new cargo type. You can only handle cargo types that are already configured. Perhaps in a later version.
bottle Sep 22, 2024 @ 11:34am 
@WernerK How do you add a cargo type to a vehicle? That didn't work for me


capacity = {

{'2922663513', '1', 'GRAIN'},
},
bottle Sep 22, 2024 @ 10:27am 
@WernerK. Great mod. I created a UI for editing the file here. Very untested so if anyone spots any bugs post here

https://vehicle-tweaker-web.vercel.app/
WernerK  [author] Mar 22, 2023 @ 5:10am 
@Newbie: Please check if you have a 'Backups' directory in your 'Steam' directory. Do you perhaps have renamed or mapped it? Please tell me the exact name and Path of the directory and which OS you use (Windows?). I think it's an error another user already had before. It's not an issue with 'VehicleTweaker' but with the 'SettingsSaver' mod. If we don't get it working you would have to switch of SettingsSaver. That means you'd have to do your backups manually but then it should throw no errors. You could test it.
Newbie Mar 22, 2023 @ 12:37am 
Hierarchy:
type: class Ul:CGameUl, id = "", name = "CGameUI" , styleClasses = f"top-gamebar-visible"}type: class Ul::CMenuUl, id = "", name = "MenuUl" , styleClasses =f
type: classUI:CComponent id = ", name = "Mwrap" styleClasses = (“"platform-desktop" "ui-classic', "input-mouse", "gamepad-type-xbox"
Mod: "VehicleTweaker"(*2668633703,1)(consider removing this mod and contacting the mod author)
pen directo

thanks
Newbie Mar 22, 2023 @ 12:37am 
Excuse me, I have the following problem, please tell me how to solve it. Is it relevant for me to add other mods?

Lua excepuion

Exception type: Lua exception
This error is usually caused by modding. Some game resources contain incorrect data.Details:
Frror message: error: D/steam/steamapps/workshop/content/1066780/2668634017/res/scripts/woss 1i.ua.27:attempt to concatenate nil valuestack traceback:
=[C](-1): _concat
@D:/steam/steamapps/workshop/content/1066780/2668634017/res/scripts/wkss_lib.lua(27): fileOperator
D:/steam/steamapps/workshop/content/1066780/2668633703/res/config/game_script/wkvt wkss client.lua(39);?
File name: D:/steam/steamapps/workshop/content/1066780/2668633703/res/config/game_script/wkvt wkss client.luaKey: game/res/gameScript/wkvt_wkss_client.lua_handleEvent
Minidump: D:/steam/userdata/1131734916/1066780flocal/crash_dump/1a43a2fa-4252-405b-9554-7cdc8840e225.dmpUl Component
Logos Jan 31, 2023 @ 7:39pm 
I didn't realize the game divided the capacity in the config by four. Thanks
WernerK  [author] Jan 30, 2023 @ 3:54am 
Is this right: You change the real capacity from 74 to 75? That doesn't work: 74 / 4 = 18.5; 75 / 4 = 18.75. Both is rounded = 19. So it must be the same result. To get a change in 1 Passenger you had to make a change of 4 passengers becauses the game regularly uses a reduction factor of 4. So you could perhaps change from 74 to 78 passengers ...
Logos Jan 30, 2023 @ 1:11am 
This is on new vehicles
Logos Jan 30, 2023 @ 1:08am 
Hi, I've been trying to change the capacity of a modded vehicle for a while. No matter what I do to the format I don't see a difference in game, even after restarting the game after every change.

This is the mod I'm trying to make changes to: https://steamcommunity.com/sharedfiles/filedetails/?id=2152319336

This is the file I'm using:
https://pastebin.com/p2pvPAbF

These are the paths I have the file at:
D:\SteamLibrary\steamapps\common\Transport Fever 2\mods\2668633703\res\scripts\wkvt_settings.lua
D:\SteamLibrary\steamapps\workshop\content\1066780\2668633703\res\scripts\wkvt_settings.lua


Thanks
Lesnik Dec 28, 2022 @ 8:32pm 
Thank you!
WernerK  [author] Dec 28, 2022 @ 4:37pm 
@Lesnik (+): Yes, you can address each item of a mod. You can use the full path or a distinct part of the path and a distinct model name with .* or .- as the simplest type of a Lua (!) RegEx wildcard between them, e.g. something like 2459275833.*example_model You can also select a common part of some model names to select a certain group of models. Or you can use wildcards again, every RegEx is allowed. If you are sure a model name is only used in a single mod you can leave out the mod name. You can also select models by mentioning a subdirectory name - if there is a subdirectory. What else could be important? At the beginning or end of a path name you don't need wildcards!
Lesnik Dec 28, 2022 @ 2:03pm 
Excuse me, is there any "special" method when dealing with multi-item mods, like "Sächsische Schmalspurwagen" id 2459275833?

I mean, that one for example has multiple "items/models" from different types - cargo, passenger and so on. I'm looking for a method how to adjust parameters of a specific vehicle inside a mod - should I put in the script a path to exact .mdl file?
WernerK  [author] Nov 4, 2022 @ 4:50pm 
@Evil.Iguana: Yes, 1/4 is the "official" reduction to increase the performance. If you want to change it, there are some mods.
Evil.Iguana Nov 3, 2022 @ 8:30pm 
Question: When editing capacity is it normal for in game capacity to be 1/4 the number in the file or is that something unusual on my end?
Evil.Iguana Oct 24, 2022 @ 8:05pm 
That was it. Didn't realize there was another set of brackets needed around the entry. Works like a charm now. Thanks a ton for the reply and keep up the good work!
WernerK  [author] Oct 24, 2022 @ 4:04pm 
@Evil.Iguana: Did you write it this way?
speed = {
{'2850368654', 80},
},
Maybe you have skipped some bracket ...
Evil.Iguana Oct 23, 2022 @ 8:12pm 
Having trouble getting this to work. I'd like to alter the speed of https://steamcommunity.com/sharedfiles/filedetails/?id=2850368654 so I open up C:\Steam\steamapps\workshop\content\1066780\2668633703\res\scripts\wkvt_settings.lua in Notepad++ and alter it so it reads speed = {'2850368654', 80. This is the nomenclature described in the file, but it just causes the game to hang every time I try to load it. Is there an example file somewhere I can look at so I can try to figure out where the error is?
WernerK  [author] Aug 28, 2022 @ 10:24am 
@ Manji: Yes, it is possible.
Manji Aug 27, 2022 @ 4:55am 
@WernerK
Is it possible to change the v-max of wagons with this tool? i'm tired of having fast trains but slow wagons ^^''
WernerK  [author] Aug 2, 2022 @ 10:59am 
The "manual" version of SettingsSaver needs no care and no adjustment except looking for updates on transportfever.net from time to time. It saves automatic backups of steam mods, too.
Wilhelm924 Aug 2, 2022 @ 7:12am 
@WernerK
The manual versionof 'SettingsSaver' works without a hitch.
Unfortunately THIS mod is (for me) a bit too complicated to work.
Thanks anyways
Wilhelm924 Aug 2, 2022 @ 6:55am 
@WernerK
I'm going to test the manual version(via transportfever.net) .
WernerK  [author] Aug 2, 2022 @ 12:35am 
@Sterben: You mean the original Steam backup directory? Ok. It is empty because it cannot be found, perhaps also by other applications. Is the directory name "Backups" (with a capital "B")? I suppose it would work if you also would name your steam directory "Steam" instead of "Steam games" but in this late state it would cause issues with other steam applications. Perhaps I could enhance the search criteria in the next version of SettingsSaver, but it would only be for your very rare special case. Another way would be not to download SettingsSaver on Steam, but on transportfever.net . Then it would use the backup directory directly on the path of SettingsSaver which is not possible on Steam downloads.
Wilhelm924 Aug 1, 2022 @ 2:17pm 
@WernerK
I found the backup-map, but empty.
WernerK  [author] Aug 1, 2022 @ 11:10am 
@Sterben: So SettingsSaver cannot work. It expects to find a subdirectory called Backups in a directory named Steam whereby any disk could be used.
Wilhelm924 Aug 1, 2022 @ 10:22am 
@WernerK
1. I have a seperate ssd for my games, in which all my steam games(my name for the steam-map) are located.
2. Directly I don't have a back-up, but I do a general back-up regularly.
WernerK  [author] Aug 1, 2022 @ 10:18am 
@Sterben: Did you map the "Steam" directory to "Steam Games"? Where is your Steam Backups directory located? Or may it be possible that you don't have one?
Wilhelm924 Jul 30, 2022 @ 7:44am 
@WernerK
I used loaded Settings Saver first, then this mod.
Loaded normally, then froze...
Works normally without(but can't figure it out...)

Error message: error: E:/Steam Games/steamapps/workshop/content/1066780/2668634017/res/scripts/wkss_lib.lua:46: attempt to concatenate a nil value
stack traceback:
=[C](-1): __concat
@E:/Steam Games/steamapps/workshop/content/1066780/2668634017/res/scripts/wkss_lib.lua(46): fileOperator
E:/Steam Games/steamapps/workshop/content/1066780/2668633703/res/config/game_script/wkvt_wkss_client.lua(28): ?


File name: E:/Steam Games/steamapps/workshop/content/1066780/2668633703/res/config/game_script/wkvt_wkss_client.lua

Key: game/res/gameScript/wkvt_wkss_client.lua_handleEvent

Minidump: D:/Steam/userdata/166225588/1066780/local/crash_dump/4bd5c4ad-1efa-48f9-acd1-8ee3e037d288.dmp

Mod: "VehicleTweaker" (*2668633703, 1) (consider removing this mod and contacting the mod author)
WernerK  [author] Jul 29, 2022 @ 3:10pm 
Can you tell me
- When did you install Vehicle Tweaker for the first time?
- Have you installed Settings Saver?
- If you have: Does it also crash if you switch off Settings Saver?
- Please look inside the stdout. Is there a crash message? Can you post it (only the crash message will be enough)?
Wilhelm924 Jul 29, 2022 @ 12:37pm 
Game crashes when activated...
Papupi May 24, 2022 @ 9:03am 
oh ok, i just had that doubt, that being said, this mod is actually easier to understand and use
WernerK  [author] May 24, 2022 @ 5:23am 
@Papupi: You have only to enter the names of the mod/vehicle files and some parameters into the list named wkvt_settings.lua. In some cases you can also use wildcards. Look at the examples!
Papupi May 21, 2022 @ 12:14pm 
wait, my brain is on a meltdown rn, but just to get this straight, i have to copy the vehicles edited lua from their og folder to the vehicle tweaker folder inside the wkvt setting lua, one by one?
WernerK  [author] Feb 13, 2022 @ 3:56am 
I was wrong: In the English version it's normally named
C:\Program Files (x86)\Steam\Backups
But it only works if your mods are on the same drive. So you would have to map your backup directory to the other drive, but I don't know if it works. So manual backups are a solution, but don't forget. So if you notice that your settings are no longer working (you won't get any message) just reinstall your backup settings.
kasperhkj Feb 13, 2022 @ 2:52am 
I'm pretty sure I haven't deleted any backup folders, so I don't know why it isn't there. That said, it's probably the easiest if I just drop Settings Saver and manually copy the settings file to a safe place instead.

Anyway, thanks for the help with troubleshooting. This is a really great mod. I've been annoyed by having to copy/paste mods from the steam library to the mod folder in order to fix their stats, and then they wouldn't be updated along with the original. But this mod fixes that issue :D
WernerK  [author] Feb 13, 2022 @ 2:17am 
@kasperhkj: Settings Saver copies your settings to a backup directory and restores them automatically if e.g. a Steam restoration cleanup resets your mods together with the main program. Steam does such things! If installed via Steam, Settings Saver uses the original Steam backup directory which is Programs (x 86)/Steam/Backups. It is the only safe place. I suppose you (and the debug message tells me so) have either deleted this directory or moved it elsewhere. Please look if there is an error message "Could not write ..." or "Could not read ..." in the stdout so you find out where it was expected. Perhaps you can tell me the path where it's really located - if it exists. Maybe I could write a patch, but I can't promise because it's a rare special case. As a workaround you could create a backup directory at the path mentioned above or do not use Settings Saver and always make manual backups of your settings file after you have made your entries.
kasperhkj Feb 12, 2022 @ 9:54am 
It seems to work fine without Settings Saver. What is it that that one is for?
The errors were for the lines:

wkss_lib.lua:46: attempt to concatenate a nil value stack traceback: =[C](-1):__concat
wkss_lib.lua(46): fileOperator
wkvt_wkss_client.lua(28): ?

And something about:
In file: ..\..\src\Lib\lua\State.cpp:592
In function: void __cdecl lua::State::Call(int,int)

I hope that helps.
WernerK  [author] Feb 11, 2022 @ 5:26pm 
@kasperhkj: The external drive could be the reason, To find out more please tell me the line number, the variable and the file name where it happens. Did you look into the stdout/console in debug mode? There could be more hints. Can you switch off settings saver - if installed - for one run and tell me if it still happens?
kasperhkj Feb 11, 2022 @ 1:16pm 
Does the mod make any assumptions about where things are? Because I have TpF2 installed on an external drive (and I have a Steam library with all the mods there), but most of Steam's core is on the computer's internal drive.
kasperhkj Feb 11, 2022 @ 9:47am 
The game crashes when I try to use this mod - the error message being something about concatanating a nil value. Any idea why?
I've tried to run it both with some tweaks specified and without any at all - thinking I might have just specified wrong.
WernerK  [author] Dec 25, 2021 @ 9:54am 
@ConsisePepper73: No.
ConsisePepper73 Dec 24, 2021 @ 4:39pm 
Is there a video showing how to use this?
Norfolk_Chris Dec 2, 2021 @ 3:17am 
Thanks for the information. Sadly my knowledge of scripting is inadequate to enable me to use this mod.
WernerK  [author] Dec 1, 2021 @ 6:05am 
@Norfolk_Chris:
1. With Steam downloads the file "wk_vehicle_tweaker_1" does not exist. So I did write "or Mod-ID" (see below).
2. Open the file with an editor (in Windows something like Notepad or Notepad++) and follow the instructions in the script comments. You will need a minimum of scripting experience for there is no graphical user interface.
3. Do you use Windows? Normally you find the file in C:\Program Files (x86)\Steam\steamapps\workshop\content\1066780\<workshop file ID>\res/scripts/wkvt_settings.lua. For further information about file locations see https://transportfever2.com/wiki/doku.php?id=gamemanual:gamefilelocations
[Mod-ID] or <workshop file ID> is a placeholder for the number given by Steam automatically to every mod at the upload. In this case it should be 2668633703 (or look for the latest directory if you did not subscribe to any other mods afterwards).