1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

[VST] How can I reset state machine in given scenario?

Discussion in 'Visual Scripting' started by Parc@Moules, Mar 21, 2020.

  1. Parc@Moules

    Parc@Moules Trainee Engineer

    Messages:
    1
    Spoiler alert: this is my first try at VST :)

    I'm trying to follow the tutorial presented in https://www.spaceengineersgame.com/visual-scripting-tool.html, but I'm stuck in the section "Progressing Through Your Mission". Reason is, as far as I can see, that when you reached this part, you've already completed the mission_start objective, and the state machine has moved to the second objective where there is no code. Starting a new scenario does not change that as changes are saved with the scenario.
    I'm sure there a correct way to do reset the state machine or select a specific objective as you build your scenario - can anyone explain?

    Thanks a bunch
     
    Last edited: Mar 21, 2020
  2. doncdxx

    doncdxx Apprentice Engineer

    Messages:
    438
    I'm not sure what you mean about resetting the state machine, but it is possible to loop back to an earlier objective. For example, you could nave an objective with 2 different ways to complete. The normal "completed" that moves on to the next mission and "failed" that goes back to the previous objective. I suppose that looping back to the first objective is effectively the same as resetting the state machine.
     
  3. Richard Gemmell

    Richard Gemmell Trainee Engineer

    Messages:
    1
    I ran into the same issue. I think it's triggered by using the "Run Scenario" button in VST. I fixed it by opening the sandbox file for the current mission. In my case that's Worlds\Mission01\Sandbox.sbc. Find the ScriptStateMachineManager/ActiveStateMachines/CursorStruct/ element. Change the nested NodeName element value to Start and save it. Presumably the StateMachineName determines the active state machine.

    I haven't found a way to do this with VST.