Starbound

Starbound

No Fall Damage
bk3000 2016 年 12 月 1 日 下午 8: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.
最后由 bk3000 编辑于; 2016 年 12 月 1 日 下午 8:32
< >
正在显示第 1 - 2 条,共 2 条留言
43770gaming 2020 年 1 月 11 日 下午 1:26 
I have to mention there's a Fall Damage-preventing Status Effect.
thats all
Suphax  [开发者] 2020 年 10 月 2 日 下午 4: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.
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50