Go to layout not working with global variable

Get help using Construct 2

Post » Sat Feb 28, 2015 2:41 pm

In my game, I have a global variable called "LEVEL." It helps me keep track of where the player is at in the game and adjust enemy strength, etc. I have the layouts numbered after the corresponding level. I have an event that says, "on button clicked, go to layout LEVEL." It doesn't work. Any idea what the problem might be? Thanks, Morgan.
Image
B
20
S
4
Posts: 382
Reputation: 2,924

Post » Sat Feb 28, 2015 3:26 pm

I believe that your problem is that the variable LEVEL is an INT and "go to layout" requires a STR.

So if your layout name is simply 1 then you can fake it and just set: go to layout "" &LEVEL
That will create a string of nothing plus your variable.
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Sat Feb 28, 2015 3:31 pm

Thank you - works perfectly!
Image
B
20
S
4
Posts: 382
Reputation: 2,924


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Kermad, Moot, R0J0hound, Robinours17 and 6 guests