Scripts to "appear/disappear" Objects.

Willkommen in der OMSI-WebDisk!
Als Gast kannst du nur Inhalte in deiner ausgewählten Sprache sehen. Registrierte Nutzer können die Sichtbarkeit anderer Sprachen in ihrem Kontrollzentrum aktivieren, weitere Infos hier.
Alle Themen sind in den Foren mit einer Sprachflagge gekennzeichnet: = Englisch [EN], = Deutsch [DE], = Französisch [FR]. Wenn du die angegebene Sprache nicht beherrschst, schreibe auf Englisch!
  • Hi, my goal is to try to understand how the scripting system works for scenery objects, particularly, making objects appear and disappear based on the time of day. My goal is to have ai "car_park" objects appear and disappear based on the time of day.


    I found this code from one of the static "people_standing" objects and was wondering if someone could explain the different functions and variables used in the .osc file to make the appear/disappear variable work:



    I'd like to understand how to edit this code to my specification so that I don't need to ask this question every time! ;)

  • Hey!

    You could look into "Waldheinis Objekte" from the maps Ettbruck and Blankwitz.

    The benches in the beer garden appear at a certain time. This is regulated with just such a script.

    I do not have this at the moment, but I know that there is a query by time of day. A query of the day of the week is also possible.

  • Im going to Link an older Thread from the other Omsi-Forum on which I provided an example script, since the thread is in german you might have trouble to understand the complete discussion: *Klick*



    In the upper example the object becomes visible after 9am and disapears after 9pm


    Maybe this helps :)

    java.lang.StackOverflowError


    forum.png


    Kein Support über DM/PM

  • I have edited the code now so that in the editor, the "car_park" object appears and disappears at the right time using the "Environment" tab. However, when I go in game, the parked cars do not spawn/despawn when I change the time of day. Is this a limitation of the game?


    Edit: No Need! Found Solution!