Aller au contenu

Photo

Triggering a Conversation at Distance


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

#1
Qutayba

Qutayba
  • Members
  • 1 295 messages
I'm trying to set up a trigger that begins a conversation, the first few lines of which are overheard by the PC as he approaches and are rendered as a line-to-cutscene. The PC is not at first in "talking range," but walks up to the conversation's owner by the end of the cutscene.  So far, I haven't gotten it to work right.  Here's the trigger script: 

#include "events_h"
#include "global_objects_h"
#include "utility_h"

void main ()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    int bEventHandled = FALSE;
    switch (nEventType)
    {
        case EVENT_TYPE_ENTER:
        {
            object oCreature = GetEventCreator(ev);
            if(GetObjectActive(OBJECT_SELF)
               && IsPartyMember(oCreature))
            {
                object oTarget = GetObjectByTag("wh_comp_claire");
                CommandStartConversation(oTarget);
                SetObjectActive(OBJECT_SELF, FALSE);
                DestroyObject(OBJECT_SELF, 0);
            }
         }
         break;
    }
    if (!bEventHandled) //If this event wasn't handled by this script, let the core script try
    {
        HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
    }
}

Is the problem that the PC is too far from the NPC?  Is there some other flaw in the script?  Is there another command that can call up the conversation resource without calculating the distance between the speakers?  Would calling the intial cutscene succeed in calling the conversation it's attached to once the cutscene part was over?

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
CommandStartConversation(oTarget);

This does nothing if not paired with AddCommand. You'd be better off using UT_Talk in any case.

#3
Qutayba

Qutayba
  • Members
  • 1 295 messages
Problem solved. Thanks!



By the way, is it just me, or has the search function gone missing on the forums?