SenL Posted February 13, 2016 Share Posted February 13, 2016 If I equip an item, I would like to know the damage. Is there a way? Thanks. Link to comment Share on other sites More sharing options...
Neu7ral Posted February 13, 2016 Share Posted February 13, 2016 Well. Exist the Damage Indicators. It's an server side mod. http://steamcommunity.com/sharedfiles/filedetails/?id=543945797 Link to comment Share on other sites More sharing options...
SenL Posted February 14, 2016 Author Share Posted February 14, 2016 Thanks. Looked at the mob and it's doing this: local amount = (data.newpercent - data.oldpercent) * inst.components.health.maxhealth Well... that would work but is that the only way to tell currently-equipped weapon base damage? Link to comment Share on other sites More sharing options...
Muche Posted February 15, 2016 Share Posted February 15, 2016 Tracking where the displayed damage is coming from seems to lead to components/combat.lua:616 local weapondamage = weapon.components.weapon.damage or 0 Link to comment Share on other sites More sharing options...
SenL Posted February 15, 2016 Author Share Posted February 15, 2016 Hm, how do you access that from character inst? Link to comment Share on other sites More sharing options...
Muche Posted February 15, 2016 Share Posted February 15, 2016 (edited) weapon = playerinst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) Edited February 15, 2016 by Muche Link to comment Share on other sites More sharing options...
SenL Posted February 15, 2016 Author Share Posted February 15, 2016 Works. Thanks much! Note: weapon will be nil if player is not wielding anything. This is fine. Link to comment Share on other sites More sharing options...
Muche Posted February 15, 2016 Share Posted February 15, 2016 Well yes, that was just the direct way, without any sanity checks; e.g. weapon.components.weapon can be nil as well if the held item is not a weapon. Link to comment 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