Starbound

Starbound

No Fall Damage
bk3000 1 Dec, 2016 @ 8:16pm
Better handling of fall damage from LUA
I had someone mention this mod, but also mention it can be inconstant. Also mentioned in your comments is interaction with other mods. I think I can help fix these issues easily by taking a different approach.

Right now you're matching player.config. An alternate solution does patch the same files, but doesn't touch the values you change. It hooks the player scripts. I'll give you the scripts you need for the no damage mod, and for the 1/3rd damage mod.

Suphax_lessFallDamage.lua
Suphax_falldamage = {} Suphax_falldamage.applyDamageRequest = applyDamageRequest function applyDamageRequest(damageRequest) if damageRequest.damageSourceKind == "falling" and damageRequest.damage ~= 0 then damageRequest.damage = damageRequest.damage / 3 end return Suphax_falldamage.applyDamageRequest(damageRequest) end

Suphax_noFallDamage.lua
Suphax_falldamage = {} Suphax_falldamage.applyDamageRequest = applyDamageRequest function applyDamageRequest(damageRequest) if damageRequest.damageSourceKind == "falling" then return {} else return Suphax_falldamage.applyDamageRequest(damageRequest) end end

and to replace the current
player.config.patch

[ [ { "op" : "add", "path" : "/statusControllerSettings/primaryScriptSources/-", "value" : "/scripts/Suphax/Suphax_noFallDamage.lua" } ], [ { "op" : "test", "path" : "/modEnvironment", "inverse" : true }, { "op" : "add", "path" : "/modEnvironment", "value" : {} } ], [ { "op" : "test", "path" : "/modEnvironment/noFallDamage", "inverse" : true }, { "op" : "add", "path" : "/modEnvironment/noFallDamage", "value" : true } ] ]
Obviously the reduced damage one would be slightly different.
Last edited by bk3000; 1 Dec, 2016 @ 8:32pm
< >
Showing 1-2 of 2 comments
43770gaming 11 Jan, 2020 @ 1:26pm 
I have to mention there's a Fall Damage-preventing Status Effect.
thats all
Suphax  [developer] 2 Oct, 2020 @ 4:18pm 
8 months late but whatever haha

If I utilized the status effect my mod could be affected by any mods that modify it.

Even if most mods probably wouldn't there's always that chance. By using this script this mod is entirely independent, and should work fine without direct intervention, say a mod specifically testing for and unpatching the script, for whatever reason.
< >
Showing 1-2 of 2 comments
Per page: 1530 50