Author Topic: Delay Command Variable driven?  (Read 344 times)

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Delay Command Variable driven?
« on: February 21, 2012, 07:42:28 pm »


               Is there a way to have DelayCommand reference a float stored on OBJECT_SELF as the amount of time to delay?

Sorry if this is a nub question, scripting skills are still lacking quite a bit.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Delay Command Variable driven?
« Reply #1 on: February 21, 2012, 07:47:02 pm »


               <taking a crack...>

DelayCommand((GetLocalFloat(OBJECT_SELF,"fDelay")), SomeCommand());

Should work fine, though I am no place I can test it...

<...at it>
               
               

               
            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Delay Command Variable driven?
« Reply #2 on: February 21, 2012, 07:49:28 pm »


               Compiles, I think that did the trick I'll test it out after I get done putting in all the parameters. Thank you sir.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Delay Command Variable driven?
« Reply #3 on: February 21, 2012, 07:50:11 pm »


               Sure can. Something like so:

void main()
{
    float MyDelay = GetLocalFloat(OBJECT_SELF, "NAME OF FLOAT");

    DelayCommand(MyDelay, ActionToDelay);
}

Whoops. Rolo beat me to it. ':lol:'
               
               

               


                     Modifié par GhostOfGod, 21 février 2012 - 07:51 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Delay Command Variable driven?
« Reply #4 on: February 21, 2012, 08:13:58 pm »


               <frantically...>

Yeah, but I was in a hurry. I just didn't want to declare a single instance variable :-P

Your's is a *lot* easier to read/follow.  :-) <yup. neater>

<...finger-combing his beard>