Jump to content

Home

A question about npc.


Darth Balor

Recommended Posts

Here you go, i had to use this script for my Kreia's Mechanical Hand mod:

 

void main()
{  
 	      object oNPC = GetObjectByTag("[color=red]Kreia[/color]");
 	      ChangeObjectAppearance(oNPC, [color=green]455[/color]);
}

 

Change Kreia to the tag of the NPC's appearance you want to change, then replace 455 with the line in the appearance.2da witch you want to use. Then attach it to your .dlg and that should work!

 

Hope this helps :D

Link to comment
Share on other sites

Ok i found it for you, the name in the appearance.2da is Unique_Darth_Traya and the line number is 491, here is the script for you, all you have to do is change the tag of the npc you want the appearance of:

 

void main()
{  
 	      object oNPC = GetObjectByTag("Kreia");
 	      ChangeObjectAppearance(oNPC, 491);
}

 

Tell me if you need any more help! :)

Link to comment
Share on other sites

That would be Atton's small dialog that tells you that Kreia has left either with the Handmaiden if you a male, or just gone if you a female.

 

I have looked though the .dlg's and cannot find it, I'm not sure where the .dlg is, but i know that is the last .dlg before you leave the Ebon Hawk after the Dantooine rebuilt enclave.

Link to comment
Share on other sites

scripts are fired from the start of the module by a part of the ARE that says "OnEnter" the name of the script for the Ebon Hawk varies as there are 7 Ebon Hawk Modules.

For 001EBO it is called "a_bet3m4.ncs"

 

Why thank you, everyone here is so helpful! Hypothetical: A script needs to be fired right after the scene where kreia helps atris fall, what would need to edited to do so.

Link to comment
Share on other sites

scripts are fired from the start of the module by a part of the ARE that says "OnEnter" the name of the script for the Ebon Hawk varies as there are 7 Ebon Hawk Modules.

For 001EBO it is called "a_bet3m4.ncs"

 

Keep in mind that the Area's OnEnter script isn't an "onLoad" script; it fires at the start of a module since the player character enters the area at that time. This is not the only time this script fires though. It is run any time a creature (not necessarily the player or a party member, could be any NPC or monster) is spawned into the area, when the player enters the area, or when the player loads a savegame that was made in that area (multiple times if you have party members with you).

 

The module itself has an OnModuleLoad event (set in module.ifo) that only fires once when the module is loaded. Though if you use that keep in mind that the player character has not been loaded into the area yet while it is running, so GetFirstPC() will return OBJECT_INVALID if you run that function in this script (unless you delay it, but that's a risky approach since you could get different results depending on how fast the computer you're playing on is).

 

Hypothetical: A script needs to be fired right after the scene where kreia helps atris fall, what would need to edited to do so.

 

You'll need to edit the a_kreatris script found in the 262TEL module. Case 8 in this script is run at the end of that scene, when Kreia leaves the chamber and the two Handmaidens run up the ramp. The script looks like this:

// ST: a_kreatris.nss (262TEL_s.rim)

void SwitchToHandmaiden() {
   SwitchPlayerCharacter(NPC_HANDMAIDEN);
}

void StartHandmaidenScene() {
   CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden012", GetLocation(GetWaypointByTag("sp_sis_sisend1")));
   CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden013", GetLocation(GetWaypointByTag("sp_sis_sisend2")));
   CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden014", GetLocation(GetWaypointByTag("sp_sis_sisend3")));
   CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden014", GetLocation(GetWaypointByTag("sp_sis_sisend4")));
   CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden014", GetLocation(GetWaypointByTag("sp_sis_sisend5")));

   DelayCommand(0.2f, AssignCommand(GetPartyLeader(), ActionJumpToObject(GetWaypointByTag("sp_hand_sisend"))));
   SetMinOneHP(GetPartyLeader(), TRUE);
   AssignCommand(GetPartyLeader(), ClearAllActions());
   AssignCommand(GetPartyLeader(), ActionStartConversation(GetPartyLeader(), "sisend"));
}

void SpawnFinalAtris() {
   CreateObject(OBJECT_TYPE_CREATURE, "n_darthtraya001", GetLocation(GetWaypointByTag("sp_traya")));
}

void main() {

   int nParam1 = GetScriptParameter(1);

   object oAtris   = GetObjectByTag("Atris");
   object oKreia   = GetObjectByTag("KreiaEvil");
   object oDrone1  = GetObjectByTag("Sister1");
   object oDrone2  = GetObjectByTag("Sister2");

   switch (nParam1) {
       case 0:
           AssignCommand(oKreia, ActionMoveToObject(GetWaypointByTag("wp_kreia_end2")));
           break;
       case 1:
           AssignCommand(oKreia, ActionMoveToLocation(GetLocation(GetWaypointByTag("wp_kreia_ending"))));
           AssignCommand(oKreia, ActionDoCommand(SetFacing(GetFacing(GetWaypointByTag("wp_kreia_ending")))));
           break;
       case 2:
           AssignCommand(oKreia, SetFacing(90.0f));
           break;
       case 3:
           AssignCommand(oKreia, ActionMoveToObject(GetWaypointByTag("wp_kreia_end")));
           break;
       case 4:
           SetLockOrientationInDialog(oAtris, TRUE);
           SetLockOrientationInDialog(oKreia, TRUE);
           AssignCommand(oKreia, SetFacing(270.0f));
           break;
       case 5:
           SetGlobalFadeOut(1.0f, 2.0f);
           break;
       case 6:
           AssignCommand(oKreia, ActionJumpToObject(GetObjectByTag("wp_pc_end")));

           CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden003", GetLocation(GetObjectByTag("sp_hand_kreia1")));
           CreateObject(OBJECT_TYPE_CREATURE, "p_handmaiden004", GetLocation(GetObjectByTag("sp_hand_kreia2")));

           DestroyObject(oAtris);      
           break;
       case 7:
           AssignCommand(oKreia, ActionMoveToObject(GetObjectByTag("wp_atris_2")));
           SetGlobalFadeIn(0.1f, 2.0f);
           break;
       case 8:
           AssignCommand(oDrone1,  ActionMoveToObject(GetObjectByTag("wp_hand_kreia1"), TRUE));
           AssignCommand(oDrone2,  ActionMoveToObject(GetObjectByTag("wp_hand_kreia2"), TRUE));
           AssignCommand(oKreia,   ActionMoveToObject(GetObjectByTag("wp_atris_3")));

           SetGlobalFadeOut(0.1f, 2.0f);

           DelayCommand(4.0, DestroyObject(oDrone1));
           DelayCommand(4.0, DestroyObject(oDrone2));

           if (IsAvailableCreature(NPC_HANDMAIDEN)) {
               SetNPCSelectability(NPC_HANDMAIDEN, TRUE);
               DelayCommand(4.0, SwitchToHandmaiden());
               DelayCommand(5.0, StartHandmaidenScene());
               DelayCommand(5.5, SetGlobalFadeIn(0.1f, 2.0f));
               DelayCommand(8.0, DestroyObject(oKreia));
           }
           else {
               DelayCommand(5.0, SpawnFinalAtris());
               DelayCommand(6.0, SetGlobalFadeIn(0.1f, 2.0f));
               DelayCommand(10.0f, DestroyObject(oKreia));
           }
           break;
   }           
}

Link to comment
Share on other sites

So to get it to fire my custom script would the script need to actually be added to the one you posted?

 

That depends on what your script is supposed to do. If it only changes/adds some things to the area, or something like that that doesn't take any time, you can just Execute your script from within case 8. If, however, your script is running a cutscene or something that needs to take time (or transitions to other areas) then you'll need to modify the a_kreatris script to fire your scene instead of the Handmaiden/Atris/Player scene it normally leads to.

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...