Passenger Seats Real Capacity

If you liked this item, please rate it up on Steam Workshop page.

Author: YT8HmH7

Last revision: 23 Jun, 2023 at 01:58 UTC

File size: 5.86 MB

On Steam Workshop

Description:
Key features

• Full support of any passenger vehicle (inc. legacy and mods)
• Correct compartments capacity calculation
• No files replaced, scripts only
• Safe to add and remove

I used capacity passenger using all seats for a long time until the large TpF2 model update when the mod stopped working.
Knowing no lua, I quickly created a crude JS script to update capacities in mdl files. (I included this js script with the mod, and you can use it to update simple mdl files; however, it doesn’t work correctly with multi-compartment models!)
It worked but had obvious problems. 1. It was a simple replacement of all models, which would break after the next model update. 2. I had to run the script for every passenger vehicle mod.
So after I learned lua by creating Real Industrial Chains, I could make this script-only universal mod.

Some ships have a large hull, but "seats" only on the outside. I added an option for such situations, which moves all the passengers to the first compartment, leaving the remaining ones for cargo only.
There are two variants of this option, to use it for the built-in list of vehicles, or all cargo-passenger ships.
The list currently contains just two ships: dunara_castle and klondike. It seems logical for them to have a large cargo hold and a passenger deck at the top.

Compartments calculation info

• Simple scripts I’ve seen before (and the js script I made myself) just overwrite the capacity in each compartment with the seat count, leading to seats * compartmentsNum capacity, which is wrong
• If exact seats are defined for some compartments, they are used as a capacity for these compartments; this capacity is subtracted from the overall seat count
• If exact seats are not defined, compartments are filled equally with seats left from the previous step
• Any leftover seats are added by one to each compartment until none is left

Additional info

• All costs are auto-adjusted. If the capacity is increased, the cost will as well. You are going to earn more too.
• Passenger weight is set to a reasonable 100kg (80kg + 20kg luggage); the original value is 200
• I mainly use trains, so I added a smooth train deceleration here. You can disable it, and it is just one config line change. Please tell me if you think it is too out of place here.
• This mod is going to replace the capacities, so you should load similar mods (like capacity multipliers) after this one
• If you remove the mod, you are going to lose "extra" passengers you had in your vehicles

Source code and non-steam installation

• This mod is available at GitLab repo[gitlab.com]
• The repo is the main source of this mod, all new versions are uploaded there first
• Download the repo and unpack Passenger_Seats_Real_Capacity_1 into your mods folder
• Merge requests and issues are welcome
• Feel free to ask for technical details, I will answer when I have time
• Please open an issue for a discussion before starting to work on a MR

• Do not re-upload this mod to third-party websites without a link to the GitLab repo
• You are free to use the code from this mod in your mods, but please leave a credit to me

Status and feedback

This mod is stable and tested, however, it is also a work in progress.
Please tell me about any issues and ideas you have.
If you have an issue with a particular model, please send a .mdl file and a description of what’s wrong in the Telegram group[t.me]