Need help with passenger entries.

Das Forum befindet sich im reduzierten Betrieb. Die Addon- und Supportforen bleiben weiterhin verfügbar.
Bitte beachte, dass OMSI nicht mehr weiterentwickelt wird. Ein Teil der Entwickler widmet sich inzwischen der Entwicklung eines neuen Simulators. Weitere Informationen zum LOTUS-Simulator findest Du hier.
  • Hi all.


    I have a Russian bus (LiAZ 5256.13), which has an amazing quality and i really like driving it. But it being a Russian bus, passengers can use both doors to either enter or leave it, because that's how Russian buses run in real life.


    For my personal use i want to edit the door scripts to make passengers only use the front door to enter and the back for exit.


    I've already adjusted the passengercabin.cfg entries, and it works well, the passengers only move to the front door when i approach a stop, and leaving passengers only go to the back. However, there is an issue with leaving passengers: they move to the rear door to leave, but they will never leave the bus if the front door is not open. In fact, the rear door is useless - if the front one is open, passengers will leave even with the rear door closed ?(


    I opened the doors.osc file of the bus and the script regarding passengers is this piece of code:



    From my very limited knowledge i know i need to remove exit from door 0 and entry from door 1, however, i do not understand the rest of the script. L.L.haltewunsch means stop request, so i know it asks if someone wants to leave, but i really dont know what does the rest mean, and how i could modify it to make it work the way i want (enter the bus via front door, leave via rear door).


    I appreciate any help.


    Thanks :)

  • Hello,


    Could you attach the whole script? I'm not using the particular bus, and the shown portion seems to diverge from the usual M+R-derived door scripts I usually come across, so I'll need more context to understand what it's trying to do and tell you what exactly needs adaptation.


    In a nutshell though: In the passengercabin.cfg you declare [entry]s and [exit]s, in terms of path-points. Each of those corresponds to one pair of the PAX_(Entry|Exit)X_(Req|Open) variables. Virtually always, the sole thing a door script has to do, in order to keep the AI folks in line, is to determine whether the corresponding "physical" door (wing) object is in a sufficiently "open" position to enable passage of a boarding or disembarking passenger. That translates to a single line per logical entry or exit: (L.L.door_X) 0.9 > (S.L.PAX_EntryY_Open) (S.L.PAX_ExitZ_Open), where X the number of the "physical" door wing object, usually between 0-7, and Y, Z the (zero-inclusive) index of the respective [entry] or [exit]; when a wing only serves as either an entry or an exit, but not both, the extraneous (S.L.PAX_EntryY_Open) or (S.L.PAX_ExitZ_Open) assignment can simply be removed.


    However in this case I suspect the script implicitly saves passenger entry/exit request state in the "open" variables in order to somehow leverage it further down the line -- that's why I'd like to take a look at the whole thing, to avoid breaking something.

  • Hi, thanks for your reply. I renamed the file to .txt to be able to attach it, as the forum does not allow .osc files: doors.txt


    As far as I know (from what i've seen when driving the bus and when trying to understand that script), the script checks if there is a stop request for door X, if there is, boarding passengers must wait until all leaving passengers had left the bus before getting in.


    I tried deleting that extra script, but that results in the bus not picking any passengers.

  • Thanks for clarifying; indeed, those assignments appear to serve no purpose other than the one you mentioned -- preventing bidirectional passenger "flow". Given, however, that you now have just one [entry] and just one [exit] in your .cfg, the following really should suffice (assuming door_0 tracks the front door and door_1 the middle/rear one):

    Code
    1. (L.L.door_0) 0.9 > (S.L.PAX_Entry0_Open)
    2. (L.L.door_1) 0.9 > (S.L.PAX_Exit0_Open)

    Let me know if you encounter any problems.

  • Yep that was what i tried first, and i had the problem of passengers not leaving the bus if the front door is closed. Now i solved it by switching the entry numbers in the 'passenger flow control' script. I modified that script to look this way:


    Exit1 and Entry1 do not exist anymore, as there is only one entry and exit. So they should return always false, then giving way to Entry0 and Exit0 which is what i am looking for.


    I tested it in Grundorf and worked great. So the problem is solved. Thanks very much for your help :)

  • Interesting. Frankly I fail to understand why the simple approach wouldn't work, but whatever -- I'll have to download that bus after all to find out (such "it-kinda-sorta-works-but-I'm-clueless-why" situations annoy the hell out of me :P).


    Kudos to you for solving your problem. :)