Thread Tools Display Modes
03-16-22, 11:38 PM   #1
DonnieDice
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 6
Level up sound on reputation rank up.

Currently trying to figure out how to add sound to reputation rank up. I can't seem to find a RegisterEvent thats related to reputation rank ups, similar to PLAYER_LEVEL_UP. I think in wow when you rank up reputation there is some sound file that plays, and an green level up animation that happens on your character. I am trying to change the sound that plays when this event takes place.
  Reply With Quote
03-17-22, 02:46 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The animation you're referring to is in C code as it's actually rendered in-world and not by the UI system. The same applies to the sound played. Sound file replacements should still work, but I don't know what the path is for that specific sound.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
03-17-22, 03:53 AM   #3
DonnieDice
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 6
I found this.
Code:
568016	sound/spells/reputationlevelup.ogg
I can mute the sound with this.
Code:
MuteSoundFile(568016)
But I can't figure out the RegisterEvent to trigger a new sound file when reputation rank increases.
  Reply With Quote
03-17-22, 06:15 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Here's an example I came up with. It's based off how ReputationFrame updates and keeps track of rep by ID to avoid name collisions.
Lua Code:
  1. local TrackedFactions={};
  2. local EventFrame=CreateFrame("Frame");
  3. EventFrame:RegisterEvent("PLAYER_LOGIN");-- Player login
  4. EventFrame:RegisterEvent("UPDATE_FACTION");--   Kill rep
  5. EventFrame:RegisterEvent("QUEST_LOG_UPDATE");-- Quest rep
  6.  
  7. EventFrame:SetScript("OnEvent",function()
  8.     for i=1,GetNumFactions() do
  9.         local _,_,newstanding,_,_,_,_,_,_,_,hasrep,_,_,faction=GetFactionInfo(i);
  10.         if hasrep and faction and (newstanding or 0)>0 then--   Make sure we have the info we need and standing isn't UNKNOWN (0)
  11.             local oldstanding=TrackedFactions[faction];
  12.             if oldstanding and oldstanding<newstanding then--   Check if standing went up (allow same code to initialize tracking)
  13.                 PlaySoundFile("Interface\\AddOns\\YourAddOn\\YourSoundFile.ogg");
  14.             end
  15.  
  16.             TrackedFactions[faction]=newstanding;-- Update standing
  17.         end
  18.     end
  19. end);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
03-17-22, 07:41 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Holy addon spam

Would it be an idea to have a single "Better Level Up" addon where the player can select (and switch if they get bored of it) one of the many options?
  Reply With Quote
03-17-22, 08:29 AM   #6
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
Smile

Originally Posted by Dridzt View Post
Holy addon spam

Would it be an idea to have a single "Better Level Up" addon where the player can select (and switch if they get bored of it) one of the many options?
+1 to that.

I won't repeat exactly what my first words were when I saw the NEW addon list, but they were "adult language"
__________________
Better to fail then never have tried at all.
  Reply With Quote
03-18-22, 01:26 AM   #7
DonnieDice
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 6
Originally Posted by Yukyuk View Post
+1 to that.

I won't repeat exactly what my first words were when I saw the NEW addon list, but they were "adult language"
You guys, I'm working on this! I'm a noob so.. it might take awhile. This solution was the easiest thing I could come up with

The end goal is in-fact a single addon with the option to choose which sound plays when you level up, and which sound plays when you rank up reputation, and maybe eventually a sound for ranking up in pvp. I'd also like to add the option to turn on and off the default sounds for level/rep rank up.

-- I'm currently learning how to setup api keys and attaching git to addon distribution sites for auto packaging.
-- I'm also trying to figure out how to set up the options menu and am struggling with drop down menus.

Last edited by DonnieDice : 03-18-22 at 01:29 AM.
  Reply With Quote
03-18-22, 04:24 AM   #8
DonnieDice
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 6
Originally Posted by SDPhantom View Post
Here's an example I came up with. It's based off how ReputationFrame updates and keeps track of rep by ID to avoid name collisions.
Lua Code:
  1. local TrackedFactions={};
  2. local EventFrame=CreateFrame("Frame");
  3. EventFrame:RegisterEvent("PLAYER_LOGIN");-- Player login
  4. EventFrame:RegisterEvent("UPDATE_FACTION");--   Kill rep
  5. EventFrame:RegisterEvent("QUEST_LOG_UPDATE");-- Quest rep
  6.  
  7. EventFrame:SetScript("OnEvent",function()
  8.     for i=1,GetNumFactions() do
  9.         local _,_,newstanding,_,_,_,_,_,_,_,hasrep,_,_,faction=GetFactionInfo(i);
  10.         if hasrep and faction and (newstanding or 0)>0 then--   Make sure we have the info we need and standing isn't UNKNOWN (0)
  11.             local oldstanding=TrackedFactions[faction];
  12.             if oldstanding and oldstanding<newstanding then--   Check if standing went up (allow same code to initialize tracking)
  13.                 PlaySoundFile("Interface\\AddOns\\YourAddOn\\YourSoundFile.ogg");
  14.             end
  15.  
  16.             TrackedFactions[faction]=newstanding;-- Update standing
  17.         end
  18.     end
  19. end);
Just tested this and no dice. I'll test it again in a bit just to be doubly sure, maybe I did something wrong.

Last edited by DonnieDice : 03-18-22 at 04:37 AM.
  Reply With Quote
03-18-22, 11:43 PM   #9
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Lua Code:
  1. if oldstanding and oldstanding<newstanding then
TrackedFactions starts as an empty table so oldstanding will always be nil until a new faction entry is added.
Lua Code:
  1. if not oldstanding or oldstanding<newstanding then
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-19-22 at 12:20 AM.
  Reply With Quote
03-24-22, 03:40 AM   #10
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by Fizzlemizz View Post
Lua Code:
  1. if oldstanding and oldstanding<newstanding then
TrackedFactions starts as an empty table so oldstanding will always be nil until a new faction entry is added.
Lua Code:
  1. if not oldstanding or oldstanding<newstanding then
That only controls the sound playing, not the recording. The idea is for PLAYER_LOGIN to start the initial scan, populating TrackedFactions. Further updates compare previous values added and act accordingly. If a new faction was added mid-session, it's designed to not play the sound and still record the initial value.



Looks like the issue was with the hasrep flag. I assumed it was for all factions that show a reputation bar, but it only applies to headers. This adjusts accordingly.

Replace this
Code:
local _,_,newstanding,_,_,_,_,_,_,_,hasrep,_,_,faction=GetFactionInfo(i);
if hasrep and faction and (newstanding or 0)>0 then
with this
Code:
local _,_,newstanding,_,_,_,_,_,isheader,_,hasrep,_,_,faction=GetFactionInfo(i);
if faction and (not isheader or hasrep) and (newstanding or 0)>0 then


Also be sure to change PlaySoundFile("Interface\\AddOns\\YourAddOn\\YourSoundFile.ogg") to the path to the sound file you wish to play. This is relative to the client's install directory. Note YourAddOn and YourSoundFile.ogg are the parts to change accordingly.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 03-24-22 at 04:12 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Level up sound on reputation rank up.

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