Jump to content

Home

Which Script?


EnderWiggin

Recommended Posts

Ok, I was looking around in the Crystal Caves on Dantooine. (danm14ae) I know that I have to rename one of them to something - ewss.ncs. I then need to write my own script with the name that i cannot find to add a character to the caves and the last line of the script has to say "run ewss.ncs."

 

Which script do I replace?

 

 

_EW_

Link to comment
Share on other sites

Hi EnderWiggin,

 

I looked at that module. There are multiple k_pdan_cryst##.ncs files there. I used FindRefs utility on k_pdan_cryst01.ncs and saw it was attached to scrysred002.utp which to me sounded like a red cystal that could be replaced. Just to make sure, I decompiled k_pdan_cryst01.ncs and sure enough, there is the CreateItemOnObject function with g_w_sbrcrstl01 as its parameter.

 

Because the source code for this .ncs isn't available you could easily hex edit the script, changing the string "g_w_sbrcrstl01" to something of identical length (your custom .uti TemplateResRef). That would work for sure.

 

If you want to try your hand at scripting, it would go something like this:

void main()
{
 object oPC=GetFirstPC();
 CreateItemOnObject( "your_uti_name", oPC);  //give crystal
 ActionStartConversation(oPC); //say that you got a crystal
 DestroyObject(OBJECT_SELF,3.0); //make the container fade away for 3 seconds
}

Save this and compile it as k_pdan_cryst01.ncs.

Link to comment
Share on other sites

Will this work once i replace the coordinates??

 

-----------------------

 

void main()

{

object oEnter = GetEnteringObject();

if (GetIsPC(oEnter))

{

// this line checks if your custom npc is already there:

if(!GetIsObjectValid(GetObjectByTag("ewssm.utc")))

{

// do a whereami cheat to get the coordinates where you want to spawn the npcs and replace the 0.00 by those coordinates:

CreateObject(OBJECT_TYPE_CREATURE, "ewssm.utc", Location(Vector(0.00, 0.00, 0.00), 0.0));

}

}

// This fires the original script that we renamed

ExecuteScript("oldcrystal1.ncs", GetModule());

}

 

----------------------

 

_EW_

Link to comment
Share on other sites

Originally posted by EnderWiggin

Will this work once i replace the coordinates??

 

-----------------------

 

void main()

{

object oEnter = GetEnteringObject();

if (GetIsPC(oEnter))

{

// this line checks if your custom npc is already there:

if(!GetIsObjectValid(GetObjectByTag("ewssm.utc")))

{

// do a whereami cheat to get the coordinates where you want to spawn the npcs and replace the 0.00 by those coordinates:

CreateObject(OBJECT_TYPE_CREATURE, "ewssm.utc", Location(Vector(0.00, 0.00, 0.00), 0.0));

}

}

// This fires the original script that we renamed

ExecuteScript("oldcrystal1.ncs", GetModule());

}

 

----------------------

 

_EW_

 

For the get object by tag function above drop the ".utc" as this should not be a part of your tag. The Tag line entry is what you should have there. so if your tag is ewssm then great if it is something like cand for canderous then it needs to be cand.

Link to comment
Share on other sites

Sorry EW, I don't know how I misread your post earlier... thought you were trying introduce a new crystal. :p Following DK's advice and your own script should work. However, I would rename the original k_pdan_cryst01.ncs to oldcrystal1.ncs and your script should be called k_pdan_cryst01.ncs.

 

And drop the .ncs extension when you refer to oldcrystal1 in the ExecuteScript function.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...