weird parameter problem

pinata14pinata14 Member Posts: 150
edited April 2012 in Working with GS (Mac)
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

Best Answer

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I can honestly say I have no idea what your problem is from the description. Maybe try making a video showing what you are trying to do.
  • pinata14pinata14 Member Posts: 150
    haha ok i was trying to explain it but it is hard lol
    ill make a video after practice is done today so maybe 6 or earlier if i get a short break
  • pinata14pinata14 Member Posts: 150
    edited April 2012
    @tenrdrmer
    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
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2012

    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

  • pinata14pinata14 Member Posts: 150
    @gyroscope
    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
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2012

    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

  • pinata14pinata14 Member Posts: 150
    haha you can reject your own answer? ill try it soon and get back to you
    thanks for the help @gyroscope
  • pinata14pinata14 Member Posts: 150
    edited April 2012
    haha you can reject your own answer? ill try it soon and get back to you
    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
  • pinata14pinata14 Member Posts: 150
    @gyroscope
    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
Sign In or Register to comment.