Aller au contenu

Photo

[Solved] "Team Destroyed" Event Confusion


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

#1
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
I put this code among the events in my area script for the desired area:

// Team Destroyed
    case EVENT_TYPE_TEAM_DESTROYED:
{
int nTeam = GetEventInteger(ev, 0); // the team number that was destroyed.
object oJarl = GetObjectByTag("ast100_jarl");
object oPC = GetObjectByTag("genpl_astrid");
// Insert event-handling code here.
if (nTeam == 1)
{
 WR_SetPlotFlag("plt_plt_ast100_attack", BATTLE1_DONE, 1, TRUE);
 BeginConversation(oJarl, oPC);
}
if (nTeam == 2)
{
 WR_SetPlotFlag("plt_plt_ast100_attack", BATTLE2_DONE, 1, TRUE);
 BeginConversation(oJarl, oPC);
}
if (nTeam == 3)
{
 WR_SetPlotFlag("plt_plt_ast100_attack", BATTLE3_DONE, 1, TRUE);
 BeginConversation(oJarl, oPC);
}
if (nTeam == 4)
{
 WR_SetPlotFlag("plt_plt_ast100_attack", BATTLE4_DONE, 1, TRUE);
 //BeginConversation(oJarl, oPC);
}
break;
}


Yet the plot flags don't seem to set and the NPC never tried to initial dialogue. The script has been compiling properly, and seems to be exporting properly. (Each plot flag has a journal entry for the testing, and the NPC can't be killed.)

I'm wondering if someone could help me with this?

Modifié par jackkel dragon, 25 juillet 2010 - 07:50 .


#2
FergusM

FergusM
  • Members
  • 460 messages
Do the creatures in these teams have custom creature scripts? TEAM_DESTROYED is fired from EVENT_TYPE_DEATH in creature core if the creature dying is the last one left on its team.

Modifié par FergusM, 25 juillet 2010 - 04:51 .


#3
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
No creature scripts have been altered. (Should default to "creature_core," I think.) Core resource darkspawn used as the enemies.

#4
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
I just re-checked all creatures in the area, and no allied creatures have teams (-1.) No inactive creatures have the team value of "1."

#5
FergusM

FergusM
  • Members
  • 460 messages
http://social.biowar...x.php/ECLog.ini



Set script=1 in your logging .ini. Then put PrintToLog("some meaningful message"); in certain points in your code (for instance, at the start of the script, and inside each case/if statement). You can also use things like IntToString(somePlotFlag) or other things to try and diagnose the situation.

#6
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
Thanks, I'll try that. Might help with some other debugging and such.

#7
jackkel dragon

jackkel dragon
  • Members
  • 2 047 messages
Thanks for the help, FergusM. It turns out that the "plt_" prefix for including a plot in a script isn't necessary when setting plot flags from a script.

Also, I'm sure you noticed that I'm using an NPC creature as the PC. That creature has no conversation file, and so I just reversed the order of the parameters to get it to work.

I'll mark this as solved and move on to the next issue. Thanks again for the help!