Page 1 of 1

Passenger count for vehicles

Posted: Fri Jun 04, 2021 2:21 am
by PFQNiet
Currently we have a boolean value to allow passengers at all. So for a car we can have zero or two occupants.

Personally I have a use case where I want a car to only allow one occupant, the driver. I have to implement this via script, by ejecting any passengers who try to enter.

It could also be neat to allow more than two occupants. An advanced tank for example might allow four occupants. I'm not sure how this would work for weapons, it could either be the first passenger or maybe new UI for selecting a passenger to be the gunner?

Okay maybe more than two occupants is unnecessary, but being able to say "driver only" would be nice.

Re: Passenger count for vehicles

Posted: Fri Jun 04, 2021 12:53 pm
by Amarula
+1
Allowing a mod to determine the maximum number of passengers opens up lots of fun possibilities like tour buses and centipedes.
The last time I checked, trains only allowed one passenger per locomotive/cargo wagon/fluid wagon (so I needed to add two cargo wagons to my personal train in order to give both kids a ride around my base). Giving mod control over passenger counts for those vehicle types also opens up shenanigans.
I could see a mod wanting to know how many passengers were present for things like a train that leaves when enough passengers have boarded.

Re: Passenger count for vehicles

Posted: Fri Jun 04, 2021 3:09 pm
by Klonan
PFQNiet wrote:
Fri Jun 04, 2021 2:21 am
Okay maybe more than two occupants is unnecessary, but being able to say "driver only" would be nice.
It is a possibility to split into 2 bools, 'allow_drivers' and 'allow_passengers'. It wouldn't be so simple, but possible
Amarula wrote:
Fri Jun 04, 2021 12:53 pm
Allowing a mod to determine the maximum number of passengers opens up lots of fun possibilities like tour buses and centipedes.
This is just not possible at the moment, the game only stores 1 driver and 1 passenger, and the logic is very specific

I mean with programming anything is possible, we can change the passengers to a vector of players, etc.,
But that moves into more feature territory, rather than just a simple clean interface request for a feature that already exists

Re: Passenger count for vehicles

Posted: Mon Jun 21, 2021 11:46 am
by Stringweasel
+1 for dissallowing passengers with a second bool flag.

It would be very useful for my beta-ish Demolition Derby mod. Currently I need to add a lot of fluff code to ensure that there's never more than one player in a vehicle. This generates a lot of extra events (passenger getting in + script removing passenger).

Re: Passenger count for vehicles

Posted: Mon Jun 21, 2021 4:51 pm
by Silari
Klonan wrote:
Fri Jun 04, 2021 3:09 pm
PFQNiet wrote:
Fri Jun 04, 2021 2:21 am
Okay maybe more than two occupants is unnecessary, but being able to say "driver only" would be nice.
It is a possibility to split into 2 bools, 'allow_drivers' and 'allow_passengers'. It wouldn't be so simple, but possible
If this does happen, I would suggest allowing for a passenger only vehicle - ie one occupant who can't move the vehicle. I'm sure there's a mod that could make use of it.

Re: Passenger count for vehicles

Posted: Tue Jun 22, 2021 3:46 pm
by pleegwat
Silari wrote:
Mon Jun 21, 2021 4:51 pm
Klonan wrote:
Fri Jun 04, 2021 3:09 pm
PFQNiet wrote:
Fri Jun 04, 2021 2:21 am
Okay maybe more than two occupants is unnecessary, but being able to say "driver only" would be nice.
It is a possibility to split into 2 bools, 'allow_drivers' and 'allow_passengers'. It wouldn't be so simple, but possible
If this does happen, I would suggest allowing for a passenger only vehicle - ie one occupant who can't move the vehicle. I'm sure there's a mod that could make use of it.
Player-controlled turrets?