playMaker

Author Topic: Using Template creating weird errors  (Read 2172 times)

joduffy

  • Full Member
  • ***
  • Posts: 121
  • Here to help
    • Online Playmaker Courses
Using Template creating weird errors
« on: July 27, 2014, 04:01:25 AM »
Hi Guys,

I have issues with using templates in the past. I found that reusing some FSMS that I make within the same project can cause states to become stuck and not work correctly even though the original one works fine. So in the past I would delete the fsm and remake it all again and it would work.

I have now created a system of FSMS using finished transitions and broadcast event actions; but the strange thing is that it works for one scene and not another. I would rather not have to manual go through the process of recreating the fsm as its just tedious work.

For example, with the broadcast even action, if I put a delay of 0.1 seconds on it. It will work. I don't need to do this for another scene so I am just wondering if anybody has come across a solution to do.
- Jonathan

Online Playmaker Courses available at:
http://courses.jonathanoduffy.com

“I want the world to be a better place because I was here.”  -  Will Smith

szomaza

  • Sr. Member
  • ****
  • Posts: 253
Re: Using Template creating weird errors
« Reply #1 on: November 29, 2014, 05:12:06 AM »
Templates are really powerful, I use them a lot but unfortunately keep running into weird bugs, like for example:
- you make an FSM, with X number of states and connections, then save it as a template and use it on a bunch of objects,
- all is good,
- then you go and edit the template and add or remove states connections, then when you run the game now you can see the OLD FSM with the X number of states and connections in the playmaker editor on the object before the FSM is run. (object is disabled)
Then when you enable the object and the FSM is run it messes the playmaker editor up a bit, but if you switch to and back then you can see the new updated FSM.

szomaza

  • Sr. Member
  • ****
  • Posts: 253
Re: Using Template creating weird errors
« Reply #2 on: November 29, 2014, 05:32:02 AM »
Another example of the above bug that happens to me:
- create an FSM template that has no global events,
- put it on an object, test, works, no problem,
- then modify the FSM template by adding a global event to it,
- now when you go to another FSM and try to send an event by using the "Send Event" action you can't because the newly added global event does not appear in the drop down list.
- You can of course use a "Send Event By Name" and specify the global event with it's name, then when running and testing it will work.

But similarly to the previous example if the object with this modified FSM template is disabled at start, then you can observe that at first, in the playmaker editor you can see the previous version (the one you created the template FSM with) of the template FSM there. Then when the object becomes activated and the global event is called, the new up to date version of the FSM appears, messing up the playmaker editor a bit.

I hate this uncertainty! Not being sure that I can trust the tool that it will do what I specified. ARGH!!!!

szomaza

  • Sr. Member
  • ****
  • Posts: 253
Re: Using Template creating weird errors
« Reply #3 on: November 29, 2014, 06:11:39 AM »
Then if I take the contents of a template FSM and create a new template FSM out of it and also change the global event it was using then after that the new event appears in the list of global events in a "Send Event" action, so "Send Event By Name" is not needed anymore.

But yeah, for how long will this keep on working? I am not sure.
Probably until I go in and edit the template FSM again.
(But that is one of the main reason I use templates, so I can modify them in one place and don't have to do it on every similar object, one by one, if I was not using template FSMs but individual local unique FSMs.)

Hope my lengthy explanation of the bug sparks some clear solution idea to solve this and improve this part of the Playmaker tool.

br,
szomaza