Visit the Ironworks Gaming Website Email the Webmaster Graphics Library Rules and Regulations Help Support Ironworks Forum with a Donation to Keep us Online - We rely totally on Donations from members Donation goal Meter

Ironworks Gaming Radio

Ironworks Gaming Forum

Go Back   Ironworks Gaming Forum > Ironworks Gaming Forums > Neverwinter Nights 1 & 2 Also SoU & HotU Forum
FAQ Calendar Arcade Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 06-09-2003, 10:40 AM   #1
Legolas
Jack Burton
 

Join Date: March 31, 2001
Location: The zephyr lands beneath the brine.
Age: 39
Posts: 5,459
Now I have a question.
I am finally nearing the stage where the first village of my module is completed; I have only one quest left to add before I can move on to new areas. This one gives me some trouble though.

The problem is that I can't figure out how to delay things in a script. Actions I can do, of course, and I can make creatures and conversations pause.
But I've no idea how to delay an object's creation, a creature's spawning or a journal entry update.

So far, I've been working around the problem by only updating the journal through conversations, keeping creatures in a waiting room and simply delaying the action of their jumping to a waypoint, and creating items in other people's inventories and delaying the action of giving the item to the PC. Although it works, it is not what I want to see, and it takes far more time than it should.

So my question, how do I make a simple script like this work:
Quote:
void main()
{
if(GetLocalInt(GetFirstPC(), "GVXvartspawn") == 1)
{
location lGVXvart1 = GetLocation(GetWaypointByTag("GVXvart1"));
DelayCommand(9.0, CreateObject(OBJECT_TYPE_CREATURE, "xvart1", lGVXvart1));
location lGVXvart2 = GetLocation(GetWaypointByTag("GVXvart2"));
DelayCommand(9.5, CreateObject(OBJECT_TYPE_CREATURE, "xvart2", lGVXvart2));

DelayCommand(9.6, AssignCommand(GetObjectByTag("xvart1"), ActionForceMoveToLocation(GetLocation(GetWaypointB yTag("GVXvart1D")), TRUE)));
DelayCommand(9.8, AssignCommand(GetObjectByTag("xvart2"), ActionForceMoveToLocation(GetLocation(GetWaypointB yTag("GVXvart2D")), TRUE)));

SetLocalInt(GetFirstPC(), "GVXvartspawn", 2);
}
}
Obviously it cannot be done using a DelayCommand, and an ActionWait would have nothing to do with it either.
It's annoying, even the far more limited WC3 editor has a command that pauses the execution of the script for a while.
Legolas is offline   Reply With Quote
Old 06-09-2003, 12:10 PM   #2
philip
Galvatron
 

Join Date: June 24, 2002
Location: aa
Posts: 2,101
Quote:
Originally posted by Legolas:
Obviously it cannot be done using a DelayCommand, and an ActionWait would have nothing to do with it either.
Have you tested those functions or do you just assume they don't have anything to do with it (it might be that ActionWait() on OBJECT_SELF (if it's possible you didn't say that) works)? Otherwise you could try to DelayCommand() an ExecuteScript(), IIRC I had a way to this kind of things and I never used other functions than DelayCommand() and ActionWait(). If it's an object you could try the ActionWait() and change the DelayCommand() that assign actions to the xvarts to ActionWait() and change the floating numbers so it fits in what you want. If it's not an object you could try it with executing this script on an invisible object.

I don't think there's a function to delay the script from moving further but a work-around is possible
philip is offline   Reply With Quote
Old 06-09-2003, 01:31 PM   #3
SpiritWarrior
Jack Burton
 

Join Date: May 31, 2002
Location: Ireland
Posts: 5,854
Never actually tried this specifically and I would have done it like you have, using DelayCommand...obviously it does not work here.

I'm not near the toolset right now but I can mess around with it later and see what I can find. I am sure there is a workaround to this and if I don't stumble upon it I can ask around and find someone who has...I'll let ya know.
__________________
Still I feel like a child when I look at the moon, maybe I grew up a little too soon...
SpiritWarrior is offline   Reply With Quote
Old 06-09-2003, 03:07 PM   #4
Chewbacca
Zartan
 

Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 50
Posts: 5,373
Try ActionCreate

See NWN Lexicon for more info:
http://www.reapers.org/nwn/reference/

DelayCommand only works for Action* functions.

You can also call user-defined events to fire, but thats a level of scripting I'm not at yet. [img]smile.gif[/img]
__________________
Support Local Music and Record Stores!
Got Liberty?
Chewbacca is offline   Reply With Quote
Old 06-10-2003, 01:39 AM   #5
Chewbacca
Zartan
 

Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 50
Posts: 5,373
Quote:
Originally posted by Chewbacca:
Try ActionCreate

See NWN Lexicon for more info:
http://www.reapers.org/nwn/reference/

DelayCommand only works for Action* functions.

You can also call user-defined events to fire, but thats a level of scripting I'm not at yet. [img]smile.gif[/img]
Oops, I mis-typed ActionWait only works for Action* functions, that is it wont "pause" the execution of a script. It will pause character actions like animations.

DelayCommand will work to conjure up a creature, here is an example from the NWN lexicon that is used to make skeletons out of a pile of bones in the OC. It is a heartbeat script, but if used with an invisble object that fires a destroy object on itself after it spawns its mob you can make it spawn once and the heartbeat script disappears with the invisble object.
Quote:
string sCreature = "NW_SKELWARR01";
location lLoc = GetLocation(OBJECT_SELF);
DelayCommand(0.3, ActionCreate(sCreature, lLoc));
/* ***
** The DelayCommand message above could be replaced with
** ActionDoCommand(ActionCreate(sCreature, lLoc));
*** */
__________________
Support Local Music and Record Stores!
Got Liberty?
Chewbacca is offline   Reply With Quote
Old 06-10-2003, 12:03 PM   #6
Legolas
Jack Burton
 

Join Date: March 31, 2001
Location: The zephyr lands beneath the brine.
Age: 39
Posts: 5,459
It would appear that delaying the execution of another script does indeed work. Yay
Unfortunately, that means I'll have even more miniscripts lying about. But it's small price, I guess. Thanks everyone [img]smile.gif[/img]
Legolas is offline   Reply With Quote
Old 06-10-2003, 09:37 PM   #7
SpiritWarrior
Jack Burton
 

Join Date: May 31, 2002
Location: Ireland
Posts: 5,854
Well I see you seem to have it sorted but I did talk to a friend of mine and his advice read as follows :

Quote:
I think you have to define a custom function, which might look like CreateObjectAction( -parameters- )
{
CreateObject( -same parameters- )
}

and have the rest of the script down here...
BTW, I think there's already something along the lines of CreateObjectAction, hmm, here it is: CreateObjectVoid. That one you can use in a DelayCommand, I'm pretty sure.

[ 06-10-2003, 09:39 PM: Message edited by: SpiritWarrior ]
__________________
Still I feel like a child when I look at the moon, maybe I grew up a little too soon...
SpiritWarrior is offline   Reply With Quote
Old 06-11-2003, 05:15 AM   #8
Legolas
Jack Burton
 

Join Date: March 31, 2001
Location: The zephyr lands beneath the brine.
Age: 39
Posts: 5,459
It's not just about creating objects, but doing other things like adding journal entries and the like as well. In any case, I'm happy with the delayed execute script. I've found an easy way to add all the small scripts into a larger one using LocalInts and if/else lines so there's very little standing in the way of my finishing the Greensville area (for now).
I'll have to upload the new version someday soon.
Legolas is offline   Reply With Quote
Old 06-11-2003, 05:45 AM   #9
Chewbacca
Zartan
 

Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 50
Posts: 5,373
The OC uses the OnAquireItem event handler to trigger journal entries when the character recieves an item.

AddJournalQuestEntry is the function that, well, adds a journal quest entry. Using this a journal entry can be fired by just about any script, like by a trigger or a monster dying, but I dont know if it can be delayed.

Hope this helps...good luck! [img]smile.gif[/img]

[ 06-11-2003, 05:46 AM: Message edited by: Chewbacca ]
__________________
Support Local Music and Record Stores!
Got Liberty?
Chewbacca is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Momentous events on this day Donut General Conversation Archives (11/2000 - 01/2005) 17 01-23-2003 06:11 AM
When in the course of Icewind events..... Heat Miser Icewind Dale | Heart of Winter | Icewind Dale II Forum 3 06-18-2002 06:47 PM
Zone Events? Lord Killjoy Dungeon Craft - RPG Game Maker 2 02-26-2002 03:12 AM
Order of Events Dark Savant Wizards & Warriors Forum 2 11-15-2001 04:32 PM
The events of this sad, sad day....... Jafin General Conversation Archives (11/2000 - 01/2005) 9 09-13-2001 01:09 AM


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


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved