Announcement

Collapse
No announcement yet.

DEVELOPERS! I have a simple question about Unreal Script.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DEVELOPERS! I have a simple question about Unreal Script.

    I need to know the command for wait or delay. I want to delay an action by 1 second. For example... when i hit a button, I want there to be a 1 second delay before its action. Is there a command? or will i have to make a timer function. Do any of you happen to have a simple timer function?

  • #2
    Technical forum pls thx
    I'm not so bad... Once you get to know me.

    Comment


    • #3
      Originally posted by Thwark
      Technical forum pls thx
      Wow... Maybe he is leaving. He doesn't even finish his sentences anymore...
      Genius is a blink before a moment of insanity.
      "Dream is Destiny"
      Waking Life

      Comment


      • #4
        nah he finished it.. you just have to learn how to speak "thwarkanese"

        Technical forum pls thx

        translation"

        Post these kinds of topics on the technical forum kewlazme you dumbass.

        Comment


        • #5
          Hmm, it always helps to know exactly what you're trying to achieve, but if you want to wait for a defined period of seconds, the Timer function is normally best.

          Comment


          • #6
            Originally posted by The_Dan
            Hmm, it always helps to know exactly what you're trying to achieve, but if you want to wait for a defined period of seconds, the Timer function is normally best.
            can you give me a simple little loops that waits 5 secs and then exits?

            I want to run a timer () in the middle of another script..so i want to call that function.. loop for 5 seconds..then exit and return to the script. I dont know UScript that good yet but ive narrowed a problem down that needs a timer and I figured its just syntax that im missing.

            Comment


            • #7
              Dispatcher owns j001
              "There's no problem that can't be solved with a big crate!"

              Comment


              • #8
                Ooh, just noticed:

                Sleep( TimeInSeconds );

                Pretty self-explanitory

                Thx to BR, for pointing that one out.

                Comment


                • #9
                  Sweet! thanks.

                  -EDIT- Im getting "Sleep is not allowed here" error. I tried putting it in an 'If' function..and outside an 'if' function. Neither of them were "allowed". Are there special areas I have to put them?
                  [code:1:0d1d098660]
                  sleep(10);
                  if(blah != None)
                  {
                  Testvariable = nochange;

                  if (blurg == None)
                  ChangedBlah();
                  sleep(4);
                  else if ( Blurg != nochange )
                  ChangedBlurg();
                  sleep(5);
                  }[/code:1:0d1d098660]

                  Thats an example of a function Im trying to use it in.

                  Comment


                  • #10
                    I always seem to get "sleep is not allowed here errors" in pubs and clubs around closing time.
                    I'm cool!

                    Comment


                    • #11
                      Hmm, I'm too tired to work out why that doesn't work, so I'll just leave this method aswell:

                      SetTimer(x , false);

                      will cause the Timer function to be called in x seconds time

                      & then use:

                      function Timer() {
                      //Script goes here
                      }


                      to define what will happen after x seconds

                      Comment


                      • #12
                        hmm.. ok ill try that method....ill keep u info'd

                        Comment


                        • #13
                          Sleep() is a latent function, which mean you can only call it from within in State code, e.g.:

                          [code:1:f66f3d70b3]
                          state DoSomething
                          {
                          function FunkyFunction()
                          {
                          // Your code here
                          }

                          function LesserFunkyFunction()
                          {
                          // Your code here
                          }

                          Begin:
                          FunkyFunction();
                          Sleep(5);
                          LesserFunkyFunction();
                          }
                          [/code:1:f66f3d70b3]

                          That will call the first function, wait 5 seconds, then call the 2nd function. Normal execution will continue while Sleep() is waiting.

                          If you're serious about unrealscripting, I suggest reading this document.
                          AI Programmer,
                          Thievery UT

                          Comment


                          • #14
                            Thanks Joelio.. yea that link is the first thing I looked at when searching for the sleep function but i just scanned thru it and didnt see any wait or sleep function mentioned so I wasn't sure what the syntax was.

                            Comment

                            Working...
                            X