lfnetwork.com mark read register faq members calendar

Thread: Delay spawning script
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-01-2012, 08:21 AM   #1
Trex
Forumite
 
Trex's Avatar
 
Join Date: Dec 2006
Location: UK
Posts: 505
Veteran Modder 
Delay spawning script

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

Code:
void main() {

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


KNIGHTS OF THE OLD REPUBLIC : THE JEDI MASTERS
PLAY THE TOTAL CONVERSION MOD NOW! . | If you're interested, my almighty fanfic can be read here.
Trex is offline   you may: quote & reply,
Old 05-01-2012, 08:42 AM   #2
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
DelayCommand only works with Actions. I mean functions like ActionJumpToLocation, etc.:

Code:
// 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);
Fastmaniac is offline   you may: quote & reply,
Old 05-01-2012, 09:53 PM   #3
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
If you don't want to use the Wait function you could always just make a separate script that fires this script through the ExecuteScript function, and then put a delay on the execute script command.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 05-03-2012, 06:11 AM   #4
Trex
Forumite
 
Trex's Avatar
 
Join Date: Dec 2006
Location: UK
Posts: 505
Veteran Modder 
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:

Code:
void main(){

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

}
Second script, named in this case spawn1v1.ncs :

Code:
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)); 
}


KNIGHTS OF THE OLD REPUBLIC : THE JEDI MASTERS
PLAY THE TOTAL CONVERSION MOD NOW! . | If you're interested, my almighty fanfic can be read here.
Trex is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Delay spawning script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:18 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.