Modding Help Drop Pools without monstertype patches

Discussion in 'Starbound Modding' started by Campaigner, Dec 3, 2015.

  1. Campaigner

    Campaigner Giant Laser Beams

    As I was updating all the junk in my mod on the nightly, I found that two of my guns didn't work anymore. Looking at the files for my damage, treasurepools, and monstertype.patch files, I found that the .monstertype files for all monsters has changed. The drop pools are now in this format;

    Code:
      "dropPools" : [ { "default" : "gleapTreasure", "bow" : "gleapHunting" } ],
    
    Knowing I'd need a patch file to make my mod work the way it's meant to, I went and added my treasure (For example, "loot1" : "loot1treasure") the same way I did before, doing;

    Code:
    [ {"op":"add","path":"/dropPools/0/loot1","value": "loot1treasure"} ]
    
    This is the way I had it set up in my original files, and prior to the unstable/nightly, it worked. Now, since the format for droppools has changed, I had to change it around to make sure it worked right. Using an online tool to make sure my json was right, I got the following;

    Code:
    [
    {
    "op": "replace",
    "path": "/dropPools/0",
    "value": {
    "default": "gleapTreasure",
    "bow": "gleapHunting",
    "loot1": "loot1treasure"
    }
    }
    ]
    
    Now, this works, but only for that exact monster. Every unique monster has their own treasurepools. Needless to say, that means I'd need to redo each patch file individually and make sure they use their own values. That's way too tedious, so I sought an easier way to do it. I changed my projectile to a custom one, and in the file I added an actiononreap command;

    Code:
    {
      "projectileName" : "zapzap",
      "physics" : "laser",
      "bounces" : 0,
      "damageKindImage" : "icon.png",
      "frames" : "zap.png",
      "animationCycle" : 0.5,
      "frameNumber" : 4,
      "power" : 50,
      "supportsProcessing" : true,
      "actionOnReap" : [
      {
      "action" : "item",
      "name" : "bone"
      }
      ],
      "lightColor" : [73, 10, 0],
      "damageKind" : "zapzap"
    }
    
    I used a pre-existing damageKind file, just renamed and with a few different values, so that's not worth showing. This method works nicely as a party thing, but it also leads to a problem; when the projectile "dies" (such as hitting a wall), the item spawns. I can shoot a door and get a bone, for example. As humerus as that is, I need the projectile to recognize a kill, not a wall.

    Without creating a treasurepool and having to edit every single monstertype.patch separately, is there a way to make the projectile recognize a kill and only do an ActionOnReap in that event? I've scoured the game's files for an answer, since I was certain that such a thing existed, but I can't find anything to put me on the right track.

    EDIT: Or, if a kill is a no-go, at least some way to recognize a hit on a monster. I just don't want to shoot steel walls and get bones, for example.


    I'm against editing all the patches not because I'm a lazy SOB (although that is a contributing factor), but because the changes I need to use require a "replace" command. I'm trying my absolute hardest to keep my mod from altering things in conflicting ways, and "replace" can cause problems unlike "add" would, but "add" doesn't work the same way now due to the changes in the .monstertype files.

    I'm posting at 3:40 am my time, so if my post is a bit hard to understand, I apologize.
     
  2. Reno_fezzed_one

    Reno_fezzed_one Void-Bound Voyager

    Turn the bow into an active item and script the item drops using Lua.
     

Share This Page