Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[K2] Dialog Faction Script

Page: 1 of 1
 Exile007
11-30-2008, 4:18 PM
#1
I've been trying to create a script that when activated NPC's fight each other during a cutscene, similar to the Matilda vs. Bastila cutscene in the Brotherhood of Shadow. My problem is, the two NPC's do start fighting, but in about a second, the dialog ends abruptly, even though the delay flag is set to six. There are also entries after that, so I don't get what's going on. :confused:

Here's my script:

#include "k_inc_generic"
void main(){

object oSith=GetObjectByTag("sith_lord");
object oJedi=GetObjectByTag("jedi");

ChangeToStandardFaction(oSith, 16);
ChangeToStandardFaction(oJedi, 17);

AssignCommand(oJedi, GN_DetermineCombatRound());
AssignCommand(oSith, GN_DetermineCombatRound());
}

Any help would be appreciated. :)

EDIT: Oh man I feel dumb, I just figured this out from looking at a couple source scripts.

You should use the ActionPauseConversation() function for this. Here's my new script for anyone who might have the same question.
#include "k_inc_generic"
void main(){

object oSith=GetObjectByTag("sith_lord");
object oJedi=GetObjectByTag("jedi");

ActionPauseConversation();

ChangeToStandardFaction(oSith, 2);
ChangeToStandardFaction(oJedi, 4);

AssignCommand(oSith, GN_DetermineCombatRound());
AssignCommand(oJedi, GN_DetermineCombatRound());

DelayCommand(8.0, ChangeToStandardFaction(oSith, 5));
DelayCommand(8.0, ChangeToStandardFaction(oJedi, 5));

ActionResumeConversation();
}
Page: 1 of 1