lfnetwork.com mark read register faq members calendar

Thread: Spawn merchants for dummies guide?
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-13-2009, 01:39 PM   #1
disbeliever
Junior Member
 
disbeliever's Avatar
 
Join Date: Dec 2008
Location: Maryland
Posts: 335
Helpful! 
Spawn merchants for dummies guide?

I am having a horrible time trying to learn how to get merchant shops to pop up in my new area.

I have gotten all of my doors to spawn fine, however when I use the same method (extracting a ut* file, modifying it, and then referencing it in the GIT file) nothing happens. Nothing shows up.

Can someone explain to me as if I have no clue, because I do not, how to get shops and merchants into my new area? I have looked at all the tutorials but none seem to help me.

Thanks
disbeliever is offline   you may: quote & reply,
Old 05-14-2009, 02:43 AM   #2
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
A merchant requires a NPC/Computer Panel file (.utc or .utp) a dialog file fired from the NPC or Panel, a script to open it fired from the dialog file, and a .utm file for the actual items in stock at that merchant.

Take a look at my Rodian Elder Merchant mod on my site, that one adds a merchant to the Elder encampment in K1 and it would be a similar process for TSL.

For making/editing an area it is the same thing just place the NPC/Computer Panel in the area and you pack the extra files in as well... a dialog for that NPC that fires a script to open your merchant .utm file.

The dialog can be as simple or intricate as you want...

Quote:
Hey pal, you wanna buy something or what?
..... Yes. (Fires Script)
..... No thanks. (End)


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 05-14-2009, 08:20 AM   #3
disbeliever
Junior Member
 
disbeliever's Avatar
 
Join Date: Dec 2008
Location: Maryland
Posts: 335
Helpful! 
Thanks I will check out your merchant mod. I am just not understanding the dynamics of what is needed to do things in kotor i think. Like what files are needed to get things to work.

Edit: So for example if I wanted to spawn your merchant in my new area just to test out how it works, what is the first step? Modify my GIT file to call one of your files, and then pack everything into my MOD file?

Last edited by RedHawke; 05-15-2009 at 02:27 AM. Reason: Combining double post...
disbeliever is offline   you may: quote & reply,
Old 05-14-2009, 05:49 PM   #4
Malxados
Rookie
 
Malxados's Avatar
 
Join Date: Feb 2009
Location: Mandalore
Posts: 221
Current Game: Warframe, SC Blacklist, KOTOR1
Sounds fine to me, if you wanted to edit the module. I'm pretty sure you could also do it via a script fired when you, say, go through a door.

As for the dynamics part, this may help you understand better.
1) You enter the area where the merchant* is. You click on him, which triggers dialog.
2) This dialog** may have several options like if you want to buy something.
3) At least one option would fire the script*** which would cause the merchant**** window to pop up, allowing you to buy/sell things

As you may see, there are several files involved:
* .utc or .utp file (like RedHawke said)

** .dlg file

*** .nss/.ncs file

**** .utm files
If you need any help with specifics, let me know.
Hope I can help


"But God demonstrates His own love toward us, in that while we were still sinners, Christ died for us." (Romans 5:8, NKJV)
"For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord." (Romans 6:23, NKJV)

Ask me about my sig!

Bao-Dur: I'll take the one who was stupid enough to threaten us instead of shoot us when he had the chance.

k_inc_force bothers me.
Malxados is offline   you may: quote & reply,
Old 05-15-2009, 02:43 AM   #5
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Quote:
Originally Posted by disbeliever View Post
Edit: So for example if I wanted to spawn your merchant in my new area just to test out how it works, what is the first step? Modify my GIT file to call one of your files, and then pack everything into my MOD file?
You would need to place the NPC .utc file reference in a location in your git in the NPC location section (forget what it is called), then pack the .utc, .dlg, start merchant script, and the .utm from my mod into your modules files.

As Mal indicated to open a merchant is a chain of events in the game involving 4 different files...
  • The NPC (.utc) or Computer Panel Placeable (.utp) that has the dialog set in it so when it is interacted with it opens the specified dialog.
  • The Dialog file (.dlg) that contains the lines you want with the information you want that when one particular selection is made by the player it fires the script to bring up the merchant window.
  • The Script (.ncs/.nss) that when run brings up the merchant window and calls the merchant file you specify.
  • The Merchant inventory file itself (.utm) that lists the available items for sale.

Your NPC or Placeable file has to be set in the proper areas of your .git if you are making a new module and all the files have to be packed into your modules .mod file.


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 05-15-2009, 06:12 AM   #6
Seamhainn
Forumite
 
Seamhainn's Avatar
 
Join Date: Jan 2006
Location: Taris, during bombardment
Posts: 633
...and you must enter the module for the very first time! Otherwise the merchant (or anything else you put anew into the .git file) will not trigger.

Good luck!


"I really had it in me to become a loser - as usual, I did not make it!" - Otto Waalkes
Seamhainn is offline   you may: quote & reply,
Old 05-15-2009, 09:01 AM   #7
R2-X2
Junior Member
 
R2-X2's Avatar
 
Join Date: Dec 2008
Location: Above Lehon
Posts: 352
Current Game: KotOR again. F*** yeah.
I've got the same problem, because my merchant script isn't working.
Could anyone post a "OpenMerchant"-Script, please?



Beep.
R2-X2 is offline   you may: quote & reply,
Old 05-15-2009, 12:42 PM   #8
Malxados
Rookie
 
Malxados's Avatar
 
Join Date: Feb 2009
Location: Mandalore
Posts: 221
Current Game: Warframe, SC Blacklist, KOTOR1
Here's one Stoffe posted:

Code:
// ST: st_startstore.nss

void main() {
	object oStore = GetObjectByTag("TAG_OF_STORE_HERE");
        object oSpeaker = GetPCSpeaker();
	
	if (!GetIsObjectValid(oStore))
		oStore = CreateObject(OBJECT_TYPE_STORE, "RESREF_OF_STORE_HERE", GetLocation(OBJECT_SELF));

	if (GetIsObjectValid(oStore))
		DelayCommand(0.5, OpenStore(oStore, oSpeaker));
}
And here's one one made using jmac7142's KotOR Script Generator
Code:
 
#include "k_inc_debug" 
#include "k_inc_utility" 
 
void main() 
{ 
    object oStore = CreateObject(OBJECT_TYPE_STORE, "Store ResRef", GetLocation(GetFirstPC())); 
    AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC())); 
}
Hope this helps


"But God demonstrates His own love toward us, in that while we were still sinners, Christ died for us." (Romans 5:8, NKJV)
"For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord." (Romans 6:23, NKJV)

Ask me about my sig!

Bao-Dur: I'll take the one who was stupid enough to threaten us instead of shoot us when he had the chance.

k_inc_force bothers me.
Malxados is offline   you may: quote & reply,
Old 05-15-2009, 05:41 PM   #9
R2-X2
Junior Member
 
R2-X2's Avatar
 
Join Date: Dec 2008
Location: Above Lehon
Posts: 352
Current Game: KotOR again. F*** yeah.
I'll give it a try. Thanks.



Beep.
R2-X2 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Spawn merchants for dummies guide?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:42 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.