Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: _adamturnbull on May 09, 2014, 10:51:37 AM

Title: Get Level Num?
Post by: _adamturnbull on May 09, 2014, 10:51:37 AM
Hi,

Is there a way to get the level number and store it as a variable. I know you can load level by number but I haven't found a way to get the level number.

Cheers,
Adam
Title: Re: Get Level Num?
Post by: jess84 on May 09, 2014, 10:55:06 AM
There's an action called "Level Name to String" which will save the scene name. I think it was a custom action that I found on the forum - either in the Share New Actions or Action Requests.
Title: Re: Get Level Num?
Post by: _adamturnbull on May 09, 2014, 01:17:53 PM
Thanks, I have that. I was looking to get the level number rather than the name if possible :)

Cheers,
Adam
Title: Re: Get Level Num?
Post by: jess84 on May 09, 2014, 01:43:23 PM
How do you have your levels named/numbered?

Is it 'one scene is one level'?

You could always then use the level name string and then use 'Get String Right' and get the digits that you want from the end of the scene name and save that as an int.

Isn't Load Level Number dependant on the order of scenes that you have in your build settings? It'd probably be more efficent/safe to use Load Level and use a variable, just incase anything changes, then it won't break.
Title: Re: Get Level Num?
Post by: _adamturnbull on May 09, 2014, 01:54:08 PM
Ok cheers, Jess! I might just go with that technique instead :)