Aller au contenu

Photo

Delay Command Variable driven?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Birdman076

Birdman076
  • Members
  • 186 messages
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.

#2
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<taking a crack...>

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

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

<...at it>

#3
Birdman076

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

#4
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#5
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<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>