Modding Help Custom NPC's not activating trade

Discussion in 'Starbound Modding' started by ZaelixStrife, Apr 30, 2022.

  1. ZaelixStrife

    ZaelixStrife Big Damn Hero

    [09:15:28.854] [Error] [string "/npcs/bmain.lua"]:162: (StarException) Lua Exception caught running action node enableTrading in behavior merchant: (LuaException) Error code 2, [string "/scripts/actions/merchant.lua"]:8: bad argument #1 to 'pairs' (table expected, got nil)
    stack traceback:
    [C]: in function '_ENV.pairs'
    [string "/scripts/actions/merchant.lua"]:8: in global 'buildTradingConfig'
    [string "/scripts/actions/merchant.lua"]:153: in function <[string "/scripts/actions/merchant.lua"]:151>

    This is the code i get whenever i attempt to interact with the npc

    Below is the code for the merchant npc

    {
    "type" : "archfiendmerchant",
    "baseType" : "base",
    "damageTeamType" : "friendly",
    "identity" : {
    "facialHairType" : "",
    "facialHairGroup" : "",
    "personalityArmOffset" : [0, 0],
    "hairType" : "fem4",
    "bodyDirectives" : "?replace;c7815b=bababa;ffe2c5=ffffff;ffc181=dedede;d39c6c=cfcfcf",
    "personalityArmIdle" : "idle.4",
    "gender" : "female",
    "color" : [51, 117, 237],
    "personalityHeadOffset" : [-1, 0],
    "hairGroup" : "hair",
    "facialMaskDirectives" : "?replace;c7815b=bababa;ffe2c5=ffffff;ffc181=dedede;d39c6c=cfcfcf",
    "species" : "archfiend",
    "personalityIdle" : "idle.4",
    "facialMaskGroup" : "horns",
    "name" : "sale",
    "facialHairDirectives" : "",
    "emoteDirectives" : "?replace;c7815b=bababa;ffe2c5=ffffff;ffc181=dedede;d39c6c=cfcfcf",
    "hairDirectives" : "?replace;735e3a=828282;a38d59=b8b8b8;d9c189=eaeaea",
    "facialMaskType" : "3"
    },
    "merchant" : {
    "waitTime" : 10,
    "storeRadius" : 1,
    "poolsFile" : "/merchantpools.config",
    "categories" : {
    "default" : ["randomswords"]
    },
    "buyFactorRange" : [ 0.9, 1.2 ],
    "sellFactorRange" : [ 0.2, 0.2 ],
    "numItems" : 10
    },
    "initialScriptDelta" : 5,
    "scriptConfig" : {
    "behavior" : "merchant",
    "dialog" : {
    "converse" : {
    "default" : {
    "default" : [
    "Hey welcome to Nightingale! we're still recovering but we're making it!"
    ],
    "archfiend" : [
    "Welcome back home! I think we're getting a letter from Lucifer soon."
    ]
    }
    }
    }
    },
    "items" : {
    "override" : [
    [0, [
    {
    "back" : [ { "name" : "archfiendwingsalbino" } ],
    "chest" : [ { "name" : "archfiendtitan4chest" } ],
    "legs" : [ { "name" : "archfiendtitan4pants" } ]
    }
    ]
    ]
    ]
    }
    }
     

Share This Page