Making a static door / scripting a transistion

Hi there,
I’ve spent most of the last day struggling with this so I’m admitting defeat. While I’m sure I’m just missing something quite basic here, I cannot figure out how to make a door (a usable placeable one) scripted in such a way that when you use the door, it transports you to a waypoint on another map (the exterior to which this building is the interior of?

The setup is this: I have an exterior that links to the inside of a church with a normal door, but the exterior door opening is on an angled wall, so I placed a “Secret Door” on an angled wall placeable and am trying to link it to the outside. Not married to it being a waypoint, it can toss them to the out door too, just … for whatever reason haven’t been able to figure it out.

Any help would be appreciated, it’s kind of embarrassing I’ve figured out some heavy lifting like NUI and yet a door is kicking my posterior.

  • May
void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

object oTarget = GetWaypointByTag("ENTER_513B6");
location lTarget = GetLocation(oTarget);

if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

oTarget=GetFirstFactionMember(oPC, FALSE);

while (GetIsObjectValid(oTarget))
   {
   DelayCommand(0.0, FadeToBlack(oPC, FADE_SPEED_SLOWEST));
   DelayCommand(0.5, AssignCommand(oTarget, ClearAllActions()));
   DelayCommand(2.0, AssignCommand(oTarget, ActionJumpToLocation(lTarget)));
   oTarget=GetNextFactionMember(oPC, FALSE);
   DelayCommand(3.0, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));
   }

}

Put OnUsed. Edit as required.

FP!

2 Likes

It was indeed something small - I was assigning the JumpToLocation action to the PC, not to the waypoint. Thanks for that!

While it is efficient reusing the oTarget once you have the location, I would probably be tempted to just have a different variable name for the Waypoint and the party being transferred.

void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;

object oWP = GetWaypointByTag("ENTER_513B6");
location lTarget = GetLocation(oWP);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

object oTarget=GetFirstFactionMember(oPC, FALSE);

while (GetIsObjectValid(oTarget))
   {
   DelayCommand(0.0, FadeToBlack(oPC, FADE_SPEED_SLOWEST));
   DelayCommand(0.5, AssignCommand(oTarget, ClearAllActions()));
   DelayCommand(2.0, AssignCommand(oTarget, ActionJumpToLocation(lTarget)));
   oTarget=GetNextFactionMember(oPC, FALSE);
   DelayCommand(3.0, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));
   }
}

But I admit to being easily confused.

2 Likes

I almost made a similar comment. I’d have gone farther and either changed lTarget to lWP or used oCreature for the jumpers (and left oTarget as the waypoint). :slight_smile:

1 Like