Aller au contenu

Photo

Start Conv on Death (Solved)


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Alupinu

Alupinu
  • Members
  • 528 messages
I’m having a little problem getting a conversation to fire. I want the conv to fire when an NPC creature dies. My script works fine if the player controlled PC kills the creature. But if any other member of the party kills the creature then the script does not fire and the conversation does not start. Here’s a copy of the script I’m trying to work with, what am I doing wrong?

//Put this script OnDeath
void main()
{
 
object oPC = GetLastKiller();
 
while (GetIsObjectValid(GetMaster(oPC)))
   {
   oPC=GetMaster(oPC);
   }
 
//if (!GetIsPC(oPC)) return;
 
object oTarget;
oTarget = GetObjectByTag("i8_sword_appearance_ipoint");
 
AssignCommand(oTarget, ActionStartConversation(oPC, "i8_sword_appearance"));
 
}

Thank you

Modifié par Alupinu, 17 juillet 2012 - 06:57 .


#2
Alupinu

Alupinu
  • Members
  • 528 messages
Good news! I think I solved the problem. Found an older script and copied some of it’s code. It seems to have solved the problem. Here’s a copy of the new working script below if anybody is curious.

//Put this script OnDeath
#include "ginc_group"
void main()
{
object oPC = GetFirstPC(FALSE); // Player's currently controled character
object oSelf = OBJECT_SELF;

object oTarget;
oTarget = GetObjectByTag("i8_sword_appearance_ipoint");

AssignCommand(oTarget, ActionStartConversation(oPC, "i8_sword_appearance"));

ExecuteScript("nw_c2_default7", oSelf);

}



#3
Morbane

Morbane
  • Members
  • 1 883 messages
Alu, you dont need the #include "ginc_group" for that script - not that it matters no harm having it there...

...also dont need object oSelf = OBJECT_SELF;  

Edit: He he you do need it :blink:

Modifié par Morbane, 17 juillet 2012 - 08:30 .