playMaker

Author Topic: Debug an array  (Read 3615 times)

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Debug an array
« 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
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug an array
« Reply #1 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

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Debug an array
« Reply #2 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?

« Last Edit: October 28, 2013, 08:45:12 AM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug an array
« Reply #3 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


Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Debug an array
« Reply #4 on: October 28, 2013, 08:47:41 AM »
As shown in the screenshot I have one begin and one end. It should be balanced
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug an array
« Reply #5 on: October 28, 2013, 08:52:24 AM »
Hi,

 it may be somewhere else!

bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Debug an array
« Reply #6 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Debug an array
« Reply #7 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....
Visit my portfolio: http://www.yanivcahoua.com/

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Debug an array
« Reply #8 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
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug an array
« Reply #9 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

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Debug an array
« Reply #10 on: October 29, 2013, 03:16:39 AM »
Ohhh.....I feel dumb now :'(
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug an array
« Reply #11 on: October 29, 2013, 03:42:22 AM »
no worries :)

bye,

 Jean