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.

Party Member Talk-Fight-Talk Problem

Page: 1 of 1
 Gorgod
06-24-2011, 6:24 PM
#1
This was in my WIP, but since it's been going on for this long, I think I need to take it out of my WIP. What I'm trying to do is make the PC fight a party member, "sparring" so to speak, in a talk-fight-talk sequence. I followed this (http://www.lucasforums.com/showthread.php?s=&threadid=126615) tutorial by tk012 and Istorian wonderfully provided the following scripts as alternatives:

The second script that tk012 gave us:


void main()

{

object oNPC=GetObjectByTag("npc_tag");

//Turn on the immortality
SetMinOneHP(oNPC,TRUE);

// make NPC (Party Member) go hostile
ChangeToStandardFaction(oNPC, 1);

// give them kick to make them start attacking you
ExecuteScript("k_ai_master",oNPC,1005);
}


The OnSpawn script:


//:: k_hen_spawn01
/*
v1.0
Henchmen On Spawn In
*/
//:: Created By: Preston Watamaniuk
//:: Copyright (c) 2002 Bioware Corp.

#include "k_inc_generic"
#include "k_inc_debug"

void main()
{
//added march 10,03 by Aidan
SetIsDestroyable(TRUE,TRUE,TRUE);

GN_SetListeningPatterns();

GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006

// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ************************************************** ***************************************
}



The OnUserDefine script:


void main()
{
int nCurrentHP;
int nUser = GetUserDefinedEventNumber();
if(nUser == 1006) // DAMAGED
{
nCurrentHP=GetCurrentHitPoints();
if (nCurrentHP<10) {
CancelCombat (OBJECT_SELF);
ClearAllActions();
ChangeToStandardFaction(OBJECT_SELF, 2);

//record that we have fought
SetLocalBoolean(OBJECT_SELF,0,TRUE);

//Turn off the imortality
SetMinOneHP(OBJECT_SELF,FALSE);
object oPC=GetFirstPC();
ActionDoCommand(ActionStartConversation(oPC));
}

}

}


The conversation starts fine, however the fighting doesn't end- in other words, the after-fight conversation doesn't start. I don't know if it's any help, but here's a picture of the dialogue.

http://i51.tinypic.com/2vwbj0n.png)

Please, any help would be extremely appreciated. I really don't want to waste my summer constantly checking for help on this anymore.
Page: 1 of 1