Jump to content

Home

Merging 2 ncs files


Archonon

Recommended Posts

I was hoping someone could either help me or point me towards a tutorial which might explain this.

 

I would like to merge the content of two mods for K1 so they might be compatible, the files specifically are k_Pebn_remove.ncs and k_Pebo_skybox.ncs. Both mods have provided the nss files for these and as I understand those would be the ones I would use to merge the two. While I have some very limited experience merging 2da files (Appearance and Heads), I have never attempted to merge ncs or nss before.

 

Can I use Kotor tool for the merge? Basically my biggest problem is that if I were to open the nss or ncs files to copy the altered stuff from one into the other, I don't know exactly what it is I should be looking for. Is it as simple as 2das where I simply have to look at the bottom of the list and that's the new stuff I have to copy/paste, or is it a much more complicated process than that?

 

I saw a thread a while back merging other ncs files and there were just so many codes that needed to be ported I wasn't sure what to look for in my case. Any assistance would really be appreciated.

 

Thanks

Link to comment
Share on other sites

You'll have to use the .nss files, "redo" the script (normally it's just a matter of copying/pasting part of the content of one of the nss files to the other but not necessarily at the end of the second script... ) and then compile. It would be easier to help you if you would post the content of the two *.nss files.

Link to comment
Share on other sites

Okay, here is the information from the NSS files:

 

Mod 1 k_Pebo_skybox.nss

void main(){

   int nTest = GetGlobalNumber("TAR_CALOBARFIGHT");
   int nTest2 = GetGlobalNumber("Tar_PazNik");
   object oEntering = GetEnteringObject();
  object oPC = GetFirstPC();

vector vPosition=Vector(53.71,78.90,1.80);
location lWhereToSpawn=Location(vPosition,270.0);

 if (GetIsPC(oEntering))
{

        if  (nTest == 50)
     {

object oNPC = SpawnAvailableNPC(NPC_BASTILA, lWhereToSpawn);
     }

}
SetNPCSelectability(0,1);
SetNPCSelectability(1,1);
SetNPCSelectability(2,1);
SetNPCSelectability(3,1);
SetNPCSelectability(4,1);
SetNPCSelectability(5,1);
SetNPCSelectability(6,1);
SetNPCSelectability(7,1);
SetNPCSelectability(8,1);

ExecuteScript("k_pebo_skybox2", GetArea(OBJECT_SELF));
}

 

Mod 2 k_Pebo_skybox.nss

void main () {
object oComputer = GetObjectByTag("computerforms");

float x=50.27f;
float y=44.75f;
float z=2.50f;
float r=0.0f;
vector vecNPC=Vector(x,y,z);
location locNPC=Location(vecNPC, r);
CreateObject(OBJECT_TYPE_PLACEABLE, "computerforms", locNPC);
ExecuteScript("f_pebo_skybox",OBJECT_SELF);
}

 

Mod 1 k_Pebn_remove.nss

void main(){

   int nTest = GetGlobalNumber("TAR_CALOBARFIGHT");
   object oEntering = GetEnteringObject();
  object oPC = GetFirstPC();


 if (GetIsPC(oEntering))
{

  		 if  (nTest == 50)

   			{
      				SetGlobalNumber("TAR_CALOBARFIGHT", 60);
		        AddAvailableNPCByTemplate(0, "p_channa");
		}

  		 if  (nTest == 60)

   			{

vector vPosition=Vector(53.71,78.90,1.80);

location lWhereToSpawn=Location(vPosition,270.0);

object oNPC = SpawnAvailableNPC(NPC_BASTILA, lWhereToSpawn);


}
}

SetNPCSelectability(0,1);
SetNPCSelectability(1,1);
SetNPCSelectability(2,1);
SetNPCSelectability(3,1);
SetNPCSelectability(4,1);
SetNPCSelectability(5,1);
SetNPCSelectability(6,1);
SetNPCSelectability(7,1);
SetNPCSelectability(8,1);

ExecuteScript("k_pebn_remove2", GetArea(OBJECT_SELF));
}

 

Mod 2 k_Pebn_remove.nss

void main () {
object oComputer = GetObjectByTag("computerforms");

float x=50.27f;
float y=44.75f;
float z=2.50f;
float r=0.0f;
vector vecNPC=Vector(x,y,z);
location locNPC=Location(vecNPC, r);
CreateObject(OBJECT_TYPE_PLACEABLE, "computerforms", locNPC);
ExecuteScript("f_pebn_remove",OBJECT_SELF);
}

 

Thanks Darth333, I really appreciate all your help.

Link to comment
Share on other sites

So can anyone else tell me what I need to do to merge the files above? Do I just copy both into a new file and save and that's it? And how do I then compile it into an ncs?

 

Archonon, please do not 'bump' your threads. We do not allow them here. Thanks. -RH

Link to comment
Share on other sites

Are you wanting to edit them in anyway or literally just merge them together so they both work at the same time? If it's the latter you can just use the Execute Script function

ExecuteScript("[b]BLAH_BLAH[/b]",OBJECT_SELF);

As far as I know you can use that as many times as you want in one script.

 

--Stream

Link to comment
Share on other sites

Yup just merge them so that both mods work together. I know I have to merge them in their nss files and then recompile them into ncs. What I'm not entirely sure is if I have to copy all information from both files and recompile them or if there are specific parts of each I need to put together only.

 

Then I need to find out how to recompile the merged files into an ncs; I pressume this might be with kotor tool...?

 

Thanks Deadly Stream, appreciate the response.

Link to comment
Share on other sites

No problem mate, just try using the scripts as they are and at the bottom of every one, before the } add the execute script function, that's the quickest and easiest way - if they don't want to work together as they are the game will find a way of telling you.

 

--Stream

Link to comment
Share on other sites

So can anyone else tell me what I need to do to merge the files above? Do I just copy both into a new file and save and that's it? And how do I then compile it into an ncs?

 

You copy/paste the relevant parts of each script into a script in a position so that the different script commands don't interfere with the intended working of each other. Something like:

 

k_Pebo_skybox.nss:

void main() {
   int nTest              = GetGlobalNumber("TAR_CALOBARFIGHT");
   int nTest2             = GetGlobalNumber("Tar_PazNik");
   object oEntering       = GetEnteringObject();
   object oPC             = GetFirstPC();
   vector vPosition       = Vector(53.71,78.90,1.80);
   location lWhereToSpawn = Location(vPosition,270.0);

   if (GetIsPC(oEntering)) {
       if  (nTest == 50) {
           object oNPC = SpawnAvailableNPC(NPC_BASTILA, lWhereToSpawn);
       }
   }

   if (!GetIsObjectValid(GetObjectByTag("computerforms"))) {
       location locNPC  = Location(Vector(50.27, 44.75, 2.50), 0.0);
       CreateObject(OBJECT_TYPE_PLACEABLE, "computerforms", locNPC);   
   }

   SetNPCSelectability(NPC_BASTILA, TRUE);
   SetNPCSelectability(NPC_CANDEROUS, TRUE);
   SetNPCSelectability(NPC_CARTH, TRUE);
   SetNPCSelectability(NPC_HK_47, TRUE);
   SetNPCSelectability(NPC_JOLEE, TRUE);
   SetNPCSelectability(NPC_JUHANI, TRUE);
   SetNPCSelectability(NPC_MISSION, TRUE);
   SetNPCSelectability(NPC_T3_M4, TRUE);
   SetNPCSelectability(NPC_ZAALBAR, TRUE);

   ExecuteScript("k_pebo_skybox2", GetArea(OBJECT_SELF));
}

 

k_Pebn_remove.nss:



void main(){
   int nTest        = GetGlobalNumber("TAR_CALOBARFIGHT");
   object oEntering = GetEnteringObject();
   object oPC       = GetFirstPC();

   if (GetIsPC(oEntering)) {
       if (nTest == 50) {
           SetGlobalNumber("TAR_CALOBARFIGHT", 60);
           AddAvailableNPCByTemplate(NPC_BASTILA, "p_channa");
       }
       else if (nTest == 60) {
           location lWhereToSpawn = Location(Vector(53.71,78.90,1.80), 270.0);
           SpawnAvailableNPC(NPC_BASTILA, lWhereToSpawn);
       }
   }


   if (!GetIsObjectValid(GetObjectByTag("computerforms"))) {
       location locNPC = Location(Vector(50.27, 44.75, 2.50), 0.0);
       CreateObject(OBJECT_TYPE_PLACEABLE, "computerforms", locNPC);
   }

   SetNPCSelectability(NPC_BASTILA, TRUE);
   SetNPCSelectability(NPC_CANDEROUS, TRUE);
   SetNPCSelectability(NPC_CARTH, TRUE);
   SetNPCSelectability(NPC_HK_47, TRUE);
   SetNPCSelectability(NPC_JOLEE, TRUE);
   SetNPCSelectability(NPC_JUHANI, TRUE);
   SetNPCSelectability(NPC_MISSION, TRUE);
   SetNPCSelectability(NPC_T3_M4, TRUE);
   SetNPCSelectability(NPC_ZAALBAR, TRUE);

   ExecuteScript("k_pebn_remove2", GetArea(OBJECT_SELF));
}

 

(I added a check to see if the placeable already exists, which was missing from the second scripts, essentially causing the game to spawn a new placeable at the same location every time the player entered the area. Enter the area 20 times, and you have 20 placeables stacked in the same location :))

Link to comment
Share on other sites

Thank you for all the help stoffe and again Deadly Stream!!

 

The problem for me is figuring which parts are relevant and which not; looking at these entries I might as well be trying to read ancient Babylonian. :D

 

I really appreciate the assistance. Thanx :thmbup1:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...