Modding Help Unknown treasurePool error

Discussion in 'Starbound Modding' started by projectmayhem, Apr 29, 2017.

  1. projectmayhem

    projectmayhem Spaceman Spiff

    Here is the only error that shows up in my log
    [08:17:45.748] [Error] WorldServerThread exception caught: (TreasureException) Unknown treasure pool 'lightsaber1'

    Here is my NPC that uses this treasurepool.

    Code:
    {
      "type" : "younglingmaster",
      "shortdescription" : "younglingmaster",
      "baseType" : "hostile",
    
      "levelVariance" : [0, 0],
    
      "dropPools" : [ "saber1" ],
     
     
      "items" : {
        "override" : [
          [0, [ {
            "head" : [ { "name" : "SWMjedi3hood" } ],
                "chest" : [ { "name" : "SWMjedi3chest" } ],
                "legs" : [ { "name" : "SWMjedi3pants" } ],
                "primary" : [
                  "SWMknightsaber"
            ],
            "alt" : [
              { "name" : "SWMforceshield" }
            ]
          } ] ]
        ]
      }
    }
    


    As you can see, the treasurepool is called saber1, not lightsaber1.

    So here is my npcDrops.treasurepools.patch

    Code:
    [
    {
        "op": "add",
        "path": "/saber1",
        "value": [
        [1, {
          "pool" : [
            {"weight" : 1.0, "pool" : "lightsaber1"}
          ],
          "poolRounds" : 1,
          "allowDuplication" : false
        }
        ]
       
      ]
      }
      ]
    I ran it through the http://json-schema-validator.herokuapp.com/jsonpatch.jsp and it says its correct. But everytime I kill the younglingmaster.npctype , it teleports me back to my ship and he drops nothing. When I check the error log, it's that same error everytime.
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    that is because the pool is saber1 -> and it is referencing another pool called lightsaber 1.
    You probably wanted to use item instead of pool.

    If you use "Pool" -> it will run it through another pool
    If you use item -> it will spawn that item.

    Example
    Code:
    [3.9, {
          "pool" : [
            {"weight" : 0.25, "item" : "techcard"},
            {"weight" : 0.30, "item" : "manipulatormodule"},
            {"weight" : 0.10, "item" : ["manipulatormodule", 2]},
            {"weight" : 0.13, "item" : "upgrademodule"},
            {"weight" : 0.05, "item" : "teleportercore"},
            {"weight" : 0.06, "pool" : "augments"},
            {"weight" : 0.06, "pool" : "petcollars"},
            {"weight" : 0.03, "pool" : "uniqueWeapon"},
            {"weight" : 0.02, "pool" : "uniqueWeaponRecipe"}
          ]
        }
    
     
    bk3k likes this.
  3. projectmayhem

    projectmayhem Spaceman Spiff

    Oh ok! I'll fix that here soon and give it a test!

    *edit*

    Worked beautifully.
     
    Last edited: Apr 29, 2017

Share This Page