playMaker

Author Topic: Get/Set (property) string from a local variable not displayed on Android device  (Read 10918 times)

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi Playmaker team,

I am using NGUI (3.0.7f2) to build my UI and playmaker 1.7.5. (I am not a programmer, just a designer).
I met an issue about updating a string using get/set property with storing string as a local variable.

Before describing the "bug" reproducing steps, I have to say that my FSMs work in the Unity's Editor window and on PC platform after compiling (x86). It doesn't work only on Android platform (Android 4.0 min Api level, OpenGL ES 2.0...) ! See my first screenshot.

My goal : I want to change a string value according the name of the button I am clicking.
See the hierarchy of my example s'scene (screenshot2):

1/ I have only one label (named Biglabel, a NGUI label) centered on the screen

2/ I have a red button (named right_button_name) and another one  colored in green located at the left side. They are a NGUI colored prefab button

3/ Each button have a FSM state. At the start level, there is a Get property that store the name of the button as a string value in a local variable (left-or right-_button_name). I do this to be not dependant of the button's name.
A state 2 set the text content of the label named Biglabel thank to the previously stored string value. (See screenshot 3)

4/ So when clicking the red button for example, the big label displays "Left button name" and clicking the right button displays "Right button name" and so on...(see screenshot 4)
 
As said previously, it works in unity and when compiling for the Windows platform. But when I run the apk application, the Biglabel object is not displayed.
It works only IF I set "manually" the string in the set property action wich is not the goal i want to reach. The set string MUST be automatically based on the stored string value obtained from the previous Get property action.

Any help will be appreciated. I am really stuck on my professionnal project

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 I am not sure why it would not behave exactly the same on android...

Can you double check for any errors on android? maybe it fires an error that youcld help you rfind the source of the problem.

I would lift that problem by not using get/set property. use the action "Get name", it's meant to do exactly that.

bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi Jean,

Thanks for your quick answer. What do you mean by "double check for any errors on Android "? Does I have an option in Unity, Playmaker or Android for that ?

From my side, I am going to use the Get name action...Stay tuned  ;)

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Ok. Get name (and others like get tag)...does the trick. But I suspect wrong behavior of Get (or/and set ?) property and store string feature.
Can you give me more information about how to double check errors on an android platform ?

Thanks for your support.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Unfortunatly I am not yet set up to publish for android... I have ios, blackberry and windows... Android coming soon...

having said that, some googling gave me this:

http://answers.unity3d.com/questions/175161/debugging-android.html

http://forum.unity3d.com/threads/70197-Any-tips-for-debugging-Android

both totally untested on my end, but I guess it's a good starting point.


Bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi Jean,

I read these links but I still don't know how to debug on my samsung Tab2 tablet. :-[
Even I used "get name/tag" instead of get property/UI label to go on my work, I don' t have the choice now, I have to use "Get property/text" to get the text content of the NGUI label.
Hoping that you are now set to publish on android, can you test on your side to see if you reproduce the issue and see what happens ? Help, I am really stuck now.

Thanks,

Hlx
« Last Edit: December 27, 2013, 06:33:48 AM by hlx »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Unfortunatly not yet, Santa must have been busy with other kids... :)

I am aware this is a bit of a problem to provide support on the android front,hopefully someone else can step up that has android publishing workflow setup.


Bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi jean,

Ok, if I understand well, I have to wait an hypothetical support from the Playmaker community.
In the meantime, can you propose me an other way to get the text content of the NGUI UIlabel and store it as a sting variable ? Please help, Jean Fabre kenobi !

hlx

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 I would control the content of that ngui label up front.

How is this label defined? Can you not use the name of the gameobject instead? say if you have lots of labels, you coul dname the gameobject with a proper referencing of its label, actually exactly like its label, and then it doesn't matter if it's ngui that shows it, you just get the name of that game object.

Can you try this? else cyn you give a bit of a context so that I can think of other ways?

 Bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi Jean,

I wish you a happy new year.

Well, I know that if I am using the name instead of the content of the NGUI label, it should work (get property text Vs get name action).
But in my real case (not the example that I showed in the illustration above), I am using a collection of "buttons" with their own labels. The content of these labels change according to the menu navigation (see screenshot).
So it can be very confusing to manage the label's content based on their name as they will change at each level of the menu hierarchy.

So using the Get property text is a convenient way for me and should work on android.
Do you think this issue is coming from Playmaker or from NGUI (3.0.8.f5) ?

Thanks for your support.

hlx

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok, can you redownload the ngu package from the wiki:

 It has now two new actions, "NguiLabelSetText" and "NguiLabelGetText"

https://hutonggames.fogbugz.com/default.asp?W1111

 Bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Woaah,...many thanks Jean. I am going to test it  and give you my feedback as soon as possible.

Bye,

hlx

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Thank you, Jean ! These 2 new actions work pretty well, I am no more stuck at all.
Last question : Why this fix requires 2 more actions, I was thinking that any NGUI property could be available ? Is it a NGUI bug ?

Regards,

hlx

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 I am not yet set up for android so I can't debug it, so I don't know what's going on here at all. hence why I provided these actions so you are not stuck, but it should definitly work, you may likely no publish properly or your project has an issue somewhere else that leads to this problem, Or it could be something else, I am not ruling out any possibilties.

bye,

 Jean

hlx

  • Playmaker Newbie
  • *
  • Posts: 14
Hi Jean,

Many thanks in any case. Does my bug stays "active" until you will be able to debug for Android ? If you wish, I will provide you my sample file to help you.

Regards,

hlx