lfnetwork.com mark read register faq members calendar

Thread: [K1] ActionPauseConversation Function
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 10-28-2007, 07:55 PM   #1
Silveredge9
Retired Modder
 
Silveredge9's Avatar
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 710
Veteran Modder Forum Veteran Hot Topic Starter Contest winner - Modding 
[K1] ActionPauseConversation Function

I've been experimenting with the ActionPauseConversation function in order to make it possible to skip certain nodes, whilst not being able to skip others.

At the certain dialogue part that I want to make unskippable, NPC's are equipped with lightsabers. So technically, the dialogue prior to this should be skippable, and the actions defined in the script below shouldn't be skippable. But for some reason I can't get it to work... And everything can be skipped.

Code:
void main()
{
ActionPauseConversation();

object oPC = GetFirstPC();
object oNPC=GetObjectByTag("taris_guy");
object oNPC2=GetObjectByTag("taris_sol1");
object oNPC3=GetObjectByTag("taris_sol2");
object oSaber = CreateItemOnObject("guy_saber",oNPC);
object oSaber2 = CreateItemOnObject("G_w_Vbroswrd01",oNPC2);
object oSaber3 = CreateItemOnObject("G_w_Vbroswrd01",oNPC3);

AssignCommand (oNPC, ActionEquipItem(oSaber, INVENTORY_SLOT_RIGHTWEAPON)); 
AssignCommand (oNPC2, ActionEquipItem(oSaber2, INVENTORY_SLOT_RIGHTWEAPON));
AssignCommand (oNPC3, ActionEquipItem(oSaber3, INVENTORY_SLOT_RIGHTWEAPON)); 

ActionResumeConversation();

}
Anybody have any ideas what the problem is? And why the dialogue isn't being 'paused'?

Silveredge9 is offline   you may: quote & reply,
Old 10-28-2007, 08:24 PM   #2
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,765
Current Game: Watch_Dogs
Forum Veteran Helpful! Notable contributor 
Man I'm getting rusty when it comes to the scripting mechanics. Have you tried putting the ActionResumeConversation in an obviously long DelayCommand call or calling a SendMessageToPC function to see whether your script is even firing?



Last edited by tk102; 10-29-2007 at 10:06 AM.
tk102 is offline   you may: quote & reply,
Old 10-28-2007, 08:40 PM   #3
Silveredge9
Retired Modder
 
Silveredge9's Avatar
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 710
Veteran Modder Forum Veteran Hot Topic Starter Contest winner - Modding 
The script is firing as the characters perform the scripted actions, it's just that the dialogue it's coupled with is skippable. :P

Silveredge9 is offline   you may: quote & reply,
Old 10-29-2007, 08:09 AM   #4
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by tk102
Man I'm rusty the scripting mechanics. Have you tried putting the ActionResumeConversation in an obviously long DelayCommand call or calling a SendMessageToPC function to see whether your script is even firing?
Like tk said you'll need to either delay ActionResumeConversation or assign an ActionWait() action to the queue of OBJECT_SELF for it to make any difference in this script, since you are manipulating the action queue of different objects. The action queue of the conversation owner in your script just looks like (in scripting terms)...
Code:
ActionPauseConversation();
ActionResumeConversation();
...while the action queue of taris_guy looks like...
Code:
ActionEquipItem(oSaber, INVENTORY_SLOT_RIGHTWEAPON)
...and the action queue of taris_sol1 looks like...
Code:
ActionEquipItem(oSaber2, INVENTORY_SLOT_RIGHTWEAPON)
...and guy_saber...
Code:
ActionEquipItem(oSaber3, INVENTORY_SLOT_RIGHTWEAPON)
So, since you aren't placing the equip actions in the same action queue as the Pause/Resume actions the resume action will not wait until the Equip actions are complete before running. It will run directly after the Pause action, since there is nothing assigned to the action queue of the dialog owner in between.

Think of the Action Queue as a sequential list of things that an object should perform in the listed order, where the next item in the list is not started until the previous one has finished. Script functions that place an action in the action queue of an object usually have names starting with Action. Each NPC and placeable in the game have their own action queue.

This differs from non-action scripting functions which are run immediately as the script executes, whereas Action functions just tell the object "do this when you get around to it" and then move on in the script. So if the object already has actions in their queue it may take a few seconds for an assigned action to be performed (unless you clear their action queue), whereas a script usually don't execute longer than a few milliseconds.


Last edited by stoffe; 10-29-2007 at 08:22 AM.
stoffe is offline   you may: quote & reply,
Old 10-29-2007, 08:31 AM   #5
Silveredge9
Retired Modder
 
Silveredge9's Avatar
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 710
Veteran Modder Forum Veteran Hot Topic Starter Contest winner - Modding 
Yes,I understand. I added an ActionWait(); of around 5ish seconds to allow time for the NPC's to perform their scripted actions within the paused dialogue timeframe, and it worked. :P

Thanks for the explanation.

Silveredge9 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 > [K1] ActionPauseConversation Function

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 04:40 AM.

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