Jump to content

Home

Creating a new "Merchant" (of sorts)


Teancum

Recommended Posts

I was thinking of creating a merchant on Dantooine that sells hand-made jedi robes. This would be an easy way for me to include all of the custom robes that I've downloaded without having to cheat to get them. I would say this character (probably a Quarren, since they aren't used much) would sell the robes very cheap since, as a jedi, he only does it to cover cost. I guess I should start with first things first. I've downloaded tutorials edit a merchant, and I think I understand them just fine. Now I just need to ask how to script a new merchant NPC that will always be on Dantooine no matter when you visit.

 

Thanks in advance fellas.

Link to comment
Share on other sites

You might be able to use parts of Darth333's NPC walkthrough (also known as "The 10 Step Program":)) to accomplish this. The finer points are all covered but we'll be happy to help if you get stuck.

 

Just remember that not all the forum members (or moderators) are "fellas" if she ends up stepping in to help you out :D

Link to comment
Share on other sites

If you want to spawn a custom npc on Dantoine , let's say in the courtyard (m14aa area), you would do the following:

 

1. Extract the OnEnter script for the courtyard area which is k_pdan_14a_area.ncs and rename it to what you want, per example old_14a_area.ncs

 

 

2. Use this script to spawn you merchant:

void main()
{
    object oEntering = GetEnteringObject();
    object Mymerchant= GetObjectByTag("merchant_tag");

    if (GetIsPC(oEntering))
    {
       if (!GetIsObjectValid(GetObjectByTag("Mymerchant")))
         {
//replace the coordinates by those of your merchant 
//- use the whereami cheat
       CreateObject(OBJECT_TYPE_CREATURE, "Mymerchant_template", Location(Vector(0.00, 0.00, 0.00), 0.0));

         }     
    }
    ExecuteScript("old_14a_area", OBJECT_SELF);
}[/size]

 

For more details concerning the Execute script function, see this thread.

 

Then, set a dialogue with your npc and use the following script to open up the store:

void main()
{
  object oStore = CreateObject(OBJECT_TYPE_STORE,"my_store_template",GetLocation(GetFirstPC()));
  AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC()));
}[/size]

Link to comment
Share on other sites

Thanks! I'm sure I'll have more questions as I get started on this.

 

Man, it kinda sucks being a noob all over again.:D I'm sure I'll get it down soon, though. Since this is my 4th game to edit, I'm sure it won't take to long.

 

--ok, I can't find the name of the Quarren's appearance in the UTC editor. Does anyone know the name of the original quarren NPC file?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...