Author Topic: Jumping to Waypoints & Removing Henchmen  (Read 374 times)

Legacy_Shigura

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Jumping to Waypoints & Removing Henchmen
« on: September 12, 2010, 11:05:47 pm »


               Hello! I've been working on a new module for a while, and normally, after a ton of trial & error, I can figure out my scripting bugs. But I just can't figure this one out! It's been bugging the heck out of me, so I decided I'd bother everyone here and ask what I should do. '<img'>

Okay, so this script is set to the "OnExit" of an area that cannot be re-entered. What is was meant to do, is it removes Skye (oSkye) and Leon (oLeon) from the PC (oPC)'s party. It then makes both Skye and Leon jump to two different waypoints(oJumpTarget, and oJumpTarget2) in the next area.

But the thing is, it removes both Skye and Leon, but only Skye goes to her proper waypoint. Leon follows the PC to their waypoint, and follows the PC around the area as if he were a henchman.

"#include "x0_i0_henchman"
void main()
{
    // Identify Skye, Leon and the PC.
    object oSkye = GetObjectByTag("Skye");
    object oLeon = GetObjectByTag("Leon");
    object oPC = GetFirstPC();
    // Remove Skye and Leon from Party.
    ClearAllActions();
    RemoveHenchman(oPC, oSkye);
    RemoveHenchman(oPC, oLeon);
     // Teleport Skye and Leon to Waypoints.
     object oJumpTarget = GetObjectByTag("Skye_After_Prologue");
     object oJumpTarget2 = GetObjectByTag("Leon_After_Prologue");
     AssignCommand(oSkye, ActionJumpToObject(oJumpTarget));
     AssignCommand(oLeon, ActionJumpToObject(oJumpTarget2));
}"

I'm thinking the reason is because Skye is first for all of the scripted actions. If this is the case, would someone be kind enough to tell me if there is a way to remove all henchies in one command?
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Jumping to Waypoints & Removing Henchmen
« Reply #1 on: September 13, 2010, 12:11:28 am »


               Leon is definitely removed from the party? It's odd that Leon would continue to follow the PC even across areas after being removed from party.



Try AssignCommand a ClearAllActions to both NPCs before removing them as henchmen and jumping them to the WP.



However, I would suggest destroying both of the NPCs and recreating them at the proper waypoints.