Starbound

Starbound

No Fall Damage
bk3000 1. dec. 2016 kl. 20:16
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.
Sidst redigeret af bk3000; 1. dec. 2016 kl. 20:32
< >
Viser 1-2 af 2 kommentarer
43770gaming 11. jan. 2020 kl. 13:26 
I have to mention there's a Fall Damage-preventing Status Effect.
thats all
Suphax  [udvikler] 2. okt. 2020 kl. 16:18 
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.
< >
Viser 1-2 af 2 kommentarer
Per side: 1530 50