Removing Scenario Instruction Pop Up Windows

Discussion in 'Technical Reports' started by miata54, Sep 2, 2024.

  1. miata54

    miata54 Member

    Joined:
    Jul 31, 2021
    Messages:
    94
    Likes Received:
    5
    Some scenarios have pop up windows with info or instructions. What is the easiest way to remove these windows from a scenario?
     
  2. cunningn#3154

    cunningn#3154 Well-Known Member

    Joined:
    Mar 22, 2023
    Messages:
    228
    Likes Received:
    303
    These are triggered events within the scenario - so you will need to edit the scenario in some manner. Find the scenario folder (underneath the folder structure for the route) and then find the scenarioscript.lua.

    Open this file with Notepad.

    This will contain this function:
    Code:
    function OnEventIntroduction()
      SysCall ( "ScenarioManager:ShowInfoMessageExt", "1.15pm Tenison Field to Whitemoor", "IntroText.html", 0, MSG_VCENTRE + MSG_CENTRE, MSG_LRG, FALSE );
    end
    You should be able to comment out the ShowinfomessageExt call by putting two dashes in front of it like this:
    Code:
    --SysCall ( "ScenarioManager:ShowInfoMessageExt", "1.15pm Tenison Field to Whitemoor", "IntroText.html", 0, MSG_VCENTRE + MSG_CENTRE, MSG_LRG, FALSE );
    This should switch off the message without causing any other problem (with luck).
     
  3. miata54

    miata54 Member

    Joined:
    Jul 31, 2021
    Messages:
    94
    Likes Received:
    5
    ScenarioScript - Notepad 9_3_2024 10_17_46 AM.png Train Simulator (x64).jpg Train Simulator (x64).jpg Thanks for your suggestion but it did not eliminate what I am trying to get rid of. See attached pic. These are the messages that I want to eliminate. I opened the script lua for the scenario and placed two dashes in front of the SysCall entries. The message still appeared.
     
    Last edited: Sep 3, 2024
  4. cunningn#3154

    cunningn#3154 Well-Known Member

    Joined:
    Mar 22, 2023
    Messages:
    228
    Likes Received:
    303
    Silly question but...you did remember to save your edit, flush your game cache and restart the game?
     
  5. Spikee1975

    Spikee1975 Guest

    Neither clearing the cache (which refers to Asset blueprints index (blueprints.pak) only) nor restarting the game is required for that.

    More likely that a compiled .luac version is present in the scenario, which has higher priority. Just delete it and the game will read the changed .lua script. (Compiling scripts is only there for obfuscation and IP protection, not performance.)

    Needless to say, always work on clones. Career scenarios may stop working when a mismatch between the .luac.md5 and the script checksum is met. You'd need to then recompile it using the editor.
     
    Last edited by a moderator: Sep 3, 2024
    • Like Like x 1
  6. knuckleshed

    knuckleshed Well-Known Member

    Joined:
    Jul 14, 2024
    Messages:
    441
    Likes Received:
    449
    Wouldn't it just be easier to remove the instructions from within the scenario editor?
     
  7. Spikee1975

    Spikee1975 Guest

    If they are script-triggered like intro.htmls, it won't work, only for instruction triggered (Default, Failed or Succeeded). You can view and compile but not edit a script inside the editor, alt tab to your text editor and then reimport it into the game (Reload in the timetable script window).

    Of course it's quicker to accept the authors' choice and just close the windows when appearing. (Keyboard: Shift+Backspace)
     
    Last edited by a moderator: Sep 3, 2024
  8. knuckleshed

    knuckleshed Well-Known Member

    Joined:
    Jul 14, 2024
    Messages:
    441
    Likes Received:
    449
    I thought seeing as the script needed to be triggered by a Trigger Instruction (List with a cog icon) in the timetable list, wouldn't removing that from the scenario list then defunct the .lua from ever being called?
     
  9. Spikee1975

    Spikee1975 Guest

    There might be more SysCalls or instructions than only a message inside one specific function call via trigger, which could affect the scenario. So you could deactivate something else by just removing the script call, depending on the script.

    A function call / OnEvent could be raising a counter (like in JBFried's puzzle scenarios) or changing a ControlValue AND outputting a message. You'd kill all that way.
     
    Last edited by a moderator: Sep 3, 2024
    • Like Like x 1
  10. miata54

    miata54 Member

    Joined:
    Jul 31, 2021
    Messages:
    94
    Likes Received:
    5
    OK I tried this method, and it works. I then ran the scenario and did not see any performance hit or missing actions, such as signal operations. Interesting that this particular scenario had both script lua and luac files but some other scenarios don't. I removed both of these files from the scenario, but the messages still appeared. At any rate, I now have a solution.
     
  11. Spikee1975

    Spikee1975 Guest

    That's because as a scenario author, you need to remove the source .lua yourself for shipping - the game reads the .luac if present. Some authors want to hide their magic and delete the lua before releasing a scenario. It's only needed during development really.
     
  12. knuckleshed

    knuckleshed Well-Known Member

    Joined:
    Jul 14, 2024
    Messages:
    441
    Likes Received:
    449
    Good point, still, I think most only use it for displaying messages and in days gone by a short video. iirc.
     
  13. miata54

    miata54 Member

    Joined:
    Jul 31, 2021
    Messages:
    94
    Likes Received:
    5
    Just found another way to eliminate these info messages. In some scenario folders, I have found a folder titled EN, which is denoting the language within. Opening this folder reveals multiple message files created by the author. Simply delete this folder and the pop up messages are history. This may be old news to most, but new to me.
     
  14. cunningn#3154

    cunningn#3154 Well-Known Member

    Joined:
    Mar 22, 2023
    Messages:
    228
    Likes Received:
    303
    Yes - if you wanted to remove every message then this would also work. Glad you got a fix that you're happy with.
     

Share This Page