I have a general question, what program and/or website can I use to check against the APIs for both retail and classic. I’m coming across several issues where I’m adding more to the addon but information isn’t display and playing the sounds for Zelda Loot. Since I took over the project, I have very little experience with programming language but I am trying to learn. I also have to make the addon that will work properly in Classic, as it does right now with retail. Thank you all for the support with the downloads of the addon.
extract the game code. see https://wowwiki-archive.fandom.com/wiki/Extracting_WoW_user_interface_files
if you know where/when something happens in game you have a better chance of finding out what triggered it, and/or what ran, if you check those files.
there is some documentation in the files, and the /api (i think) command can be helpful at times but mostly for data types. mostly its usaing google to search for one of the web sites that has a particular api command already mapped out.
you can also post here and asking us what is going on
the last resort is to just download other peoples mods and see how they do things. obviously you dont just copy large swathes of their code (you wont learn anything that way), try and work out what its doing and why, then write it your way. you may end up doing it exactly the same, and thats ok, sometimes there is only one way to do something, but you may also learn of another way of doing it that you prefer and still gets the right results.
typically the way to handle the different game clients is to create helper functions that split off into the required code for each client, that way you only ever have to call one function and it works no matter what client they are using. eg;
function ArkInventory.CrossClient.SetCVar( ... )
if C_CVar then
return C_CVar.SetCVar( ... )
else
return SetCVar( ... )
end
end
that doesnt need to know specifically which client they are using, it only swpas if that client is using the new api or the old one (by checking if C_Cvar exists or not).
you may eventually run into needing to know exactly which game client variant they are using in which case you can use a combination of the following values to work it out;
GetCVar( "agentuid" )
will have beta or ptr in it for those variants, or some other value for live
GetCVar( "portal" )
will have test in it for ptr (its inconsistent for beta so is mostly a backup data point)
WOW_PROJECT_ID
1 = retail, 2 = classic, 5 = bc
oh, /dump
is your friend, you can use it to see whats in a variable (dump the contents).
so is /fstack
. you use this to check the frame stack (type it in again to turn it off)
Thank you for this information. I will make note of it. Also if anyone can review one of my other posts, and the issue I’ve come across, I just don’t know what I am missing or what I am doing wrong. I pretty much copied and pasted the information that was already there and continued the sequence. However the addon isn’t pulling the audio from the designated folders. I tested the audios to make sure they work, and they do, however, the additional audios just won’t play properly and I could really use some assistance with that.
I’m not sure which other post yor are referring too.
One common mistake in paths to files is using a single \ in your lua code. You need to use either a double \\
or a single /
PlaySoundFile("Interface\\AddOns\\MyAddOn\\SomeSoundFile.ogg")
or:
PlaySoundFile("Interface/AddOns/MyAddOn/SomeSoundFile.ogg")
The other is that addons can’t “see” files outside the Interface folder under the _version_
folder in your game path.
at a quick glance the code appears to be fine (although there are some variables that arent local and probably should be)
i copied one of the audio files over and it plays fine manually in game so basically debug your code.
start putting print statements everywhere it checks the index (and thus the file to play) so that you can tell your code is actually getting there. including the last one which just returns (because if its not playing anything then that seems like an obvious place)
the other obvious place is where it works out if it was recently played and doesnt play it again - add output there so you can tell its aborting because of that
also in front of the actual play commands add print statements with the data so that when it does get there you know, and if its still not playing the audio then its most likely something else, not necessarily your code
Ty. I will definitely take a look when my computer is up and running and I can access the files.