weird parameter problem

hey guys i am confused as to what might be happening in this problem. I have a level selector, that has buttons to control next or back a level. in these buttons i tell it to change attribute game.levelselect to +/- 1 depending on which button you press. I also said that game.levelselect must be (>/<) (1/game.levelbeat). It works fine however until you reach the end, say game.levelbeat=3 and game.levelselect=4. If i press the next button again and then the back button it will glitch before it works on the 2nd press (a little more involved). If levelbeat=3 and levelselect=1 and i press the back button it wont go up anymore when pressing next. I dont get it because it looks like it should work even in the debugger 
thanks in advance for a solution

thanks in advance for a solution
Best Answer
-
gyroscope I am here.Posts: 6,598
Hi @pinata14
As for maxlevels being a constant, you're perfectly correct; I realised that not long after I typed it!
Glad you got it sorted. :-)""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
ill make a video after practice is done today so maybe 6 or earlier if i get a short break
sorry about the time, i have a lot on my plate right now and my comps been acting up. anyway heres the link to my video
https://www.yousendit.com/download/M3BrTkZxbEo4NVVUWThUQw
Hi @pinata14
I'm sure @tenrdrmer won't mind me answering instead; this is how I see it:
---In the back button:
When touch is pressed
When MaxLevels > 1
Change attribute game.levelselect to game.levelselect - 1
---In the forward button:
When touch is pressed
When MaxLevels < 4 -----(or whatever your max. amount of levels is)
And game.levelbeat > game.levelselect
Change attribute game.levelselect to game.levelselect + 1
---In the Start button
When game.levelselect = 1
Change Scene Level 1
When game.levelselect = 2
Change Scene Level 2
etc.,
Hope that sorts it for you.
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
thanks for the reply, but what is the max levels attribute?
also this is pretty much how i have it set up already and it doesnt work
You need a new game integer attribute added - I've called it MaxLevels - which is the maximum amount of levels in your game put in as its value. You need this to stop from advancing past your last level.
I know it's similar to what you have but there a a few minor differences which make all the difference: if I can suggest you make a new game file as a test and put together 3 buttons and your Display Text actor, you can check it out to see that it will work fine without any glitches, if you want...
Or trust me that my version will work perfectly and apply it exactly as I've put it into your game file... ;-)
Edit: oh phooey, I've gone and rejected my own answer by accident.... :-}
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
thanks for the help @gyroscope
thanks for the help @gyroscope
btw i dont get your rules... isnt maxlevels a constant? so then you cant say when its less than 4 and greater than 1 or the limits wont work. did you mean levelselect? Edit: that was supposed to be an edit
ok so i figured out why it wasnt working it was just because i had set tthe buttons to do the job when they were realeased instead of pressed so once it was released it would stay released and would some reason work until you hit the limits