Script question - message show


Abonniere unseren Kanal auf WhatsApp (klicke hier zum abonnieren).
  • Hi all,


    I´m new here, so first, let me introduce myself - I´m an active member of CS/SK Railworks community, and I´m creator of CS class 141, ex. E499 class, called "Bobina".


    Forgive me if my question is answered somwhere in the forum. I was looking everywhere, but I haven´t found what I´m looking for, yet...


    Ok, here it is - would be someone so kind and describe me how to make the engine script show a custom message, when e.g. some switch is activated? Same way like OBB 1144 has, or vR E03, etc... I mean that small message box which pops up in upper right corner when some event occurs - as I said, when some switch is activated, or panto is raised...
    A short script will do, or just code pasted here, directly in forum.


    I would be very thankful.


    I ´ve been searching for some clues on the internet, but I haven´t found a thing... :(


    Kiski


    P.S.: sorry for my english, not a native speaker

  • Hi @kiski,


    and welcome on board :)


    Is sounds a little crazy within a loco script, but you can handle this with the alert messages from the SzenarioManager.


    The call is something like:


    SysCall ( "ScenarioManager:ShowAlertMessageExt" , "header of the Box" , "first line of the box\nsecond line of the box" , x , y );


    x=time in seconds the box will stay
    y=event name triggered on click


    You can also find these infos in the HOWTOUSE_TSScenarioscript.pdf in your railworks\dev\docs folder


    greetings


    -setter-

  • Ok, thanks a lot. But I still don´t get it. What are you trying to say is that every scenario I play with E03 has a script assigned in order to make these message syscalls work? It would mean that E03 comes with a custom scenario script that is copied to or extend already existing scenario scripts in all routes? Isn´t that crazy?? :D
    Or how it works then??

  • Perhaps I´m dumb, but I still don´t get it, hehe :whistling::wacko:


    Can you write me a short imaginary script section with handling these message boxes according to, let´s say, an imagnary control state? Just as a guide. It would be the best. Thx.

  • Hmm..I´m not willing to do some coding courses but here´s a simple example:

    C
    if(<Your control state> == <whatever you want it>) then
    			SysCall ( "ScenarioManager:ShowAlertMessageExt" , "header of the Box" , "first line of the box\nsecond line of the box" , x , y );
    		 end


    hope this finally helps :)


    greetings


    -setter-

  • Well, I tried to put this code (a sort of...) into Update block in engine script, of course with proper control state (namely: GetControlValue, VZOff, 0) and wanted to detect state TRUE. Nothing happens... 8|