Scripting questions

Welcome to the OMSI-WebDisk!
As guest you can only see content in your selected language! Registered users can choose the visibility of other languages in their control panel, more informations here. All topics are marked with a language flag inside the forums: = English [EN], = German [DE], = French [FR].
If you're not able to speak the topic language than write in English!
  • Since my question topics on MOF have been closed (along with the entire forum, I supose), I will ask here.


    1. I managed to make the flip-dot fonts, but, as you can see in the picture, the letters in short words are still as spaced as in the Krueger Vollmatrix. How can I bring them closer at center? The same goes for the two rows (so "Bad" and "Warmfeld" are closer).



    2. Also matrix-related: I want the vollmatrix to use as much width as needed in case only a destination/message is shown, but if a line number is also displayed, I want that the maximum space for the destination/message does not exceed the width taken by "Warmfeld" in the picture above (regardless if the line number is a single-digit, 2-digit or 3-digit; should it be a 4-digit number, of course, the available destination space will be narrower, but that isn't my main concern here). Specifically, can the line number be centered, as in the Annax?


    3. I noticed that, when the bus is AI-driven, the ground clearance is quite smaller than when I drive it. What script should I modify in order that the ground clearance in AI mode is a bit higher?


    4. I managed to make the doors open only if the station brake is active, but this brake can be deactivated even if the doors are still open (which leads to the very thing I wanted to avoid in the first place i.e. driving with them opened). What must I modify such that the station brake won't deactivate unless the doors are closed?


    5. Still door-related: this one's a bit tricky: when I press the stop request button, I have to manually open said door once the station brake is active (which does well for me). I also want some external door buttons for passengers to use, such that when they are pressed, the doors will open automatically once the station brake is activated. These external buttons have a switch on the dashboard that (de)activates them (i.e. when it's off, the buttons won't work at all, so the entire [withbutton] thing in thr script is rendered useless). Regarding this on/off switch, I was thinking to assign a [visible] command to it, so the "off" position will "replace" the functioning buttons with a set of identical but static ones. Is it a good idea, or the passengers will still "recognize" the buttons? As of the automatic door opening caused by these buttons, I have no idea how to script it.

    Edited once, last by PaulIP ().

  • Advertisement
  • Hi,
    the spacing in between the letters is called "Sperrung". the logic is trying to space out the letters as far as possible. the script is calculating that value by checing the length of the letters, comparing it with the available length of the display. it will then add empty pixels in between the letters. in the matrix script, the factor for that is saved in the stackposition "6" so it can be loaded with l6 and saved with s6. after calculating the value, its stored in the stack position 7 and handed over to the drawing routine.

    to get rid of that behaviour, look for the macro "(M.V.STTextOut)" and modify it the following way:


    OnawxMG.png


    change it to the following:


    SeuMMEE.png


    this will remove the spacing all together. you can do that for the front line number, the front destination, the side line number and the side destination seperately.


    2)the line number cant be centered with the normal script. its caluclated first and put on the far left of the sign. it will then calculate the maximum space thats left and it will then center the destination in the area thats left free. you could however add a logic that will display it centered.


    3) there is a tag in the *.bus files of a vehicle called "ai delta height" or something similar. you can increase the value (in centimeters) to your likings.


    4) it depends on how a bus is scripted. i cant help you with that without seeing the scripts myself.


    5) normally, the doors are linked to an internal stop request. if thats fired, the script will automatically open the door if all conditions for that are true. you can simply trigger a stop request for a door and it will open automatically. its the same issue as in 4) though - there isnt a rule how a door routine is scripted besides a basic functionality thats the same everytime - handling the passengers entry/exit requests. everything else can be totally different from bus to bus or developer to developer.

  • Thank you very much!

    2) (...) you could however add a logic that will display it centered.


    How should I write this logic? I assume it has to divide the available space for the line number in three and always take the "middle" position.


    Regarding questions 4) and 5), I attach the door script so you may look at it.

  • Is there a constant for the damper variation of the doors, as there are for speed and acceleration variations? I set the damper at a pretty high value (let's say, 32), but I have no control of its variation, such that when I spawn a bus, the damper can have any value between 0 and 32. When the value is too low, the doors slam. I was looking to see if this variation is somehow "hard-coded" in the .osc, but I didn't find anything useful.

    For the record, I am using standard M&R scripts.


    SOLVED

    Edited once, last by PaulIP ().

  • I wish to add a function for height adjustment (with 2 buttons, one for raising and the other for lowering the ground clearance) and another function that "resets" the height to the default position from a third button. I want to do the work to the NL92 bremse script.

    How can I do this?

  • take a look on how the logic part is done in my Urbino II Add-on. Buttonwise its pretty simple.

    for the pneumatic height control, the NL92 bremse.osc basically sets a target height in the ECAS section - if the bus is lower than the target, its getting raised, if its higher it is lowered. you can simply add a logic that takes this target value and increase or decrease it as you wish.