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();
}