Aller au contenu

Photo

SOLVED: Start a conversation at the end of combat


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

#1
Bibdy

Bibdy
  • Members
  • 1 455 messages
I want to initiate dialogue with a character at the end of combat, and I know of an example in the toolset - Human Noble Origin when you fight and kill the guards in the main hall with Ser Gilmore, and browsing through the files for that Area, the triggers, the scripts, the plots, the conversations, even checking if its something to do with opening the door, but I can't for the life of me figure out how this conversation is triggered.

There isn't even a trigger on the ground in that room.

Could anyone help explain how this is done?

Modifié par Bibdy, 20 janvier 2010 - 03:14 .


#2
Bibdy

Bibdy
  • Members
  • 1 455 messages
Nobody? Image IPB

#3
Bibdy

Bibdy
  • Members
  • 1 455 messages
GREAT SUCCESS! Dissected the crap out of the Human Noble origin and created an event handler like so,



#include "utility_h"

#include "events_h"

#include "global_objects_h"



const string DLG_CHARACTER = "<character tag>";

const int ENEMY_TEAM = 1;



void main() {

event ev = GetCurrentEvent();

int nEventType = GetEventType(ev);

object oPC = GetHero();

object oChar = UT_GetNearestCreatureByTag(oPC,DLG_CHARACTER);

switch(nEventType) {

case EVENT_TYPE_TEAM_DESTROYED: {

int nTeamID = GetEventInteger(ev, 0);

switch (nTeamID) {

case ENEMY_TEAM: {



//character talks to PC

UT_Talk(oChar,oPC);

break;

}

}

break;

}

}

HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);

}




Set that script to the Area's main Script, set the team of the creatures the player fights to '1' and the tag of the creature I want to start dialogue with to whatever <character tag> is and voila!

#4
Mysticyx

Mysticyx
  • Members
  • 8 messages
Thank you!

#5
TimelordDC

TimelordDC
  • Members
  • 923 messages
Thanks. It is always helpful when people report problems and later, the solutions to those same problems.