Can we set Area transition on Door from NPC Conversation?

The idea is to talk to an NPC and from the conversation will decide what WP transition the door will send them. I can do this from an object like a portal by changing a string variable on the portal as the WP destination from the conversation and change it to null after a short time. But this isn’t working on the door transitions.

Any suggestions on how I can change the door transition from a NPC conversation?

I farted around with SetTransitionTarget , but the lexicon didn’t give an example and I’m not even sure I’m looking in the right area. Anyhow, after too many hours, I’m conceding and asking for help.

    object oGate;
    oGate = GetObjectByTag("gate1");
    // Have us perform a sequence of actions.

    object WPDestination;
    WPDestination = GetWaypointByTag(Destination);
    SetTransitionTarget(WPDestination,oGate);

It is easy. Look at this script:

// goes into the event OnAreaTransitionClick of a door or trigger.
void main()
{
  object oPC = GetClickingObject();
  object t = GetTransitionTarget (OBJECT_SELF);
//change t here, according to the result of the conversation
  ActionJumpToObject (oPC, t);
}

You can ignore the transition target completely (but you might have one as default).

1 Like

You have the SetTransitionTarget arguments in the wrong order. Try

SetTransitionTarget(oGate, WPDestination);

To be fair, the Lexicon page does say that, though the wording could be clearer.

Normally - as in this case - the order of arguments in “set” functions is

  • object whose property is to be set
  • property value

though sadly there are exceptions.

1 Like

I’m sure the Lexicon is fine. I’m treading in waters I’m not used to and sometimes get over my head.

brilliant, thank yoU!