kubecz3k / FiniteStateMachine

FSM plugin for Godot
MIT License
116 stars 22 forks source link

Automatically add FSM nodes to an "fsm" group? #5

Closed radicaled closed 7 years ago

radicaled commented 7 years ago

How can I add all FSM nodes (FSM2D, FSMControl, FSM3D) to an "fsm" group manually? What file or scene in the addon should I edit?

I'm trying to do some automatic debugging UI stuff in my game, and I'd like to be able to quickly find all FSMs for a node so I can grab / display their state without having to hardcore references. EG: I have a "StateDebug" node that's currently hardcoded, but I want to make it dynamically find the FSMs under its parent node.

kubecz3k commented 7 years ago

Helllo, to add all FSMs nodes to group use something like add_to_group("FSM") in init() (or better ready()) method of fsm.gd. I think I will make those nodes part of a group by default. Also it's quite probable I will work on some kind of debug visualisation in next week.

kubecz3k commented 7 years ago

Also if you will make any changes in FSM.gd make sure all the scenes where you have your fms are closed. Godot is trying to reload all the changes instantly and quite often in this situation information about graph positions is lost.

radicaled commented 7 years ago

Thanks, that is exactly what I needed to know!

I think I will make those nodes part of a group by default.

I'll leave this issue open then so you can commit against it then.

kubecz3k commented 7 years ago

Hey, in newest commit all fsms should be in FSM group. Also I have added some initial code for rendering debug info in the form of current state ID and previously used transition: fsm_debug

kubecz3k commented 7 years ago

solved by https://github.com/kubecz3k/FiniteStateMachine/commit/7e5dadeb7b5d21d14f28b28559182ac2dcd5d132