Jump to content

Recommended Posts

How can i get planar defense values for my client sided mod? 

 if base_inst.components.planardefense then
        planardefense = base_inst.components.planardefense.basedefense or 0
    end
 
doesnt work
 
 TUNING[inst.prefab:upper().."_PLANAR_DEF"] or 0
 
 
wont work either, also dreadstone armors planar defense value doesnt match its prefab since its TUNING.ARMORDREADSTONE_PLANAR_DEF instead of TUNING.ARMOR_DREADSTONE_PLANAR_DEF also planar defense values are stored like below:
 
Quote

ARMOR_DREADSTONEHAT = wilson_health * 8 * multiplayer_armor_durability_modifier,
        ARMOR_DREADSTONEHAT_ABSORPTION = 0.9 * multiplayer_armor_absorption_modifier,
        ARMOR_DREADSTONEHAT_PLANAR_DEF = 5,
        ARMOR_DREADSTONEHAT_SHADOW_RESIST = 0.9,
        ARMORDREADSTONE = wilson_health * 8 * multiplayer_armor_durability_modifier,
        ARMORDREADSTONE_ABSORPTION = 0.9 * multiplayer_armor_absorption_modifier,
        ARMORDREADSTONE_PLANAR_DEF = 5,
        ARMORDREADSTONE_SHADOW_RESIST = 0.9,
        ARMOR_DREADSTONE_REGEN_PERIOD = 1,
        ARMOR_DREADSTONE_REGEN_MINRATE = (0.01 / 10) / 1.5,
        ARMOR_DREADSTONE_REGEN_MAXRATE = (0.01 / 6) / 1.5,
        ARMOR_DREADSTONE_REGEN_SETBONUS = 1.5,

and here is my full method

function ItemInfoDesc:GetArmorValues(base_inst, inst)
    local absorb_percent = base_inst.components.armor.absorb_percent * 100
    local hp = base_inst.components.armor.maxcondition * inst.replica.inventoryitem.classified.percentused:value() / 100
    local planardefense = 0
 
    if base_inst.components.planardefense then
        planardefense = base_inst.components.planardefense.basedefense or 0
    end
 
    local absorb_string = string.format("%d%%", absorb_percent)
    if planardefense > 0 then
        absorb_string = absorb_string .. "+" .. string.format("%d", planardefense)
    end
 
    return absorb_string, hp
end
8 hours ago, alti112 said:

Could you explain why its not possible?

You can't access components on client side if it's not replicated on the client side.

8 hours ago, alti112 said:

i thought i would be able to do it since its in tuning, also i am able to get planar damage values

Yes, you could do it with tuning. However if a mod changes planar damage of a weapon, values from tuning would be incorrect.

5 hours ago, _zwb said:

You can't access components on client side if it's not replicated on the client side.

Yes, you could do it with tuning. However if a mod changes planar damage of a weapon, values from tuning would be incorrect.

But i cant get planar defense values from tuning do you know why that could be?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...