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?
Triggering a Conversation at Distance
Débuté par
Qutayba
, févr. 04 2010 07:23
#1
Posté 04 février 2010 - 07:23
#2
Posté 04 février 2010 - 07:38
CommandStartConversation(oTarget);
This does nothing if not paired with AddCommand. You'd be better off using UT_Talk in any case.
This does nothing if not paired with AddCommand. You'd be better off using UT_Talk in any case.
#3
Posté 05 février 2010 - 12:59
Problem solved. Thanks!
By the way, is it just me, or has the search function gone missing on the forums?
By the way, is it just me, or has the search function gone missing on the forums?





Retour en haut






