Modding Help Two questions about custom merchant npcs

Discussion in 'Starbound Modding' started by vernadead, Dec 19, 2013.

  1. vernadead

    vernadead Big Damn Hero

    First, determining race and selling the right things, like if I have a type of merchant

    "apexmerchant" : [
    [0, [
    { "item" : { "name" : "apexitem1" }, "cost" : 250 },
    { "item" : { "name" : "apexitem2" }, "cost" : 50 }
    ]]
    ],

    How do I tell the game this merchant needs to be apex?

    Secondly, can merchant npcs have quests?
     
  2. vernadead

    vernadead Big Damn Hero

    Do I need to do anything special to have a merchant sell things connected to its race?
     
  3. Malicante

    Malicante Phantasmal Quasar

    As I've learned, making a merchant is a bit extensive depending on how you intend to get them into the game. I think I can best explain it with an example: The Stims spawner.

    1. Race is set at the bottom of nameofmerchant.object, as is the type of npc. For example, if I set a stim merchant to "type" : "chefmerchant" , the game would look for a chefmerchant.npctype file, which has his hellos and goodbyes, what he's equipped with, and a line called "Catagories" with a "numitems" beneath that . The words in the "s are what store(s) he runs out of the merchant.npctype file.

    The pirate quartermaster has 2 items in "catagories" : "randomguns" and "randomswords". if you find those shop names in the merchant.npctype, it lists what they sell, and at what price. Now if you set a shop to be named "apexrecipes" and added recipes to it, then added that to the npctype file for that merchant, he would sell items form all catagories he's listed to sell things from.

    I hope this helps you and doesn't confuse you too much. If you want I will send you a small slice of my WIP mod, and you can understand it better.
     
  4. vernadead

    vernadead Big Damn Hero

    What if objects do not fit into vanilla catagories?
     
  5. Malicante

    Malicante Phantasmal Quasar

    Well, then you can do what I did: make new catagories! If you'd like a sample of what you can do, I'm uploading a (simple) copy of my Merch.NPCTYPE (it's where my shop data comes from, a copy+ edit work of merchant.NPCTYPE) and my musician files, so you can get an idea of what you can do.

    EDIT: Ouch, my code atm is a bit on the buggy side. I read through it this afternoon and found a lot of errors.
     

    Attached Files:

    Last edited: Dec 19, 2013
  6. vernadead

    vernadead Big Damn Hero

    what exactly would i put here?
    "categories" : [ "test", "randomguns", "randomswords" ],
    for seeds or consumables?

    and it looks like your npcs dont have a list of items to sell.
    That was part of the question is how is the race matched with the proper inventory
     
  7. Westeller

    Westeller Space Penguin Leader

    The available merchant categories are
    • doctormerchant
    • stimmerchant
    • toolmerchant
    • wizardmerchant
    • chefmerchant
    • randomguns
    • randomswords
    • apexweaponblueprints
    • apexarmorblueprints
    • apexclothes
    • apexingredients
    • avianweaponblueprints
    • avianarmorblueprints
    • avianclothes
    • avianingredients
    • floranweaponblueprints
    • floranarmorblueprints
    • floranclothes
    • floraningredients
    • glitchweaponblueprints
    • glitcharmorblueprints
    • glitchclothes
    • glitchingredients
    • humanweaponblueprints
    • humanarmorblueprints
    • humanclothes
    • humaningredients
    • hyltolweaponblueprints
    • hyltolarmorblueprints
    • hyltolclothes
    • hyltolingredients
    • musicalinstruments

    Several of those sell consumables and.. do they sell seeds?
    You're also free to define your own category of items in the merchant.npctype file.

    Also, after looking, I can conclusively say..... that I have absolutely no idea how the racial categories are ever matched with an npc. Beats me.
     
    Last edited: Dec 20, 2013
  8. vernadead

    vernadead Big Damn Hero

  9. vernadead

    vernadead Big Damn Hero

    Oh I see, so It's safe to guess the game sees the apex in apexblueprints and knows what to do?
     
  10. Westeller

    Westeller Space Penguin Leader

    That is possible, but I doubt it.
    More likely I either missed something somewhere, or the game is hard-coded to look for "apexblueprints" - full name, and assign it based on the npctype and race.
     
  11. vernadead

    vernadead Big Damn Hero

    Wait what I didn't understand was the items sold go into the merchant.npctype.

    Strangely enough there is no file for apexclothesmerchan or aviangunmerchant.
     
  12. Supergeek

    Supergeek Scruffy Nerf-Herder

    If you want a fake merchant (vending machine type) look at frogmerchant. He LOOKS like an NPC, but he's not.
     

Share This Page