Jump to content

Home

Making a NPC vanish in one module and reappeare in another


Seamhainn

Recommended Posts

Hello!

 

I want to restore the Echani Mercenary on Manaan. My investigations hint that he can be met in the hotel in Ahto City. So I implement him in the game with the .git file in said module.

 

His dialogue suggests that he can later be met in the Mercenary Enclave again. So, depending on the variable MAN_PLANET_PLOT, the NPC has to vanish from the module he originally was positioned in and reappeare in another module at a certain position (when the PC returns successfully from the Hrakerth Reef).

 

How can I do that? Thanks for any help!

 

Take care

Link to comment
Share on other sites

This script should go to line, where NPC vanish:

void main() {
DestroyObject(GetObjectByTag("tag of NPC that should vanish"));
}

Later, to OnEnter script of module he should re-appear, add this:

if(GetGlobalNumber("MAN_PLANET_PLOT")==x) { //Change x into any number
CreateObject(OBJECT_TYPE_CREATURE,"resref of NPC", Location(GetWaypointByTag("tag of waypoint"));
}

 

Hope it's understandable :)

Link to comment
Share on other sites

Where can I find the OnEnter scripts for manm26aa and manm26ae?

 

In .are file of module there should be field "OnEnter script" (or something like that, I don't have an access to my computer for now). There's the name of script. If you don't have anything in this field, just make new script and put it name to .are file. If there's something, you have to decompile OnEnter script of module and edit this.

Link to comment
Share on other sites

Okay, I have this OnEnter script:

 

void main() {  object oEntering = GetEnteringObject();
 object oPC=GetFirstPC();
 if (GetIsPC(oEntering))
     {
   if (GetGlobalBoolean("MAN_ECHANIR_DONE")) {
       vector vPos;
       float fAngle;

       vPos.x = 38.00; 
       vPos.y = 5.00; 
       vPos.z = 27.00;
       fAngle = 0.0; 

       CreateObject(OBJECT_TYPE_CREATURE, "man26_echmerc2", Location(vPos, fAngle));

      }

    ExecuteScript("k_pman_26a_area", OBJECT_SELF); 	
    }

}

 

Obviously I only want one man26_echmerc2, and so want the script executed only once. Unfortunately I can't set ECHANIR_DONE to FALSE, as it is used elsewhere in the game also. How can I make it that the script is only executed once?

 

Thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...