playMaker

Author Topic: [SOLVED] arrayMaker enable/disable FSM of all gameObjects  (Read 5476 times)

Anykey

  • Playmaker Newbie
  • *
  • Posts: 5
[SOLVED] arrayMaker enable/disable FSM of all gameObjects
« on: April 12, 2012, 10:22:30 AM »
Hi  :)

I'd like to know how I could disable or enable a FSM of all the gameObjects of an Array list in arrayMaker

thanks  ;)
« Last Edit: April 15, 2012, 07:11:10 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: arrayMaker enable/disable FSM of all gameObjects
« Reply #1 on: April 13, 2012, 03:48:47 AM »
Hello,

Playmaker has an action for this: https://hutonggames.fogbugz.com/default.asp?W55

Now, to go through each gameObject from an array, you can use the following package and study the distanceSorting scene.

 basically, you create an int variable to you increment and use it to get the element of an array, you work with it, then back to your incrementing state and so on until the int is out of bounds.

If you have problems understand this, let me know and I'll do a working example using your case.

Bye,

 Jean
 

Anykey

  • Playmaker Newbie
  • *
  • Posts: 5
Re: arrayMaker enable/disable FSM of all gameObjects
« Reply #2 on: April 13, 2012, 04:24:30 PM »
Thanks Jean , I've understood your explaination but actually , I finally found an easier way to do it

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: arrayMaker enable/disable FSM of all gameObjects
« Reply #3 on: April 14, 2012, 05:35:52 PM »
Care to share? :)

Anykey

  • Playmaker Newbie
  • *
  • Posts: 5
Re: [SOLVED] arrayMaker enable/disable FSM of all gameObjects
« Reply #4 on: April 24, 2012, 08:56:24 AM »
Actually , I wanted to list all the ennemies spawned and disable all their FSM to "freeze" them while I'm in the shop.

But finally , I chose to make a global bool which is put to true when I open the shop , all the ennemies have a FSM which says that when the bool is true , disable the "Move&Attack" FSM

the way I wanted to do with the list was definitely not of a good use , but eh ! I'm just a programming beginner  :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] arrayMaker enable/disable FSM of all gameObjects
« Reply #5 on: April 24, 2012, 09:17:41 AM »
Hi,

 You could also create two global events "FREEZE", and "UNFREEZE", and implement that in your enemies, and fire them as you go in and out of your shop. Then they don't need to spy on that bool all the time ( tho, I do it sometimes too, so nothing dramatic).

 Bye,

 Jean