Reveal 'hidden' Tasks And Hide Shown Tasks Mid-scenario Using Lua?

Discussion in 'Content Developer's Area' started by smproductions, Dec 23, 2022.

  1. smproductions

    smproductions New Member

    Joined:
    Jan 26, 2022
    Messages:
    9
    Likes Received:
    17
    I'm currently working on a scenario where a train is diverted en route. Below is what I have in my task list:

    Pick up passengers from Station A - shown in task view (starting station)
    Pick up passengers from Station B - shown in task view (message pops up to inform player of diversion)
    Pick up passengers from Station D - hidden in task view (triggers LUA script to end scenario there)
    Pick up passengers from Station C - shown in task view (shown in the list but train will not go there)

    abcd.png

    I already know how to use TriggerScenarioComplete once the train has reached Station D but what I am trying to achieve is when the train reaches Station B, reveal the hidden task for Station D on the HUD and task view then hide the task for Station C. Is this at all possible using LUA scripting?

    Many thanks.
     
  2. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,806
    Likes Received:
    1,817
    Afaik hide task is just to hide go via instructions so you don't have a task list filled with them therefore only showing the important station stops or wait at information.

    Saying that there are many things achievable in this sim with .lua so who knows?
     
  3. KTL_Rob Powell

    KTL_Rob Powell Well-Known Member

    Joined:
    Aug 18, 2018
    Messages:
    231
    Likes Received:
    296
    Sorry I'm late to the party You can not I'm afraid hide a task that you have set. You can however uhide a task with the following:

    ScenarioManager:UnhideDriverInstruction ( index ) (where index = number of the instruction.)

    Just remember that unlike other scripting languages the index in lua starts at 1 not 0!
     
    • Like Like x 1
  4. inversnecky

    inversnecky Well-Known Member

    Joined:
    Dec 26, 2020
    Messages:
    2,252
    Likes Received:
    843
    So Destination D can be unhidden after visiting B, but, whether or not C can be hidden, it and D are irreconcilable destinations, so how would that be handled? I presume C can’t be deleted as a task?
     

Share This Page