Jump to content

Porting Shields to DS - Help with damage blocking


Recommended Posts

Hello, i am trying to port the DST mod Shields to DS for my own personal use and while i have been able to get all items, animations, custom action and inventory slot all working within DS, for some reason the shields do not actually stop damage, furthermore the game doesnt seem to fire my print() within the action, have i missed something when porting the action?
Line 681 and onwards
 

modmain.lua

Link to comment
Share on other sites

Line 686 looks strange to me...

    local shield = act.invobjectlocal shield = act.doer.components.inventory:GetEquippedItem(GLOBAL.EQUIPSLOTS.SHIELD)

not sure what this line is trying to accomplish, but usually you are not setting local shield equal to one variable which is equal to another?  the way this looks now its like writing local shield = A = B or something...

And then on line 690 you set local invobj = act.invobject, which makes me think you wanted to use either

1) local shield = act.invobject

-OR-

2) local shield = act.doer.components.inventory:GetEquippedItem(GLOBAL.EQUIPSLOTS.SHIELD)

 

Link to comment
Share on other sites

Oh yes, i am switching to the first one, the original mod only let you use shields from the shield slot, i am going to let you use them from the inventory in general(to be able to disable the shield slot for when using RPG Hud)
But my issue is the invobj.components.shield.armor:SetAbsorption(TUNING.FULL_ABSORPTION), as it doesnt seem to trigger any absorption at all

Link to comment
Share on other sites

have you tried using

inst:AddComponent("armor")
inst.components.armor:InitCondition(TUNING.FULL_ABSORPTION)

in the prefab files and when the shield procs its does absorption instead?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...