Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Hi, the code I had stopped working after the last update, the "Begin" function works, but the "Update" stopped working.

    Any idea of what could have happened?

    I'm using blueprints on 4.18.3

    Comment


      Try recreate States array then recreate generated functions. ( green button to add bp functions)
      | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

      Comment


        Thanks for the reply,

        Already did both, nothing.... I remade the states array, deleted the functions and generated them again.

        Comment


          Originally posted by scardario View Post
          Thanks for the reply,

          Already did both, nothing.... I remade the states array, deleted the functions and generated them again.
          Did you enable "Debug" checkbox in advanced options (below an "v" arrow) on your FSM asset BP to see if there's any warnings?

          Also, is "Auto Flow FSM" option enabled in project settings?
          Last edited by BrUnO XaVIeR; 07-09-2018, 09:50 PM.
          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

          Comment


            I hadn't enabled the "Debug" option, this is what it appears on screen, no warnings on the Message Log though.

            Click image for larger version

Name:	fsmDebugMessage.jpg
Views:	1
Size:	4.6 KB
ID:	1499551

            And yes, I have the "auto Flow" option enabled, everything was working fine until I tried to add a new state and began to broke.

            The only state that is running is the Startup State configured in the "FSM" Tab on Class Defaults.

            Comment


              Somewhere in your blueprints you are applying a State that doesn't exist...
              As a result the component is set to a "null state" since it can't find the one you're telling it to activate.
              | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

              Comment


                Ok, so I gave it a rest to everything (including my brain) because it wasn't working at all, after a good night's sleep I started to reorganize everything, I even deleted and recreated the component in the owner object and the states in the FSM object. Now it seems to be working correctly.

                Thanks for the help.


                EDIT:

                I'm having problems again, now I can see some warnings on the message log:

                Code:
                {FSM}:: 'Set State' named [None]: State ID doesn't exist. -->  FSM: Set State: [Function /Script/UFSM.StateMachineComponent:SetState at (maquinaEstados-nacho_C /Game/maps/UEDPIE_0_start.start:PersistentLevel.nacho_C_0.maquinaEstados-nacho)]
                {FSM}:: 'Set State' named [saltar]: State ID doesn't exist. -->  FSM: Set State: [Function /Script/UFSM.StateMachineComponent:SetState at (maquinaEstados-nacho_C /Game/maps/UEDPIE_0_start.start:PersistentLevel.nacho_C_0.maquinaEstados-nacho)]
                I already double checked the state names, for some reason it's being unable to set an existent state.
                Last edited by scardario; 07-10-2018, 11:27 AM.

                Comment


                  I already validated the first one, the [None], it was a mistake on my behalf. But the other one, [saltar], is not being found and it exists (doubled checked)

                  What can I do?

                  Comment


                    I have this states array:

                    Click image for larger version

Name:	fsmError01.jpg
Views:	1
Size:	8.7 KB
ID:	1499953

                    The configuration as pictured above will throw a warning immediately since it can't detect the "saltar" state. After I did that, all states now are NULL, before that, "idle" and "correr" were working fine.

                    I tried to change the state by using id and that didn't work either, it's like the state doesn't exist regardless of the array contents.

                    Is there a way to reset the states besides deleting the array and creating it again? I've done that several times and doesn't work.

                    Comment


                      Are you sure you're using case sensitive state names?
                      "Saltar" and "saltar" are two different things.
                      | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                      Comment


                        Yes, I'm aware of that, I'm sure everything is lowercase.

                        Besides, as I described, I also tried with states IDs, and that' didn't work either.


                        There's something that I should note, I don't know if it's important to this case: I have two FSM classes, one inheriting from the other. At first, I had the first two states (idle and correr) in the base class. But later I deleted the array on both of them and recreated all the states in the child class.

                        Comment


                          I recreated the two whole classes and found the same problem:

                          Code:
                          {FSM}:: 'Set State' named [rollo]: State ID doesn't exist. -->  FSM: Set State: [Function /Script/UFSM.StateMachineComponent:SetState at (maquinaEstados-nacho_C /Game/maps/UEDPIE_0_start.start:PersistentLevel.nacho_C_0.maquinaEstados-nacho)]
                          And this is my array, as you can see, I have a "rollo" state, in lowercase:

                          Click image for larger version

Name:	fsmError02.jpg
Views:	1
Size:	11.4 KB
ID:	1500008


                          The other states are working fine after I made the two classes from scratch, this is the graph tree of the current states:

                          Click image for larger version

Name:	fsmErrorGraphTree.jpg
Views:	1
Size:	146.3 KB
ID:	1500009

                          Comment


                            If you can migrate the Blueprint to a blank project and send me a link, I can take a look tomorrow morning.
                            Can't be a big zip file tho because I have only 30 minutes free to check it out before leaving tomorrow.

                            Seems like you try somewhere to set states before any State object is created.
                            I can only be sure looking through bp graphs.

                            _____

                            Btw, did you create the array in the asset or just in instances of Fsm Component attached to something?!
                            Last edited by BrUnO XaVIeR; 07-10-2018, 08:07 PM.
                            | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                            Comment


                              Thank you!

                              Here goes, had to delete some references, the variables were updated from the owner class but I had to delete that because it needs a more complicated environment, if you need the character class that is updating the variables I can see what can I do:

                              https://www.dropbox.com/s/4et75y1ymr...oblem.zip?dl=1


                              I created the array inside the asset (one of them, I have two FSM objects, one inherits from the other, the array is in the child)

                              Comment


                                Originally posted by scardario View Post
                                I created the array inside the asset (one of them, I have two FSM objects, one inherits from the other, the array is in the child)
                                I guess is better avoid this kind of setup.
                                Btw, your problem is something else somewhere in your Blueprints.

                                I executed the project in Unreal 4.18.3 and the plugin is working correctly, everything worked here... I set "rollo" state and it worked just fine:
                                Code:
                                PIE: Play in editor start time for /Temp/UEDPIE_0_Untitled_1 0.565
                                FSMs: [maquinaEstados-nacho]: [Exit]---------->(rollo)
                                PIE: Exit: ]---------->(rollo) at (maquinaEstados-nacho_C /Temp/UEDPIE_0_Untitled_1.Untitled_1:PersistentLevel.Character_Blueprint.maquinaEstados-nacho)
                                FSMs: [maquinaEstados-nacho]: [Enter]---------->(correr)
                                PIE: Enter: ]---------->(correr) at (maquinaEstados-nacho_C /Temp/UEDPIE_0_Untitled_1.Untitled_1:PersistentLevel.Character_Blueprint.maquinaEstados-nacho)
                                FSMs: [maquinaEstados-nacho]: [Exit]---------->(correr)
                                PIE: Exit: ]---------->(correr) at (maquinaEstados-nacho_C /Temp/UEDPIE_0_Untitled_1.Untitled_1:PersistentLevel.Character_Blueprint.maquinaEstados-nacho)
                                FSMs: [maquinaEstados-nacho]: [Enter]---------->(idle)
                                PIE: Enter: ]---------->(idle) at (maquinaEstados-nacho_C /Temp/UEDPIE_0_Untitled_1.Untitled_1:PersistentLevel.Character_Blueprint.maquinaEstados-nacho)
                                Something in your setup is calling "Set State" to your Fsm Component while no State object have been created yet... then you see the error you report about "State doesn't exist".

                                Fsm Components have a "On Initialized" Event exactly to deal with situations like this. Nothing should "Set State" until "FSM: Is Component Fully Initialized?" node (also in Fsm Component) returns "true".
                                | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                                Comment

                                Working...
                                X