Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 4ppleseed on July 09, 2015, 05:00:38 AM

Title: Turn On/Off all FSMs with a certain name/tag etc..
Post by: 4ppleseed on July 09, 2015, 05:00:38 AM
This might be better placed in feature suggestion but I'd love to be able to have a 'debug' FSM on some game objects that I can turn on/off with one click.

Is there something planned like that?
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: 4ppleseed on March 09, 2016, 09:13:52 AM
BUMP  8)
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: Alex Chouls on March 09, 2016, 02:02:14 PM
Nothing planned like that right now. Can you describe how it would work in a bit more detail?
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: 4ppleseed on March 10, 2016, 05:44:05 AM
For debugging mainly.

Lets say I'm making a multiplayer SHMUP and each spaceship and enemy has a set of FSMs attached to a child gameobject that displays it's collision boundaries and collects information on where the collisions are coming from and who fired etc.

I need this information to make sure everything is working as intended but once happy I want to be able to turn off that FSM in every object (which will make the game look better and more performant). I don't want to have to delete this debug gameobject in case I need them again later. So if I can set up a FSM that says 'Press X - deactivate all FSMs with Tag 'Debug' and Press X again turn them back on again'

Does that make sense?
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: dudebxl on March 10, 2016, 08:23:06 AM
Have you tried the action 'EnableScriptByTag' on the ecosystem?
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: 4ppleseed on March 10, 2016, 09:55:40 AM
Have you tried the action 'EnableScriptByTag' on the ecosystem?

Hi, thanks, no I hadn't seen that. What can I define by 'Script'? Is it a sting value to a named FSM?
Title: Re: Turn On/Off all FSMs with a certain name/tag etc..
Post by: dudebxl on March 10, 2016, 10:46:21 AM
The FSM on a GameObject is a script. You can enable/disable all the FSM on all GameObject (inclChildren - optional) that has x script name (string value) with y tag (and with z layers - optional).

Best to just try it out.

Edit: after some thinking.. not sure it will work if you want one FSM out of two as the FSM script names are the same.

Edit2: You should be able to hack the action to include FSM name. So script name (tag/layer filter) then filter by FSM name..