Quantcast Can we somehow hook Blizzard's Combat Damage Text (that shows above target)? - WoWInterface
Thread Tools Display Modes
09-30-15, 02:20 AM   #1
Nikita S. Doroshenko
A Cyclonian
 
Nikita S. Doroshenko's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2015
Posts: 44
Can we somehow hook Blizzard's Combat Damage Text (that shows above target)?

I'm looking for a way to hook all incoming numbers in combat floating text and chat and multiply them by 0.1 (According to Lua performance manual and tests: multiply is faster then divide). And then use string.format for strings higher then 100 to remove decimal. So for example 637 will become 63.7, but 7 906 or greater will become 791.
This way i will be able to build an AddOn that get rid of long numbers.

The main problem is that AddOns\Blizzard_CombatText\Blizzard_CombatText.lua looks like only handles texts below character. For example if i'll add this code:

Lua Code:
  1. hooksecurefunc("CombatText_AddMessage", function()
  2.     print(message, scrollFunction, r, g, b, displayType, isStaggered)
  3.     -- When i swing or damage deal nothing is output :(
  4.     -- Only Output when i receive heal or get damage
  5. end)
  6.  
  7. local function Test(self, event, ...)
  8.     print(self, event)
  9.     local arg1, data, arg3, arg4 = ...;
  10.     print(arg1, data, arg3, arg4)
  11.     -- Same here, when i swing or damage deal nothing is output :(
  12.     -- Only Output when i receive heal or get damage
  13. end
  14. CombatText:HookScript("OnEvent", Test)

It will only print heal on me, special effects, damage that i take and so on... but nothing about damage that i deal.

So i take a look on other solutions, I inspected Scrolling Combat Text - Damage AddOn, and it looks like it only turn off Blizzard's Cvar that show Combat Damage Done Text, and then uses it's own frame and put there text taken from Combat Chat and animate it.

The main problem in method from Scrolling Combat Text - Damage, is that this text uses fixed position on screen, and if you fight with multiple targets, all damage done text will be placed in center in on place. But i am looking for a way to keep using Blizzard's Damage Done text style, but just hook it to remove 1 number.

I will very appreciate your help and advises.
  Reply With Quote
09-30-15, 05:38 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
If you're thinking about the damage/healing numbers that appear above the targets when you damage or heal them, they cannot be changed as they are part of the game world, not the UI.

The only alternative you've got is to disable it and use an addon to display it in a static location (as most alternatives do).

You could possibly make an addon that anchors them to nameplates, but because of how nameplates work and the fact that they don't have any identifiers usable for matching with the combat log (unless you've put your cursor over them once then cached them), it's not a feasible solution (imo).
  Reply With Quote
09-30-15, 04:47 PM   #3
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 759
Originally Posted by p3lim View Post
The only alternative you've got is to disable it and use an addon to display it in a static location (as most alternatives do).
Are you 100% shure its not possible to anchor a new combat text to a nameplate?
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
09-30-15, 04:49 PM   #4
sticklord
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 57
Originally Posted by Tonyleila View Post
Are you 100% shure its not possible to anchor a new combat text to a nameplate?
It is possible, it just wouldn't work 100%. Same problem as auras on nameplates have.
  Reply With Quote
10-01-15, 05:50 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
Originally Posted by Tonyleila View Post
Are you 100% shure its not possible to anchor a new combat text to a nameplate?
I wouldn't recommend it, as text tends to look weird when moved, but it's possible.
  Reply With Quote
10-01-15, 07:36 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,727
Originally Posted by Tonyleila View Post
Are you 100% shure its not possible to anchor a new combat text to a nameplate?
possible =/= feasible
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Can we somehow hook Blizzard's Combat Damage Text (that shows above target)?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off