Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: picsel100 on March 04, 2014, 04:49:37 AM

Title: producing the scene name automatically[SOLVED]
Post by: picsel100 on March 04, 2014, 04:49:37 AM
I want to produce the scene name automatically using string variable.
I put the value of current scene name (Ch01_s01) into String Variable to make the next scene name (Ch01_s02).
I did it like the picture_01 , it works fine in mac.
(I made the “red” state and the “blue” state to check if it works or not)


However, when this logic goes into the iphone or android phone, it doesn't work.
The logic stops right before the bild_name state.

I used the “Set Material Color” to check if it's working, and I found out that the process stops before “Get String Right”.(see the picture_02)

and the picture_03 is the error message in Xcode console.
Title: Re: producing the scene name automatically
Post by: jeanfabre on March 04, 2014, 06:33:00 AM
Hi,

 your global variable has less than 2 characters and so it errors when it tries to get more character then the string has.

 Your problem is earlier in defining that global string variable.

bye,

 Jean
Title: Re: producing the scene name automatically
Post by: picsel100 on March 05, 2014, 12:46:17 AM
Thank you for quick response! :)

but I think you miss understood my question.
What you mean by the global variable has 2 characters?
the name is “Ch01_s02,” so I think this has 7 characters. (see picture04)

and the important thing is that the logic worked fine in Mac (the computer),
but when it goes into the mobile, it doesn’t work.

could you explain more in detail?

Thank you.
Title: Re: producing the scene name automatically
Post by: jeanfabre on March 05, 2014, 02:56:21 AM
Hi,

 Meant you scene format is "XX" for the number, and if you convert an int to a string, like 1, you will get "1" not "01".

bye,

 Jean
Title: Re: producing the scene name automatically
Post by: picsel100 on March 05, 2014, 05:53:20 AM
oh! OMG! I understand. Thank you so much.