Modding Help Modifying Boss Drop Pools

Discussion in 'Starbound Modding' started by Bonoshman, Mar 1, 2014.

  1. Bonoshman

    Bonoshman Big Damn Hero

    Hello! I'm currently making a mod that involves adding rare drops (Weapons and techs) for bosses and certain enemies.
    I'm just wondering how to make modified in-game content (Drop pools) easily distributed (I don't want to require people to replace some of the files to install my mod)

    It might also be useful if someone could tell me where to find the boss drop pools :p

    Apologies if these are stupid questions, fairly new to modding and whatnot.
     
  2. Daimoth

    Daimoth Scruffy Nerf-Herder

    Chucklefish came up with something called merging that addresses this exact concern. Basically, you can add code without overwriting the entire file. Code example to follow shortly.
     
    Bonoshman likes this.
  3. Bonoshman

    Bonoshman Big Damn Hero

    Sounds like just what I need. If one deletes the mod, will it delete said merged files?
     
  4. The | Suit

    The | Suit Agent S. Forum Moderator

  5. Bonoshman

    Bonoshman Big Damn Hero

    I read a few, but OH MY GOD HOW DID I MISS THAT ONE.

    I read through it and now I think I'm ready to start working on it
     
  6. The | Suit

    The | Suit Agent S. Forum Moderator

    If you say so.
    Boss treasure pools are found here.

    Code:
    assets\unpacked\treasure\default.treasurepools
     
    Bonoshman likes this.
  7. Daimoth

    Daimoth Scruffy Nerf-Herder

    Ah hell, sorry, irl stuff came up.

    Yeah, merges are done externally.

    As an example, if you wanted to tool around with default.treasurepool (which you will be), you'd create another default.treasurepool that just contains your new JSON code.

    If I wanted to do it, here's the code I would try:

    Code:
    {
      "__merge" :[],
    
    "boss2Treasure" : [
        [1, {
            "fill" : [["item1", 1], ["item2", 3]]
          } ]
      ]
    }
    item1 and item2 are, obviously, the names of the items your boss will drop. The values afterward are the amount. In this case the boss will drop one item1 and three item2.

    "fill" is one types of treasure, another I've seen is "pool". "fill" items always drop - the whole list. Pools are based on chance and are governed by the RNG - random number generator.

    Aside from thoroughly checking out the Mollygos' guides thread, the first thing you should do when adding new content to Starbound is check if someone else has done something similar so you can see how they did it.
     
  8. Bonoshman

    Bonoshman Big Damn Hero

    I tested this with the first boss. New character and everything, I hacked myself a good sword and killed the first boss, he didn't drop anything different.

    I put the following code in
    Mods/More_Boss_Drops!/treasure/default.treasurepools:

    Code:
    {
      "__merge" :[],
    
    "boss1Treasure" : [
        [1, {
            "fill" : [["torch", 1], ["bomb", 3]]
          } ]
      ]
    }
    If it matters, I used notepad++ to do this.
    I dunno if I just am an idiot or there's something wrong with the fact i'm in unstable build. Tell me if you can figure it out, and apologies if it's a stupid mistake.
     
  9. The | Suit

    The | Suit Agent S. Forum Moderator

  10. Bonoshman

    Bonoshman Big Damn Hero

    I tried both templates and changed the respective pools and such. It wouldn't work. I thought maybe it wasn't reading the files in the first place, so this happened
    [​IMG]I tried to crash the game and it worked, so it can read the file.

    If there's one thing I know how to do, It's crash a game.
     
    Last edited: Mar 2, 2014
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    Last edited: Mar 2, 2014
  12. Bonoshman

    Bonoshman Big Damn Hero

    1. I know that wasn't the error message I was supposed to read if it crashed. I just wanted to make sure that the game was using my code, because the game wouldn't crash, but the UFO boss wouldn't drop the items I told him to drop.
    2. See 1.

    ==
    I changed your code a little bit so that it would drop the different items from the first boss. It just wouldn't work to me, because i'm stupid or whatever. Sorry I guess?
     
  13. The | Suit

    The | Suit Agent S. Forum Moderator

    My main point is - you should have actually put the code you tried.
    Then we could have said if there was a mistake in that code.

    Showing code and an error - which has obvious mistakes doesn't really help anyone.
     
  14. Bonoshman

    Bonoshman Big Damn Hero

    Sorry about that then. I've done a bit more testing and such (to no avail), and I've gotten it to not crash again. The code I used is:

    Code:
    {
      "__merge" : [],
      "boss1Treasure" : [
        [1, {
            "pool" : [
              [0.5, [ "whiskeyflask" ] ],
              [0.5, [ "money", 50 ] ]
            ],
            "poolRounds" : [
              [0.01, 0],
              [0.99, 1]
            ],
            "levelVariance" : [0, 0],
            "allowDuplication" : true
          } ]
      ]
    }
    It might be worth noting that in "boss1Treasure", there is no "pool", but rather a "fill" action.

    Code:
    "boss1Treasure" : [
        [1, {
            "fill" : [["moltencore", 5], "bossdreadwingCodex"]
          } ]
      ],
    Would I need to merge the files in the first place or is the pool being treated seperately?

    Also, would it be easier to overwrite "boss1Treasure" in the first place?

    (Sorry for the large number of questions, but I have a bit tighter of a grasp on it now.)
     
    Last edited: Mar 3, 2014
  15. The | Suit

    The | Suit Agent S. Forum Moderator

    You have to maintain format - what you did is basically mix and matched the two codes. [ you are esentially adding to the vanillia code ]
    So you are confusing the game. You need to overwrite the boss 1 treasure pool instead - to change it to the new format.
    Also make sure to add the original boss 1 treasure [magma core etc ]

    Instead you should something like
    Code:
    {
      "__merge" : [
      [ "overwrite", "boss1Treasure" ]
    ],
      "boss1Treasure" : [
        [1, {
            "pool" : [
              [0.5, [ "whiskeyflask" ] ],
              [0.5, [ "money", 50 ] ]
            ],
            "poolRounds" : [
              [0.01, 0],
              [0.99, 1]
            ],
            "levelVariance" : [0, 0],
            "allowDuplication" : true
          } ]
      ]
    }
     
    Bonoshman likes this.
  16. Bonoshman

    Bonoshman Big Damn Hero

    Thanks for the help so far!
    Code:
    {
        "__merge" : [
        ["overwrite", "boss1Treasure"]
    ],
        "boss1Treasure" :[
          [1, {
            "pool" : [
              [0.5,["whiskeyflask"]],
              [0.5,["money", 50]]
            ],
            "poolrounds" :[
              [0.01, 0],
              [0.99, 1]
            ],
            "levelVarience" : [0,0],
            "allowDuplication" : true
          } ],
    [2,{
        "fill" : [["moltencore", 5], "bossdreadwingCodex"]
    } ]
    ]
    }
    In game, the penguin ufo either drops 1 whiskey, or 50 pixels.
    It never drops the magma core or the dreadwing lore.
    What am I doing wrong?
    (And can I use
    Code:
    {
    "poolrounds" :[
      [1,1]
    ],
    }
    to make it only do 1 pool round?)

    Btw, the game DOES NOT crash, so I've got that going for me, which is nice.
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    As I was saying in my previous post - you will have to add it in manually.
    Code:
    "poolRounds" : 1,
    Should work
     
  18. Bonoshman

    Bonoshman Big Damn Hero

    1: I added code to make it drop. You can see it in the above post

    2: Ok. Thanks!
     
  19. Bonoshman

    Bonoshman Big Damn Hero

    Never-mind, that was dumb of me.
    On a side note: Success!

    The code I used, for anyone struggling, is:
    Code:
    {
      "__merge" : [
      [ "overwrite", "boss1Treasure" ]
    ],
      "boss1Treasure" : [
        [1, {
            "pool" : [
              [0.5, [ "whiskeyflask" ] ],
              [0.5, [ "money", 50 ] ]
            ],
            "poolRounds" : [
              [0.01, 0],
              [0.99, 1]
            ],
            "levelVariance" : [0, 0],
            "allowDuplication" : true,
           
            "fill" : [
              ["moltencore", 5],
              "bossdreadwingCodex"]
    }]]
    }
    
    Now to work on tech and weapons :unsure:
     
    The | Suit likes this.
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    Tech is based on LUA - merge files will not work.
    Weapons - is part of my merge examples also in the earlier post.
     
    Bonoshman likes this.

Share This Page