Jump to content

Home

Delay spawning script


Trex

Recommended Posts

Simple question. What's wrong with this script that I'm not seeing?

 

void main() {

DelayCommand(6.5, CreateObject(OBJECT_TYPE_CREATURE, "wav6v4", Location(Vector(39.5,-9.3,0.2), 2.3))); 
}

Link to comment
Share on other sites

DelayCommand only works with Actions. I mean functions like ActionJumpToLocation, etc.:

 

// 7: Delay aActionToDelay by fSeconds.
// * No return value, but if an error occurs, the log file will contain
//   "DelayCommand failed.".

void DelayCommand(float fSeconds, action aActionToDelay);

 

I'd suggest using ActionWait(seconds);

Link to comment
Share on other sites

Thanks for the help.

 

I ended up going with Fallen Guardian's sugeestion of executescript and it works perfectly.

 

For the purposes of those finding this thread in the future, you need two scripts. First script should looks somthing like this:

 

void main(){

DelayCommand(1.0, ExecuteScript("spawnr1v1", OBJECT_SELF));

}

 

Second script, named in this case spawn1v1.ncs :

 

void main() {

CreateObject(OBJECT_TYPE_CREATURE, "wav1v1", Location(Vector(39.5,-9.3,0.2), 2.3)); 
CreateObject(OBJECT_TYPE_CREATURE, "wav1v2", Location(Vector(39.5,-9.3,0.2), 2.3));  
CreateObject(OBJECT_TYPE_CREATURE, "wav1v3", Location(Vector(39.5,-9.3,0.2), 2.3)); 
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...