I bought this fantastic plugin to use it in an unusual scenario with my custom nodes. I need to manually setup a network of tenths of nodes in FSM which will have the exact same transition condition which responds to an event:
if an event string argument == node.name, then perform the transition
So I started to setup those connections manually but it’s super time consuming when you have so many nodes. What I’d like to do is to write a custom connection which would already contain this condition (preferably hardcoded). I imagine that I would hold a modifier key and then drag the connection – in which case my custom connection would be made in GUI graph editor. Could someone assist me how to start and what classes should I dig to make this kind of modification?
Thanks a lot for your positive feedback!
Are you referring to altering the source code for the Editor GUI, or referring to creating some custom condition which you want to be assigned on the transitions?
If you want to alter the code so that all transitions/connections already come with a condition assigned, then probably the best way to do this, would be to open up the FSMConnection.cs and add these lines of code in the class, replacing the condition type with the type you want:
Yes, that’s exactly what I needed 🙂 I wanted to alter the editor GUI. Thanks for the hint, but in the meantime I realised it’s quite easy to copy-paste connection tasks as well so I made a custom condition task instead. It still needs some clicking but not that much.
What would really make my graph setting up much easier – would be the ability to duplicate the node (as in ctrl+d) but with maintained all the connections same as in the original node. Wow, that would be something 🙂 Could you guide me on where to start to make it happen?
Thanks!
PS. sorry for my delayed response, apparently I missed an email notification
EDIT: I tried the snippet you provided – it works great! Many thanks! Although the mentioned above copy-pasting with maintained connections feature would be super helpful as well 🙂
You are very welcome 🙂
I am glad to know that you’ve found the copy/paste between connections to be usefull!
I will take a look at your suggested feature here and see what is possible with it as well.