KirbyJParasol Posted February 29, 2016 Share Posted February 29, 2016 Aiight, so here's what I'm trying to do. I'm trying to code a character so that he has a global damage penalty of 0.89. That's simple enough, just toss this in: inst.components.combat.damagemultiplier = 0.89 HOWEVER I'm trying to make a long-range specialist, who gets a x3 multiplier on the boomerang and the blow dart. My problem is, I don't know how to make this multiplier weapon specific! I've tried reverse engineering a handful of mods to get to to work, but it's such a nasty hodge-podge that I've finally decided to ask the much more experienced community for some pointers. How do I go about this? Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/ Share on other sites More sharing options...
Aquaterion Posted February 29, 2016 Share Posted February 29, 2016 (edited) inst:ListenForEvent("equip", function() local equippedwep = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equippedwep ~= nil and equippedwep:HasTag("projectile") then inst.components.combat.damagemultiplier = 1.11 else inst.components.combat.damagemultiplier = 0.89 end end) ----- If you want it for other things other than projectile, for example thrown(most thrown weapons have projectile tag too), this should work; if equippedwep ~= nil and (equippedwep:HasTag("projectile") or equippedwep:HasTag("thrown")) then Edited February 29, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728276 Share on other sites More sharing options...
KirbyJParasol Posted February 29, 2016 Author Share Posted February 29, 2016 Thankee very much! Worked perfectly. Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728320 Share on other sites More sharing options...
SenL Posted February 29, 2016 Share Posted February 29, 2016 Won't that code affect all players? or is that intended (I wouldn't like that debuff ... ) Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728437 Share on other sites More sharing options...
Aquaterion Posted February 29, 2016 Share Posted February 29, 2016 Just now, SenL said: Won't that code affect all players? or is that intended (I wouldn't like that debuff ... ) that code is put in the player's prefab file, such as webber.lua or customcharacter.lua, so no it won't Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728439 Share on other sites More sharing options...
KirbyJParasol Posted March 1, 2016 Author Share Posted March 1, 2016 It will affect all players...who play as this specific modded character Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728703 Share on other sites More sharing options...
Aquaterion Posted March 1, 2016 Share Posted March 1, 2016 4 minutes ago, KirbyJParasol said: It will affect all players...who play as this specific modded character Well yeah, I meant all characters, and I'm sure he did as well Link to comment https://forums.kleientertainment.com/forums/topic/64926-character-weapon-specific-damage-multipliers/#findComment-728708 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now