playMaker

Author Topic: producing the scene name automatically[SOLVED]  (Read 1938 times)

picsel100

  • Playmaker Newbie
  • *
  • Posts: 7
producing the scene name automatically[SOLVED]
« 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.
« Last Edit: March 05, 2014, 11:49:29 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: producing the scene name automatically
« Reply #1 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

picsel100

  • Playmaker Newbie
  • *
  • Posts: 7
Re: producing the scene name automatically
« Reply #2 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: producing the scene name automatically
« Reply #3 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

picsel100

  • Playmaker Newbie
  • *
  • Posts: 7
Re: producing the scene name automatically
« Reply #4 on: March 05, 2014, 05:53:20 AM »
oh! OMG! I understand. Thank you so much.