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?

  • Newly created posts will remain inaccessible for others until approved by a moderator.

    The maximum number of attachments: 5
    Maximum File Size: 500 kB
    Allowed extensions: bmp, cfg, ini, jpeg, jpg, lct, ldl, llg, lob, log, lpmtl, lptmt, ltx, pas, pdf, png, railtrack, rar, txt, veh, wav