Questions on coding a signal

  • Hello,


    It's been awhile (more like a year) since I last played around with scripting, at that time a (now failed) DFI.


    Now, I'm in the process of creating my local railroad signalling, which of course needs a script.

    But I'm having a hard time understanding the lexicon article....


    1. The signal has 6 lamps, with 8 different states (6 continuously lit and 2 blinking ones). So far, I've declared a public variable for each state, to control each lamp's night texture.

    The article mentions to declare the signal terms (Begriffe) in the object properties, I've done this as well, but how are these then assigned to each state?


    2. is the mentioned "signalstate" variable a system variable like "trafficlight_phase"?


    3. Does the value of "signalstate" have to be the power of 2, or is this just an example?


    Please help me understand this better.

    And if not yet completely possible, maybe how to "cheat" it a bit?



    LG

  • Perhaps I should clarify a bit...


    How can I assign the different signal terms (as integer values) to the signalstate variable?

  • Neu erstellte Beiträge unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.

    Die letzte Antwort auf dieses Thema liegt mehr als 60 Tage zurück. Das Thema ist womöglich bereits veraltet. Bitte erstellen Sie ggf. ein neues Thema.

    Maximale Anzahl an Dateianhängen: 5
    Maximale Dateigröße: 500 kB
    Erlaubte Dateiendungen: bmp, cfg, ini, jpeg, jpg, lct, ldl, llg, lob, log, lpmtl, lptmt, ltx, pas, pdf, png, railtrack, rar, txt, veh, wav