Reply
Thread Tools Display Modes
Unread 05-29-13, 01:50 AM   #1
shurshik
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 24
UnitCastingInfo API and spellID

I am missing spell id from the UnitCastingInfo, I don't understand why they didn't included it, maybe I am missing something
shurshik is offline   Reply With Quote
Unread 05-29-13, 02:41 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 760
I would refer you to use the CLEU, but then again it depends on what you try to achieve.

But you are right that UnitCastingInfo and UnitChannelInfo don't return a spellID, so you can always try match the spell name instead. Like "if text == GetSpellInfo(12345) then" you get the idea.
__________________
Profile: Curse | Wowhead
Vlad is offline   Reply With Quote
Unread 05-29-13, 02:50 AM   #3
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,240
If there's a predetermined list of spells you care about (eg. you want to know when your arena opponent is casting a crowd-control spell) then you should just generate a table at runtime mapping the localized name from GetSpellInfo(id) to whatever data you actually want (spellID, true, table of data, function to run when it's seen, etc.) and refer to that table to identify the spell based on the name you got from UnitCastingInfo.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 05-29-13, 02:54 AM   #4
shurshik
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 24
I tried to match spellid by name, but there are spells with the same name and different icon (I need an icon).
I was also trying GetSpellInfo by name, it works only for spells that I can cast :/
I saved all combatlogs Spell_cast_start events to the table and then parse it to get spell id by name, and got some spells that are not present in combat logs (about 1%), and it's difficult to parse it :/
shurshik is offline   Reply With Quote
Unread 05-29-13, 02:55 AM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,240
Well, without more specifics about what you're actually doing, it's pretty hard to suggest a more specific solution...
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 05-29-13, 03:02 AM   #6
shurshik
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 24
I am tracking all UnitCastingInfo but don't want to waste memory saving all icons and spellnames, just spellid. To get than Spellname, spellid, icon.

I wondered, maybe I can get spellid from the icon url or it doesn't have an id in it, don't remember
shurshik is offline   Reply With Quote
Unread 05-29-13, 05:01 AM   #7
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,240
It doesn't, and multiple spells can use the same icon. "Tracking all UnitCastingInfo" is still pretty vague, but if you want to keep your project all Top Secret National Security, go for it.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 05-29-13, 06:31 AM   #8
humfras
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 94
For unitIDs, it should be possible to check against the Spell LineID registered via UNIT_SPELLCAST_START.
(arg8 of UnitCastingInfo and arg4 of UNIT_SPELLCAST_START)
e.g. store it like this: spellLineTable[lineID] = spellID

You really should consider posting your code so we can have a closer look.
Since you have Phanx' attention, you should use it for your benefit because she's one of the most skilled/experienced and helpfull members here.
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker
humfras is offline   Reply With Quote
Unread 05-29-13, 06:47 AM   #9
shurshik
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 24
The project is CombatReplay, I save information about players every 0.5 sec, info about their casts I get from UnitCastingInfo, and after the combat I want to show "spell casing" as on video:


Currently I am tracking also combatlog to temporary save all spells and after fight to change spellnames into spellids, but not all spells are in combatlog :/

There is no code to paste as it's a big project
shurshik is offline   Reply With Quote
Unread 05-29-13, 07:51 AM   #10
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 534
What exactly can you not use the combat log to get information about for this project?
semlar is offline   Reply With Quote
Unread 05-29-13, 10:24 AM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,581
Originally Posted by semlar View Post
What exactly can you not use the combat log to get information about for this project?
Yeah, this ^^
__________________
"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

Seerah is offline   Reply With Quote
Unread 05-29-13, 08:41 PM   #12
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,240
Rather than wasting CPU on polling UnitCastingInfo every 0.5 seconds, why not use the events that fire specifically to tell you when someone in your group starts and stops casting a spell? When UNIT_SPELLCAST_START fires for a unit in your group, record the spellID in a table. During your poll, just look at the table to see which (if any) spell the unit is casting. When UNIT_SPELLCAST_SUCCEEDED/STOP/INTERRUPTED fires for a unit in your group, remove the table entry. There's no need for repeated function calls or combat log handling here.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Wish List » UnitCastingInfo API and spellID

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