reset scene problem

jstrahanjstrahan Member Posts: 498
edited November -1 in Working with GS (Mac)
ive got an attribute to track how long u go with out tapping screen and if its more than 20 seconds its to reset game
ive tried reset game and change scene but once it hits 20 seconds nothing happens and the game locks up

Comments

  • cbtcbt Member Posts: 644
    jstrahan said:
    ive got an attribute to track how long u go with out tapping screen and if its more than 20 seconds its to reset game
    ive tried reset game and change scene but once it hits 20 seconds nothing happens and the game locks up

    When the scene is reseted, you sure you don't get into an infinite loop of resetting scene? Check your behaviours..
  • jstrahanjstrahan Member Posts: 498
    Let me explain better

    When the game starts it plays an animation until u tap on the screen then it changes to the menu scene and I'm trying to get it to go back to the init scene after 20 seconds without pressing a menu option
    Everything works fine it counts the 20 seconds checks for any touches resets countdown if there is a touch and only performs this on the menu screen if you select options from the menu it changes the menu to the options and stops countdown and resets countdown when you go back to the menu but once the countdown reaches 20 seconds it locks up
  • jstrahanjstrahan Member Posts: 498
    Well got to start over on that feature electric just went out *stupid electric company*
    I'll try to get a video showing problem
  • jstrahanjstrahan Member Posts: 498
    ok heres the video showing problem
    when it reaches 21 seconds it changes the reset game attribute to 1 which activates rule to reset game action
    sorry theres no sound cant get mic to work when i plug it in or unplug it it shows on the mic meter but nothing while its pluged in

  • victorkin11victorkin11 Member Posts: 251
    Have you use otherwise in the rule?
  • quantumsheepquantumsheep Member Posts: 8,188
    If I'm understanding what you want to happen correctly, I'd use a different attribute to keep track of the time.

    Have a time count up to 20 on your main menu.

    When it reaches 20, have an attribute called 'startagain' - it should be a boolean.

    On your main menu, have a rule somewhere that says 'When startagain = true' go to scene 'init'.

    On your init screen, have a rule somewhere that says 'change attribute startagain to false'

    Hopefully that'll work - let us know how you get on!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • jstrahanjstrahan Member Posts: 498
    all of these attributes or scene attributes
    attributes involved:
    menu display 0 = menu shown in video
    start time real #
    check time real #
    reset game switch to reset game
    first rule
    if menu display=0
    set start time = game.time
    constrain check time = game.time-start time
    second rule
    if touch pressed reset start time = game.time this reset the countdown if u touch screen
    third rule
    if game reset = 1 ive tried (reset game action and change scene action)
    fourth rule
    if check time>20 set game reset to 1
  • jstrahanjstrahan Member Posts: 498
    if i use the reset game action shouldnt that start game over as if i had just started it and reset all attributes
  • victorkin11victorkin11 Member Posts: 251
    Not sure what the problem, but

    don't use constrain check time = game.time-start time

    you should use

    if game.time>(start time+20) set game reset to 1
  • victorkin11victorkin11 Member Posts: 251
    also reset game won't reset your attribute!
  • jstrahanjstrahan Member Posts: 498
    ok i made changes

    have invisible actor over screen with
    only three rules and three attributes

    scene attributes:
    start time real #
    reset game Boolean
    menu display int

    first rule
    if menu display=0 or actor pressed
    change start time to game.time

    this resets countdown if screen is touched or when menu shown in video is displayed

    second rule
    if reset game = true
    ive tried
    (reset game action)
    (change scene to init scene)
    (change scene to quit scene)

    third rule
    if game.time>start time+20
    change reset game to true

    still game counts to 20 changes reset game to true and locks up
  • jstrahanjstrahan Member Posts: 498
    ok good to know reset game dosent reset attributes but it wont change scenes either when the reset game condition is true
  • jstrahanjstrahan Member Posts: 498
    alright i give up going another direction done spent way too time trying to do this im just go to make a switch that will turn alpha on and off on this actor which will cover everything except man and title then have my man sit down and tap his foot or something
  • jstrahanjstrahan Member Posts: 498
    this works alot better anyway thanks for all the help
Sign In or Register to comment.