We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
is there a way to increase the capacity of public transport vehicles such as trains?
I don't find any vehicles in the asset editor, only the train station itself.
This is what I use (commented out some other stuff) to modify the capacities. Just replace the "Settings.Instance.XXCapacity" with whatever value you want.
Code:
using System;
using ICities;
namespace ApocDev.CitySkylines.Mod
{
public class ModCore : IUserMod
{
#region Implementation of IUserMod
public string Name { get { return "ApocDev's Mods"; } }
public string Description { get { return "A collection of modifications to the game to make the experience all the more better!"; } }
#endregion
}
public class CoreLoading : LoadingExtensionBase
{
private void RunOnPrefabs<TPrefab, TAI>(Action<TAI> runner) where TPrefab : PrefabInfo where TAI : PrefabAI
{
if (runner == null)
return;
var prefabCount = PrefabCollection<TPrefab>.PrefabCount();
for (uint i = 0; i < prefabCount; i++)
{
var prefab = PrefabCollection<TPrefab>.GetPrefab(i);
var ai = prefab.GetAI();
if (ai is TAI)
runner(ai as TAI);
}
}
public override void OnLevelLoaded(LoadMode mode)
{
if (mode != LoadMode.NewGame && mode != LoadMode.LoadGame)
{
base.OnLevelLoaded(mode);
return;
}
if (Settings.Instance.ModifyCapacities)
{
// Do all prefabs
RunOnPrefabs<VehicleInfo, BusAI>(p => p.m_passengerCapacity = Settings.Instance.BusCapacity);
RunOnPrefabs<VehicleInfo, PassengerPlaneAI>(p => p.m_passengerCapacity = Settings.Instance.PassengerPlaneCapacity);
RunOnPrefabs<VehicleInfo, PassengerShipAI>(p => p.m_passengerCapacity = Settings.Instance.PassengerShipCapacity);
RunOnPrefabs<VehicleInfo, PassengerTrainAI>(p => p.m_passengerCapacity = Settings.Instance.PassengerTrainCapacity);
}
//CitizenAIModifications.ApplyWalkingDistanceMod();
base.OnLevelLoaded(mode);
}
}
}
And the defaults just for brevity (plus my defaults for the modifications)
Ok I'm very new to this sort of modding, how do I "use" this code? Where do I paste it? Also how would I add the various trucks, vans, and cargo trains to this list?
I assume it involves making a new mod folder and creating a new .cs file but what about the dll?
Also in your posted comments you seem to have a mod collection but I can't find it anywhere on the workshop.
Hey Apocdev,
it would be amazing if you could create a working standalone mod for, just changing the capacity of certain vehicles.
I tried to create a cs file with your code myself, but for some reason I can't even select the mod ingame, maybe because of the missing dll file.
Baro, you need compile ApocDev' code into dll with MonoDevelop or Visual Studio.
I'm zero in programming myself, but this what I did:
1) Set up Visual Studio (MonoDevelop will work too) and create new solution (Reddit Guide)
2) Copy above code. I think it's some kind of mods collection, so I modified last part of code like this:
"I'm zero in programming myself"
What the goddamn hell?
Where do I have to put this code?
Where I have to change the variables?
Which is the data I have to change?
Or I need to summon a demon in my living room to give him this mysterious code?
Goddamnit, I need a solution for a dumbfuck like me, try to expain that to a 6 year old that is still believing in Santa Claus!!
Well, it's probably would be easier to wait ApocDev release his(her) mod collection. There is mod on steam where you could config parameters via simple txt file, but I don't know how to do it myself.
I compiled two versions of mod:
1) With ApocDev's values
2) With "cheat" values (Bus = 100, plain = 150, train = 200, ship = 180)
Download from Dropbox
Unzip to C:\Users\YOU_PROFILE_NAME\AppData\Local\Colossal Order\Cities_Skylines\Addons\Mods (if you on Windows, otherwise - look here).
AppData folder can be invisible, so you probably should change system settings like this.
So you should have folder structure like this:
Load the game and activate one of Transport Capacity mod. I believe you need demolish old transport building and build new ones for this to work on old saves (I tested with Bus Depot):
My game is in Russian language, sorry)
This probably will blow up your PC, I take no responsibility
Well, it's probably would be easier to wait ApocDev release his(her) mod collection. There is mod on steam where you could config parameters via simple txt file, but I don't know how to do it myself.
I compiled two versions of mod:
1) With ApocDev's values
2) With "cheat" values (Bus = 100, plain = 150, train = 200, ship = 180)
Download from Dropbox
Unzip to C:\Users\YOU_PROFILE_NAME\AppData\Local\Colossal Order\Cities_Skylines\Addons\Mods (if you on Windows, otherwise - look here).
AppData folder can be invisible, so you probably should change system settings like this.
So you should have folder structure like this:
Load the game and activate one of Transport Capacity mod. I believe you need demolish old transport building and build new ones for this to work on old saves (I tested with Bus Depot):
My game is in Russian language, sorry)
This probably will blow up your PC, I take no responsibility
Thanks for posting it made things much clearer for me, but unfortunately this mod doesn't work.
Trains for instance have now 480 capacity - thats great - but only 240 passengers enter the train...
so my trains now have 240/480 passengers aboard all the time and the stations are still overcrowded.
I think it is capped somehow, but there should be a variable to unlock this.
In case you want to do it by yourself (for windows). Sorry, my english is zero as well
1) Download MonoDevelop (Xamarin Studio for Windows) here. It's in Windows section. You'll need additionally download two libraries (NET Framework 4.5 and
GTK# for .NET 2.12.25 - links are on the same page).
2) Open Xamarin Studio (XamarinStudio.exe in installation directory) and create new solution with C# library:
a) Hit "New solution"
b) Select C# > Library
c) Type name of your mod
3) Solution will be created. Hit on References folder and choose Edit References from dropdown menu:
4) Choose ".Net Assembly" tab.
a) Hit "Browse"
b) Navigate to you Cities Skylines installed directory > Cities_Data > Managed (Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed
c) Select Assembly-CSharp.dll and hit "Open".
d) Repeat the same to add ColossalManaged.dll, ICities.dll and UnityEngine.dll.
e) Check all loaded libraries:
5) Now copy your code MyClass.cs tab. You can change capacity values to whatever you like (check image below).
Code:
Code:
using System;
using ICities;
namespace changeTransportCapacity
{
public class ModCore : IUserMod
{
#region Implementation of IUserMod
public string Name { get { return "Transport Capacity "; } }
public string Description { get { return "Increase transport capacity"; } }
#endregion
}
public class CoreLoading : LoadingExtensionBase
{
private void RunOnPrefabs<TPrefab, TAI>(Action<TAI> runner)
where TPrefab : PrefabInfo
where TAI : PrefabAI
{
if (runner == null)
return;
var prefabCount = PrefabCollection<TPrefab>.PrefabCount();
for (uint i = 0; i < prefabCount; i++)
{
var prefab = PrefabCollection<TPrefab>.GetPrefab(i);
var ai = prefab.GetAI();
if (ai is TAI)
runner(ai as TAI);
}
}
public override void OnLevelLoaded(LoadMode mode)
{
base.OnLevelLoaded(mode);
RunOnPrefabs<VehicleInfo, BusAI>(p => p.m_passengerCapacity = 45);
RunOnPrefabs<VehicleInfo, PassengerPlaneAI>(p => p.m_passengerCapacity = 75);
RunOnPrefabs<VehicleInfo, PassengerShipAI>(p => p.m_passengerCapacity = 100);
RunOnPrefabs<VehicleInfo, PassengerTrainAI>(p => p.m_passengerCapacity = 60);
base.OnLevelLoaded(mode);
}
}
}
Image:
6) From menu chose Build > Build [yourModName] (F7). It probably shows warnings (I got two warnings, but it seems they can be ignored. I didn't get any warnings in Visual Studio)
7) Your compiled dll will be in project folder \bin\Debug like this:
8) Create mod folder C:\Users\YOUR_PROFILE_NAME\AppData\Local\Colossal Order\Cities_Skylines\Addons\Mods and copy your .dll there, so its Mods/your_mod_name/your_mod.dll.
9) Start the game, check mod in manager and test.
A normal 12m Bus like the one ingame has a rounded capacity about 90~
For e.g. -
Mercedes Citaro O530 12m - Seats: 26, Standing capacity: 69 = 95
MAN NL 263 12m - Seats: 29, Standing capacity: 60 = 89
Solaris Urbino 12 12m - Seats: 27, Standing capacity: 75 = 102
So about 90 persons for a Bus is a realistic capacity.
Just triple all default values. A subway can carry up to 600 Persons, depending on the length and the waggons, so I think 300 should be a good value ingame
I have a collection of QOL mods, yes. Mostly related to fire spread, public transport capacity, fixing citizen walking distances (they now walk ~10 blocks for me, instead of across the entire city), and some better handling of water/sewage.
The game has pretty good defaults, but I find that some things just don't make a whole lot of sense.