Request for help with a digital clock and monitor with a camera view

  • Hello! Can I ask for help?


    We are working on one project for LOTUS and we finally got to import models from the modeling program into LOTUS.

    First we decided to import and put into operation models, which we will then use very often. Specifically, it is a digital clock showing the time (Orange numbers) and the time when the last train left the station (Green numbers). The next item is a monitor that displays images of cameras from the station in real time:


    I started working on displaying the current time in the game (Orange numbers). Model is OK. What I have a problem with is the script itself. I don't have such experience with programming. Together with my colleague we tried to compile the code, which I then tried to put into operation using various videos and articles from Lexicon. Unfortunately, unsuccessfully.

    My first code:



    I deleted this and with Tutorial for Text-Texture on YouTube I tried to put a static text in place, and I succeeded:


    Unfortunately, I don't know how to proceed. Here on the forum I found some code that I tried to use, but again - unsuccessfully.


    Next, may I ask how I should then continue to show when the previous train left the station? I assume that the script will contain a command in the style "If the train passes over the trigger, start the countdown from 00:00", right? Alternatively, what should a script look like?


    And my last question, can I ask how do I make monitors displaying images from cameras? It occurred to me that I could assign "Realtime Reflection" to each of the "plates" on which the image is projected. Unfortunately, I don't know how to do it...


    Thank you very much for your help!


    Have a nice day!

    FidloBUS, Czechia


    (Translated with Google)

  • You redefined the procedure for ScriptTextures. You can't create a new procedure because that would clash with LOTUS function, so you have to do something like:

    Although I think in your case it would be a lot smarter to use Text-Textures, where you will only need:

  • Thank you for your help!

    I tried to copy your Text-Texture script. At first, LOTUS showed me the mistake of not knowing the temptime variable in the Initialize procedure. I solved this by copying "var" from the SimStep procedure. Then I tried to import the script again. Successful but with one error:


    [Error] (29:3): Type mismatch


  • There‘s a semicolon missing. Also, to answer your question about the tram triggering your „time since last train“-display, that‘s impossible right now, it will be possible later tho.

  • I tried to insert the object in Map-Editor and it shows the body texture. (I think it has something to do with TexID_draw).


    I apologize if my questions or advice come to someone nonsensical, or someone tells me how I can't solve this simple thing. The answer is simple. I just can't do it yet. :) I'm a beginner, like a colleague, we have a lot of work to do. And as we say in the Czech Republic, "You do not have to pay for asking." That's why I use the opportunity and ask me not to find out at the end that I did something at the beginning / I learned something wrong. Thank you for understanding! ;)

    //: I have added a semicolon, but still reporting an error on line 29:3.

    Edited once, last by FidloBUS: Adding information about changing the script, I did not want to add another post, so I decided to edit the existing one. ().

  • I apologize if my questions or advice come to someone nonsensical, or someone tells me how I can't solve this simple thing.

    No problem, can you show me the configuration of your text-texture in the object tool and the mesh config of the timer display mesh?

    Btw. this is what you need to change:

    Code
    1. if Second <> previousSecond then begin
    2. displayText := (IntToStr(Hour) + ':' + IntToStr(Minute) + ':' + IntToStr(Second));
    3. end
  • Try this:

  • You have to use FloatToStr instead of IntToStr. And you can also replace this:

    Code
    1. if Second <> previousSecond then begin
    2. displayText := (IntToStr(Hour) + ':' + IntToStr(Minute) + ':' + IntToStr(Second));
    3. end

    with this:

    Code
    1. if Second <> previousSecond then displayText := (FloatToStr(Hour) + ':' + FloatToStr(Minute) + ':' + FloatToStr(Second));
  • Mikes Nope, that won't work. You have to use:

    Code
    1. if Second <> previousSecond then
    2. displayText := (FloatToStr(Hour) + ':' + FloatToStr(Minute) + ':' + FloatToStr(Second));
    3. previousSecond := Second;
    4. end;
  • Guys, big thanks! It works! Except it has one little "mistake on beauty". The time is displayed in the "displaytext" as follows:


    6.000000000000:28.000000000000:48.000000000000


    The last thing missing is the removal of decimal places. ^^

  • try this:

    Code
    1. if Second <> previousSecond then
    2. displayText := (IntToStr(Trunc(Hour)) + ':' + IntToStr(Trunc(Minute)) + ':' + IntToStr(Trunc(Second)));
    3. previousSecond := Second;
    4. end;
  • Great, it works! I just didn't think of one thing ... I would need that if the hour / minute / second number is less than 10 and 9 respectively, the number should be 0 before it. Like: 06:07:03...

  • Guys, huge thanks to both of you for your help! I am grateful, you have helped me incredibly! ^^


    My last question: I know it is currently not possible to create a trigger that starts counting the time after the train leaves the station.


    But, in the current state of LOTUS, is it possible to create a "real reflection" display? I am referring to a monitor that shows the cameras going to the platform, as in my 1st post in the illustration photo? If possible, could I ask how?