How to directly control state changes?

NodeCanvas Forums Support How to directly control state changes?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16360
    ncnoob
    Participant

    I want to directly control the transition to State.

    There are three related questions for this.

    I am using Signal/CSharp Event for State transition.

    I want to explicitly call events directly from the code to manage state transitions.

     

    Q1

    Is a state without an update possible?

    I only want to use State’s Enter/Exit.

    If the state was created directly with the code, this was possible by clearing the Update.

    (Do not call Finish, do not use Update)

    If UI(Action State)’s OnUpdate is empty, State executes OnExit after OnEnter is completed and ends.

    Is there a way to use only OnEnter and OnExit by ActionState Node UI?

    (If i enter State, run OnEnter /

    OnExit run only when the state changes /

    State is maintained until a direct transition event is generated, and OnExit is not run)

     

    Q2

    Is there a way to force a switch to a specific state (ActionState/SubFSMetc)?

    Setting up transitions on all states in AnyStates makes the graph too complicated.

    Is there a way to switch to a specific state directly from the code?

     

    Q3

    Documentation

    Five states are available when creating a state in the code.

    (OnInit / OnEnter / OnUpdate / OnExit / OnPause)

     

    In the action state of the graph, only three are used.

    (OnEnter / OnUpdate / OnExit)

    Can I use OnInit/OnPause like the code in the graph UI?

    Attachments:
    You must be logged in to view attached files.
    #16364
    Gavalakis
    Keymaster

    Hello there,

    Let me address your questions.

    Q1. Can you please clarify what the question is a bit more? A state is doing what the tasks assigned to it are doing. If you use the “Action State (Super)” and do not assign a task to Update, then the state shall not do anything in its Update.

    Q2. Yes, you can manually switch states from code, using the “FSMOwner.TriggerState” method providing the name of the state you want to force trigger/enter. Thus for this, you will also need to give a unique name to the states you want to use in this way.

    Q3. Do you mean to have a list of tasks in the graph UI in the Super Action State, that will execute OnInit and OnPause (on top of the existin OnEnter, OnUpdate, and OnExit lists) ?

    Let me know.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.