ArtRage 5 Product PageArtRage Lite Product PageArtRage for iOS Product PageArtRage for Android Product PageArtRage  Android Oil Painter Free Product PageArtRage  Free Demos Page

Results 1 to 3 of 3

Thread: About 'Wait'

  1. #1
    Join Date
    Feb 2010
    Location
    Nevada
    Posts
    139

    About 'Wait'

    Huzzah! New forum, new question:

    Code:
    <Events>
    real rSeconds = 5.5
    
    MessageBox("constant")
    Wait: 5
    
    MessageBox("variable")
    Wait: (rSeconds)
    
    MessageBox("Finished")
    Why does the first 'Wait' directive work, but not the second?
    Cat Boxes, a web comic

  2. #2
    Join Date
    Mar 2006
    Location
    Ambient Design
    Posts
    3,839
    Actually it's that neither of them are waiting for the right amount of time.

    Firstly, the Wait: directive pauses for the amount of time since the last wait: command was started. In this case, it's the message box. So while you're reading the message box the seconds are already counting down.

    The reason for this is so stroke events happen at the rate they were recorded, not the rate they can play back on a fast or slow computer.

    To make the script work correctly you should insert a Wait: 0 immediately after the message box (which will be hit immediately), then a Wait: 5 after that:

    Code:
    MessageBox("constant")
    Wait: 0
    Wait: 5
    MessageBox("variable")
    Wait: 0
    Wait: (rSeconds)
    MessageBox("Finished")
    Unfortunately.... there's a bug in the scripting engine with Wait: (rSeconds)
    I made a late change to the way bracketted expressions are parsed, which fixed a couple of bugs and added that one. So for the moment Wait: (variable) wont work, but it will in the next build.
    With such a large update, there are bound to be some other bugs show up, so we'll be doing a point release fairly quickly to catch them.
    AndyRage's mantra for graphics engine code:
    "Sure - how hard can it be?"

  3. #3
    Join Date
    Feb 2010
    Location
    Nevada
    Posts
    139
    Quote Originally Posted by AndyRage View Post
    Actually it's that neither of them are waiting for the right amount of time.
    Ha ha, I should have known it wasn't going to be that straightforward.

    Thanks for the explanation. Very enlightening
    Cat Boxes, a web comic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •