I don't see anything obvious in the item file. Trying to leverage that ability to make a mining laser.
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.
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.
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.
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.
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.
For reference, zbomb projectile (thrown bomb) has power 60, so that should be enough to instantly destroy material.
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
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.
^ 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.
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)
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 }
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.
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.
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.
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.