Modding Help What is it that makes the bonehammer destroy terrain?

Discussion in 'Starbound Modding' started by ohgoditburns, Dec 17, 2013.

  1. ohgoditburns

    ohgoditburns Void-Bound Voyager

    I don't see anything obvious in the item file. Trying to leverage that ability to make a mining laser.
     
  2. aMannus

    aMannus Space Kumquat

    It's the projectile. Ran into this problem when trying out the projectile on a custom weapon. My base was completely destroyed shortly afterwards. Woops.
     
  3. ohgoditburns

    ohgoditburns Void-Bound Voyager

    Thanks. Looking at the projectile file now.

    Code:
    {
      "projectileName" : "boneswoosh",
      "frames" : "boneswoosh.png",
      "animationCycle" : 0.1,
      "level" : 1,
      "frameNumber" : 3,
      "speed" : 0,
      "orientationLocked" : true,
      "damagePoly" : [ [-25, 24.5], [2.5, 24.5], [16.5, 18.5], [23.5, 11.5], [28.5, 0], [28.5, -13.5], [23.5, -24.5], [-25, -24.5] ],
      "animationLoops" : false,
      "piercing" : true,
      "flippable" : true,
      "damageKind" : "hammer",
      "physics" : "grenade",
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/friendlyboneexplosion/friendlyboneexplosion.config"
        }
      ]
    }
    
    Will post if I figure this out, but I'm thinking it's either "piercing", "damagePoly", or "physics" that determines the terrain damage.
     
    bluecollarart likes this.
  4. aMannus

    aMannus Space Kumquat

    Comparing a normal hammer to the bone hammer, it's definitely "physics" : "grenade",, and solely that line.

    damagePoly seems to indicated a hitbox for the weapon of some sort. Piercing is just if the projectile can hit multiple enemies in a line. If set to false, it just 'ends' the projectile on the first enemy it hits.
     
    bluecollarart likes this.
  5. TheAltgunner

    TheAltgunner Subatomic Cosmonaut

    The "Power" parameter determines how much damage a projectile does to terrain and objects. I noticed that the example above lacks said power parameter (non-damaging projectiles have a power of 5, enough to put a little crack in a dirt block), meaning that the default/unspecified value is probably high enough to damage terrain.
     
    ohgoditburns likes this.
  6. ohgoditburns

    ohgoditburns Void-Bound Voyager

    Here are the entries from the physics file for 'grenade'

    Code:
      "grenade" : {
        "mass" : 1.0,
        "gravityMultiplier" : 0.6,
        "bounceFactor" : 0.7,
        "maxMovementPerStep" : 0.4,
    
        "collisionPoly" : [ [-0.25, -0.25], [0.25, -0.25], [0.25, 0.25], [-0.25, 0.25] ],
        "ignorePlatformCollision" : true,
    
        "airFriction" : 1.0,
        "liquidFriction" : 8.0,
        "groundFriction" : 15.0
      },
    
    and 'grenadezbomb', which is the thrown bomb.

    Code:
    
      "grenadezbomb" : {
        "mass" : 1.0,
        "gravityMultiplier" : 0.6,
        "bounceFactor" : 0.7,
        "maxMovementPerStep" : 0.4,
    
        "collisionPoly" : [ [-0.5, -0.5], [0.5, -0.25], [0.5, 0.25], [-0.5, 0.5] ],
        "ignorePlatformCollision" : true,
    
        "airFriction" : 1.0,
        "liquidFriction" : 8.0,
        "groundFriction" : 15.0
      },
    
    These look like how the projectiles are supposed to move before explosion, so I'm inclined to go with power like altgunner said.
     
  7. ohgoditburns

    ohgoditburns Void-Bound Voyager

    For reference, zbomb projectile (thrown bomb) has power 60, so that should be enough to instantly destroy material.
     
  8. Terraziel

    Terraziel Astral Cartographer

    The explosion referenced in the projectile is what makes the difference, there is a variable called "explosiveDamageAmount" defined in there which is what controls it's effect on the terrain
     
    NerArth and ohgoditburns like this.
  9. ohgoditburns

    ohgoditburns Void-Bound Voyager

    K, to add to that, it's the "actiononreap" bit:

    Code:
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/friendlyboneexplosion/friendlyboneexplosion.config"
        }
    The bone explosion does 5 damage. The bomb does 140. Bullets do 0.5. The radius for the explosion is also in there. Looks like it can also damage background tiles if you want.
     
    Armitige likes this.
  10. Denninja

    Denninja Phantasmal Quasar

    ^
    Code:
        {
          "action" : "explosion",
          "foregroundRadius" : 4,
          "backgroundRadius" : 0,
          "explosiveDamageAmount" : 5,
          "delaySteps" : 2
        }
    That whole section determines the details of terrain damage.
    foregroundRadius of 1 would work for your mining laser.
     
    Last edited: Dec 18, 2013
    Armitige likes this.
  11. cjfidler

    cjfidler Void-Bound Voyager

    Where is that code located? I'm working on some things that could use that. Also can that be added in to anything in theory? (still pretty damn new to modding world)
     
  12. ohgoditburns

    ohgoditburns Void-Bound Voyager

    The gun file calls a projectile.

    Code:
        "projectileTypes" : [ "boneswoosh" ],
    The projectile file calls an explosion.

    Code:
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/friendlyboneexplosion/friendlyboneexplosion.config"
        }
    The explosion file has the bit you're looking for.

    Code:
        {
          "action" : "explosion",
          "foregroundRadius" : 4,
          "backgroundRadius" : 0,
          "explosiveDamageAmount" : 5,
          "delaySteps" : 2
        }
     
  13. ohgoditburns

    ohgoditburns Void-Bound Voyager

    As an aside, the fact that the bonehammer explosive amount is 5, but all other non-bomb weapons are 0.5 makes me think it's probably a typo and in later versions it won't destroy terrain.
     
  14. Karull

    Karull Big Damn Hero

    I may be misunderstanding what you're trying to say, but I'm pretty sure it's not a typo. The higher explosiveDamageAmount is the more damage it does to tiles. I put a weapon I made to 50 and it was destroying pretty much everything, terrain, objects, etc, in one hit.

    edit: Does not do damage to enemies or players.
     
    Last edited: Dec 18, 2013
  15. Denninja

    Denninja Phantasmal Quasar

    On that note, setting the radii higher is very useful for carving neat circles in things!
     
    Karull likes this.
  16. ohgoditburns

    ohgoditburns Void-Bound Voyager

    I'm saying I don't think that bonehammer destroying terrain was intended behavior.
     
    NerArth, Armitige and Karull like this.
  17. Armitige

    Armitige Void-Bound Voyager

    Glad I saw this post. I was sick of losing stuff to this weapon by accidentally swinging it on my ship and destroying a bunch of platforms that chests were sitting on.
     
  18. Fleder

    Fleder Pangalactic Porcupine

    a mining laser would be pretty sweet!
    keep us informed, please.
     
  19. thehunter0396

    thehunter0396 Big Damn Hero

    Hey. How did this go? I am attempting a project along these same lines right now and am running into some... issues. Was wondering if you'd made any progress.
     

Share This Page