Jump to content

Home

[K1] ActionPauseConversation Function


Silveredge9

Recommended Posts

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.

 

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'?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)...

ActionPauseConversation();
ActionResumeConversation();

...while the action queue of taris_guy looks like...

ActionEquipItem(oSaber, INVENTORY_SLOT_RIGHTWEAPON)

...and the action queue of taris_sol1 looks like...

ActionEquipItem(oSaber2, INVENTORY_SLOT_RIGHTWEAPON)

...and guy_saber...

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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...