playMaker

Author Topic: Turn On/Off all FSMs with a certain name/tag etc..  (Read 3035 times)

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Turn On/Off all FSMs with a certain name/tag etc..
« 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?

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #1 on: March 09, 2016, 09:13:52 AM »
BUMP  8)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #2 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?

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #3 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?

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #4 on: March 10, 2016, 08:23:06 AM »
Have you tried the action 'EnableScriptByTag' on the ecosystem?

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #5 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?

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Turn On/Off all FSMs with a certain name/tag etc..
« Reply #6 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..
« Last Edit: March 10, 2016, 12:24:22 PM by dudebxl »