Aller au contenu

Photo

Conversation won't fire from this script and I'm stumped.(RESOLVED)


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

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
It is placed on a trigger.  I double-checked all tags.  It is a SP so I used GetFirstPC() for the player, but if there is a better way, I'm open to suggestions.


//put on the triggers at the end of the arcane labrynth.
void main()
{
FloatingTextStringOnCreature("worked",GetFirstPC());
object oEnter = GetEnteringObject();
object oPC = GetFirstPC();
object oTrebor = GetObjectByTag("213_trebor");
object oPCTrigger = GetObjectByTag("213_tgr_pc_golem");
object oTreborTrigger = GetObjectByTag("213_tgr_trebor_golem");
object oPCGolem = GetObjectByTag("213_pc_golem");
object oNPCGolem = GetObjectByTag("213_npc_golem");
string sEnter = GetTag(oEnter);
DelayCommand(1.0,DestroyObject(oPCTrigger));
DelayCommand(1.0,DestroyObject(oTreborTrigger));
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oTrebor,ClearAllActions(TRUE));
AssignCommand(oPCGolem,ClearAllActions(TRUE));
AssignCommand(oNPCGolem,ClearAllActions(TRUE));

if (GetIsObjectValid(oTrebor))
  {
  FloatingTextStringOnCreature("oTrebor Valid",GetFirstPC());
  }
  
  
if (GetIsObjectValid(oPCGolem))
  {
  FloatingTextStringOnCreature("oPCGolem Valid",GetFirstPC());
  }
  
if (GetIsObjectValid(oNPCGolem))
  {
  FloatingTextStringOnCreature("oNPCGolem Valid",GetFirstPC());
  }
  
  
  
if (sEnter=="213_pc_golem")
 {
 FloatingTextStringOnCreature("pc golem fired",GetFirstPC());
// AssignCommand(oEnter,ClearAllActions(TRUE));
 DelayCommand(2.0,AssignCommand(oPC,ActionStartConversation(oPC,"213_won_labrynth",FALSE,FALSE,TRUE)));
 }
 
if (sEnter=="213_npc_golem")
 {
  FloatingTextStringOnCreature("npc golem fired",GetFirstPC());
// AssignCommand(oEnter,ClearAllActions(TRUE));
 DelayCommand(2.0,AssignCommand(oPC,ActionStartConversation(oPC,"213_lost_labrynth",FALSE,FALSE,TRUE)));
 }
 
 
 
}
 

Modifié par M. Rieder, 10 janvier 2012 - 04:01 .


#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Are you destroying the trigger before the conversation is supposed to start?
In general, I don't like to destroy plot-critical objects, especially things like triggers that can't be respawned. You can just set an integer on them to deactivate them.

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
It started working when I commented out the lines where I destroy the trigger.

#4
MasterChanger

MasterChanger
  • Members
  • 686 messages

M. Rieder wrote...

It is placed on a trigger.  I double-checked all tags.  It is a SP so I used GetFirstPC() for the player, but if there is a better way, I'm open to suggestions.
 


Is something going to be entering the trigger other than the PC or companions? Do you want this to fire for random NPCs entering the trigger? The only way you would need to have GetFirstPC is if you want the trigger to be fired by a creature with no association to the PC.

#5
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
If you just set the delay in the destroy object command to something greater than the 2.0 delay in the start conversation command, it should work. I just don't like deleting things like this, because it makes it harder to revert back to an earlier quest state using the console or other debug tools.

As for MC's point, for plot triggers like this I usually have a line at the beginning like this:

if (GetEnteringObject() != GetFirstPC()) {return;}

But I think a more proper way to do is to check it against the player's currently controlled character. In this case, though, it seems that the trigger is tripped by an NPC, one of the two (racing?) golems, so the point is moot.