How can I make something have a random delay every time?

ascomascom Member Posts: 4
edited July 2012 in Working with GS (Mac)
I have noticed that the random expression doesn't generate a random number every time. It seems to fill out all of the random expressions and doesn't regenerate a random number, even when it is called again. For example, this...
http://goo.gl/B6UGt
Changes the variable rand to the same value every time.

Could someone help? Or is it not possible?

Best Answers

  • Dazza006Dazza006 Posts: 248
    Accepted Answer
    @ascom Found this for you hope it helps
    Darren:

  • gyroscopegyroscope I am here.Posts: 6,598
    Accepted Answer

    @ascom

    It is possible to have a repeated random delay (assuming you mean repeated on a loop); here's a way I'd do it:

    Make your integer attribute, let's call it RepRand. Make a boolean and call it Toggle.

    Rule When Toggle is false
    Change attribute Toggle to true
    Change attribute RepRand to random(1,10) ---- or whatever your numbers are
    Timer: (run to completion unchecked) After RepRand seconds
    Change attribute Toggle to false

    and to interrupt it with a touch:

    Rule: When touch is pressed and Toggle = true
    Change attribute Toggle to false

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

  • SheldonkwSheldonkw Member Posts: 25
    One problem could be not having run to completion checked. I don't know what game you are making but look at that, it might be the problem
  • ascomascom Member Posts: 4
    One problem could be not having run to completion checked. I don't know what game you are making but look at that, it might be the problem
    Doesn't work.
  • ascomascom Member Posts: 4
    Oh well. I think I know why. I'm just ditching the idea since it appears to be impossible..
Sign In or Register to comment.