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.

AltaryaDF

Porting Shields to DS - Help with damage blocking

Recommended Posts

AltaryaDF    0

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

Share this post


Link to post
Share on other sites
Nappy    0

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)

 

Share this post


Link to post
Share on other sites
AltaryaDF    0

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

Share this post


Link to post
Share on other sites
Nappy    0

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?

Share this post


Link to post
Share on other sites
AltaryaDF    0

that'd work if the shield mechanic was extra armor anytime it is equipped, however the idea is whenever you parry it blocks 100% of the damage but renders you immobile until you stop parrying

Share this post


Link to post
Share on other sites