Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: hlx on December 16, 2013, 06:44:02 AM

Title: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on December 16, 2013, 06:44:02 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on December 16, 2013, 07:24:09 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on December 16, 2013, 08:01:45 AM
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  ;)
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on December 16, 2013, 08:31:28 AM
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.
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on December 16, 2013, 12:53:41 PM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on December 27, 2013, 06:32:14 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on December 28, 2013, 02:56:07 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on December 28, 2013, 04:21:01 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on December 30, 2013, 07:03:33 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 07, 2014, 04:09:20 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on January 10, 2014, 05:38:32 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 10, 2014, 05:54:38 AM
Woaah,...many thanks Jean. I am going to test it  and give you my feedback as soon as possible.

Bye,

hlx
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 12, 2014, 04:17:13 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on January 13, 2014, 06:12:22 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 13, 2014, 06:55:28 AM
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
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on January 14, 2014, 07:32:30 AM
Hi,

 If you have reported a bug using the PlayMaker bug reporting tool, yes it will be tracked, else I will likely forgot...

Bye,

 Jean
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 16, 2014, 09:05:46 AM
The bug report is done now. But...

Now, I have a similar issue about the populist NGUI component.

What I am doing : From a dropdown list, I store the chosen selection (a string as username) via the UIpopupList objectype as a global variable. This one is used to change the sprite.name property of a UIsprite. So the User s' texture (thumbnail) is automaticaly updated when the string changes. (see screenshot)

It works correctly in the editor and as a Windows application but not when it is compiled for android.

What do you think about that ? Could you give me  a workaround for this issue ?

Thanks,

Hlx
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 20, 2014, 11:57:40 AM
Hi,

Jean, someone,...?
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: Lane on January 20, 2014, 11:59:46 AM
Jean is likely on vacation or something, haven't seen him around since the 14th.
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 20, 2014, 12:03:57 PM
ok, thank you Lane.

hlx
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: jeanfabre on January 21, 2014, 03:37:15 AM
Hi,

 I am being watched :)

Yeah, sorry guys, difficult time between holidays and travelling. I am back home now, so I expect to get back to normal speed.

I am fighing with Windows atm, so I don't expect tackling Android until I can properly work for Windows store and windows phone, what a pain windows is... I am not a mac fan, but the experience just to update to 8.1 is a joke and now visual studio 2013 fails to install with very limited information on what exactly is goind wrong... pain!


bye,

 Jean
Title: Re: Get/Set (property) string from a local variable not displayed on Android device
Post by: hlx on January 21, 2014, 11:34:01 AM
Good luck Jean. I stay tuned.

hlx