Get spell names (not IDs)
DeviC3
Member Posts: 25
Hi. Is there any way to get spell names when object casts them?
I build function which can get IDs but how to convert it to log the name of spell ?
I build function which can get IDs but how to convert it to log the name of spell ?
0
Comments
But how to get this labels to log file ? Or convert ID numbers to strings
If the log needs to be more human-readable, a function like this - which I'm posting untested - will get the label from the 2DA for a given spell.
(deleted - see better code from Daz below!)
string sSpellLabel = Get2DAString("spells", "Label", GetSpellId());
Or if you want to be fancy you can get the name from the tlk table like this:
string sSpellName = GetStringByStrRef(StringToInt(Get2DAString("spells", "Name", GetSpellId())));
string LogSpellCasted = Get2DAString("spells", "Label", GetSpellId());
Thanks, and cheers guys!