Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Yanifska on October 27, 2013, 11:42:42 AM

Title: Debug an array
Post by: Yanifska on October 27, 2013, 11:42:42 AM
Hi there,

 I am trying to build some match 3 game as a side project, and some of my behaviors aren't consistent. I suspect my array get messed up during the game and the indexes point to the wrong objects.
I am looking for a way to display on top of each object its index in a specific array, (some time an object can belong to more than one array, but only the main array interest me).
I tried to put a gui label without success(I think I need to convert world coordinates to screen coordinates but I find it a bit cumbersome).

Do you have any easy sugestion ? Can I attach an NGUI label to an object ?

thanks
Yaniv
Title: Re: Debug an array
Post by: jeanfabre on October 28, 2013, 02:06:19 AM
Hi,

Yes, you don't even need ngui, simply use Unity gui and the action "GUiLayout begin Arey Follow Object"

bye,

 Jean
Title: Re: Debug an array
Post by: Yanifska on October 28, 2013, 08:34:00 AM
ok, thanks this should do it when I fix this bug  :P :

"You are pushing more GUIClips than you are popping"

I am using the EndAreaAction though.
It is probably because of the Array List Get Next action ( I tried with Get Next Child as well) since it's working on a simple object.
Have any idea how to apply a different label on each object in the array?

(http://i1365.photobucket.com/albums/r741/Yanifska/error_zps89b8388e.jpg)
Title: Re: Debug an array
Post by: jeanfabre on October 28, 2013, 08:43:48 AM
Hi,

 You simply need to balance your "begin xxx" and "end xxx" gui actions, and the error will go away.

using ArrayListgetnext is the way to go if you debug, and you only update when you want to make sure it's up to date. I am not sure what is the relation between your gameobjects and an array index, so I can't say for sure if other solution worth experimenting.

 Bye,

 Jean

Title: Re: Debug an array
Post by: Yanifska on October 28, 2013, 08:47:41 AM
As shown in the screenshot I have one begin and one end. It should be balanced
Title: Re: Debug an array
Post by: jeanfabre on October 28, 2013, 08:52:24 AM
Hi,

 it may be somewhere else!

bye,

 Jean
Title: Re: Debug an array
Post by: Lane on October 28, 2013, 09:50:48 AM
Sorry to ask this off-topic - Why do you have indented separators between your actions? Just curious. Looks interesting.
Title: Re: Debug an array
Post by: Yanifska on October 28, 2013, 10:22:14 AM
Hi Lane,
right click the Playmaker state editor you can choose action sequence.
It will force Playmaker to wait each action has finished before moving to the next one.
I some time use it to be sure each action complete before moving to the next one....
Title: Re: Debug an array
Post by: Yanifska on October 28, 2013, 10:24:06 AM
Jean,
could you update the GUILayout Begin Area Follow Object action so it can follow the action owner ?
Would save a lot of headache
thanks
Yaniv
Title: Re: Debug an array
Post by: jeanfabre on October 29, 2013, 02:20:36 AM
Hi,
 
Simply use the action "get owner" just before, and save it in a fsmGameObject variable, and you are safe and done. Are you using templates or subfsm?

bye,

 Jean
Title: Re: Debug an array
Post by: Yanifska on October 29, 2013, 03:16:39 AM
Ohhh.....I feel dumb now :'(
Title: Re: Debug an array
Post by: jeanfabre on October 29, 2013, 03:42:22 AM
no worries :)

bye,

 Jean