We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Repeat procedure infinitely

Home Forums Puzzles Repeat procedure infinitely

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #63631
    Mariusz
    Customer

    Hi! I have a procedure that changes the cameras (and will do a few other things soon) to receive an effect of an animated intro screen. I would like that procedure to repeat infinitely (so restart each time after it’s finished). Is there a simple way to do that?

    Attachments:
    You must be logged in to view attached files.
    #63635
    kdv
    Participant

    Call the play_animation_ferry procedure after the last tweening.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #63640
    Mariusz
    Customer

    So obvious, thank you! ;)

    #63642
    Mariusz
    Customer

    Ok, and here’s another question. I need to stop this procedure completely with a button click. How this can be done?

    #63645
    kdv
    Participant

    Use some variable to control the loop

    When needed set this variable to false

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #63647
    Mariusz
    Customer

    That seems like a fine solution in some cases, thank you. But how can I stop the procedure completely, in the middle of it? In the middle of this “animation”, whenever the user clicks the button?

    #63648
    kdv
    Participant

    Check the variable state before every tweening. You are free to use conditions anywhere.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #63649
    Mariusz
    Customer

    That would be a lot of logic puzzles, especially for more complicated procedures… Isn’t there any other solution for stopping/pausing the procedure?

    #63660
    kdv
    Participant

    So what? Adding several timers is normal but adding several conditions is already a problem?

    especially for more complicated procedures

    You will be surprised how often if is used in complicated functions

    Isn’t there any other solution for stopping/pausing the procedure?

    Such a magic puzzle/command doesn’t exist. In your case (when using timeouts) the only thing you can do to interrupt the loop is checking if this or that step is allowed before it will be executed.

    Wrong

    Correct

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #63671
    Mariusz
    Customer

    I simply expected that it might be some more elegant and pure solution for this. But ok, maybe it will appear in the future. ;) Thank you for your help, it worked anyway!

    #63674
    tg
    Participant

    Hi.
    Maybe using a timer can help.

    • This reply was modified 1 year, 6 months ago by tg.
    • This reply was modified 1 year, 6 months ago by tg.
    Attachments:
    You must be logged in to view attached files.
    #63679
    tg
    Participant

    Maybe using a timer can help.

    • This reply was modified 1 year, 6 months ago by tg.
    • This reply was modified 1 year, 6 months ago by tg.
    • This reply was modified 1 year, 6 months ago by tg.
    #63683
    tg
    Participant

    Hi.
    Maybe using a timer can help.

    • This reply was modified 1 year, 6 months ago by tg.
    #63685
    tg
    Participant

    Maybe using a timer can help.

    • This reply was modified 1 year, 6 months ago by tg.
    • This reply was modified 1 year, 6 months ago by tg.
    #63688
    tg
    Participant

    Maybe using a timer can help.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.