Aller au contenu

Photo

Trigger Conversation Script example needed (answered)


2 réponses à ce sujet

#1
Sonmeister

Sonmeister
  • Members
  • 167 messages
Does anyone have an example of a trigger conversation script they are using that I could see?

Modifié par Sonmeister, 11 mai 2010 - 04:07 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
If what you want to do is trigger a conversation from a conversation first you'll want a plot, and atatched to that plot a plot script. Make a plot flag in the plot and name it something apropriate. Then in the plot script, using an apropriate template, make a case in the action switch for your plot flag. Once you've done that, the code is fairly simple.



object oCreature = GetObjectByTag("creature_to_talk");

UT_Talk(oCreature);



You'll also have to assign the plot flag to the conversation line that you want the new conversation to fire after, most likely the end dialog node of a certain path.

#3
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
The easiest way to trigger a conversation when the player walks over a certain space is to place a talk trigger. Although you can make your own template and script, there is a generic talk trigger, gen00tr_talk.

In the area editor, go to the triggers pallet and filter for gen00tr_talk. Select that trigger, and draw it into the area. Select your trigger and look at the object inspector. Select local variables to bring up the list. Find TRIG_TALK_SPEAKER variable, and set it to the tag of the creature you want to talk.

By default talk triggers work when any party member enters them, and they work only once. If you want the trigger to fire more than once, or want it not to fire untill a particular plot variable is set, there are variables for all that as well. Make sure the conversation is assigned to the creature who will be talking. If it isn't, or can't be for some reason, there is a conversation file override variable.

You'll want the creature to be in the neutral group before the player talks to them, rather than the hostile group. To start the combat at the end of the conversation, there is a generic plot flag to turn the conversation owner hostile. I think it's under a global or generic golder, and I think the plot is gen00pt_generic_actions. The flag is owner_turns_hostile or something similar.

Modifié par DavidSims, 11 mai 2010 - 03:05 .