Thread Tools Display Modes
05-29-13, 01:50 AM   #1
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
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
  Reply With Quote
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: 793
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
  Reply With Quote
05-29-13, 02:50 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-29-13, 02:54 AM   #4
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
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 :/
  Reply With Quote
05-29-13, 02:55 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, without more specifics about what you're actually doing, it's pretty hard to suggest a more specific solution...
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-29-13, 03:02 AM   #6
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
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
  Reply With Quote
05-29-13, 05:01 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-29-13, 06:31 AM   #8
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 131
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
  Reply With Quote
05-29-13, 06:47 AM   #9
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
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: http://www.youtube.com/watch?v=m3EV36y4SNU

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
  Reply With Quote
05-29-13, 07:51 AM   #10
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
What exactly can you not use the combat log to get information about for this project?
  Reply With Quote
05-29-13, 10:24 AM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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

  Reply With Quote
05-29-13, 08:41 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » 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