Thread Tools Display Modes
01-24-14, 03:25 PM   #21
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Keep in mind that path and file names are aware of upper and lower case letters.
  Reply With Quote
01-24-14, 03:26 PM   #22
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Duugu View Post
Keep in mind that path and file names are aware of upper and lower case letters.
No they aren't, the paths should work regardless of the case.

I HAVE seen cases where it required a backslash instead of a forward slash for some reason.
  Reply With Quote
01-24-14, 03:27 PM   #23
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by semlar View Post
No they aren't, the paths should work regardless of the case.
Oh. I was so sure about that. Well. At least I've learned something today. Thank you.
  Reply With Quote
01-24-14, 03:30 PM   #24
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Nuru0190 View Post
You sir, are a genius! It works perfectly.
However, i've got one last question: it doesn't trigger the sound file for one spell only: "Flying Serpent Kick".
I think it comes from the game that doesn't recognize the spell when typed like this, even though it is the complete name with the right spelling. Would you happen to know how to fix that as well?
Does the print do anything when you use that spell?

Originally Posted by Duugu View Post
Oh. I was so sure about that. Well. At least I've learned something today. Thank you.
Yeah, I type my paths almost exclusively in lowercase and it's never an issue.

Forward and backslashes are normally interchangeable, I think the only time I've seen it be a problem was trying to load a font file and it required backslashes.
  Reply With Quote
01-24-14, 03:32 PM   #25
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Yes, it does write:
UNIT_SPELLCAST_SUCCEEDED Flying Serpent Kick

However, no sound plays.
  Reply With Quote
01-24-14, 03:34 PM   #26
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You're sure you have a sound file with that exact name, "Flying Serpent Kick.ogg"?

It's possible the sound file doesn't work?
  Reply With Quote
01-24-14, 03:35 PM   #27
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Yes, here is the copy of the file name: Flying Serpent Kick.ogg
Is it possible to write the spell ID instead of the name to make sure that game recognizes it?
  Reply With Quote
01-24-14, 03:38 PM   #28
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You could try copying one of the other sound files, giving it that name and seeing if it'll play that. That would tell you whether it's a problem with the sound file.

It could be rewritten to use the spellID instead, but it seems like this should work regardless.

Lua Code:
  1. local Channeled = { ['Fists of Fury'] = true }
  2. local Instants = {
  3.     ['Blackout Kick'] = true,
  4.     ['Expel Harm'] = true,
  5.     ['Flying Serpent Kick'] = true,
  6.     ['Grapple Weapon'] = true,
  7.     ['Resuscitate'] = true,
  8.     ['Rising Sun Kick'] = true,
  9.     ['Spear Hand Strike'] = true,
  10.     ['Spinning Crane Kick'] = true,
  11.     ['Tiger Palm'] = true,
  12.     ['Touch of Karma'] = true,
  13.     ['Zen Meditation'] = true,
  14.     ['Paralysis'] = true,
  15.     ['Fortifying Brew'] = true,
  16.     ['Touch of Death'] = true,
  17.     ['Tigereye Brew'] = true,
  18.     ['Arcane Shot'] = true,
  19. }
  20.  
  21. local f = CreateFrame('frame')
  22. f:RegisterUnitEvent('UNIT_SPELLCAST_CHANNEL_START', 'player')
  23. f:RegisterUnitEvent('UNIT_SPELLCAST_SUCCEEDED', 'player')
  24.  
  25. f:SetScript('OnEvent', function(self, event, unit, spellName, _, _, spellID)
  26.     if (event == 'UNIT_SPELLCAST_CHANNEL_START' and Channeled[spellID])
  27.     or (event == 'UNIT_SPELLCAST_SUCCEEDED' and Instants[spellID]) then
  28.         print(event, GetSpellInfo(spellID))
  29.         PlaySoundFile("Interface\\AddOns\\HokutoNoMonk\\sounds\\" .. spellID .. ".ogg", "SFX")
  30.     end
  31. end)

Just replace all of the names in the table and the sound files with their spellIDs.

For example flying serpent kick would be like [101545] = true (presumably).

Last edited by semlar : 01-24-14 at 03:42 PM.
  Reply With Quote
01-24-14, 03:39 PM   #29
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Sure, trying now.
Ok, you were right, it was actually coming from the sound file itself.

You know, you helped me a great deal here! I really spent a lot of time trying to fix this myself, to no avail.
So can i return the favor? I see you are a mod author, can i donate for one of your mods?
It would be my pleasure.

Last edited by Nuru0190 : 01-24-14 at 03:45 PM.
  Reply With Quote
01-24-14, 03:52 PM   #30
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Ah well I don't normally ask for donations but if you'd really like to here's a link to me on pledgie.

I just like helping people out around here.

If you have any other questions don't hesitate to ask!

Last edited by semlar : 01-24-14 at 03:57 PM.
  Reply With Quote
01-24-14, 03:58 PM   #31
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Truly, you have no idea how long i browsed the net and how long i tried to fix these issues by myself! ^^
You really helped a lot, here.

I just donated 10 bucks for your local coffee house
Hope it helps as much as you helped me!

Thank you very much, sir.
  Reply With Quote
01-24-14, 04:00 PM   #32
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Much appreciated.
  Reply With Quote
01-24-14, 04:44 PM   #33
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
I don't know if you're still around, but actually, i got an issue with the "Spinning Crane Kick". This time, it's this spell that has an eccho. It ecchoes 3 times.
All the other spells work perfectly, and i even added more sounds.

I think it's kind of like what you explained at the beginning of the thread, the spell is maybe made of 3 "parts" and the sound file plays once for each part. It ecchoes, even if the Spinning Crane Kick doesn't hit anything.

Could you tell me how to fix it?

Last edited by Nuru0190 : 01-24-14 at 04:50 PM.
  Reply With Quote
01-24-14, 04:53 PM   #34
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
If it's channeled you can try moving it to the table with fists of fury (and taking it out of the Instants table), I'm having a hard time identifying whether it's actually channeled from the description.

Lua Code:
  1. local Channeled = {
  2.     [113656] = true, -- Fists of Fury
  3.     [101546] = true, -- Spinning Crane Kick
  4. }
  Reply With Quote
01-24-14, 05:03 PM   #35
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
I already tried that, but i wrote it like this:

local Channeled = {
['Fists of Fury'] = true,
['Spinning Crane Kick'] = true,
}
(i deleted the Spinning Crane Kick in local instants)

Fists of Fury was still working, but not Spinning Crane Kick. The code you just gave me, however, doesn't work at all, neither for FoF nor SCK. Perhaps the spell is not channeled after all.
In the other code i first pasted in my original post, i didn't have this issue. Is it possible to take from that code to put into your code to make it work?
  Reply With Quote
01-24-14, 05:31 PM   #36
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I'll make a monk on the PTR later so I can check what events actually fire with the different abilities, I won't be home for at least another hour though.

You can type /etrace in-game to see what events are firing but it's probably going to be a little overwhelming.
  Reply With Quote
01-24-14, 05:36 PM   #37
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Ok, thank you much!
  Reply With Quote
01-24-14, 07:33 PM   #38
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I think this should do what you want.
Lua Code:
  1. local Channeled = {
  2.     [113656] = 'Fists of Fury',
  3. }
  4.  
  5. local Instants = {
  6.     [100784] = 'Blackout Kick',
  7.     [115072] = 'Expel Harm',
  8.     [101545] = 'Flying Serpent Kick',
  9.     [117368] = 'Grapple Weapon',
  10.     [115178] = 'Resuscitate',
  11.     [107428] = 'Rising Sun Kick',
  12.     [116705] = 'Spear Hand Strike',
  13.     [101546] = 'Spinning Crane Kick',
  14.     [100787] = 'Tiger Palm',
  15.     [122470] = 'Touch of Karma',
  16.     [115176] = 'Zen Meditation',
  17.     [115078] = 'Paralysis',
  18.     [115203] = 'Fortifying Brew',
  19.     [115080] = 'Touch of Death',
  20.     [116740] = 'Tigereye Brew',
  21. }
  22.  
  23. local f = CreateFrame('frame')
  24. f:RegisterUnitEvent('UNIT_SPELLCAST_CHANNEL_START', 'player')
  25. f:RegisterUnitEvent('UNIT_SPELLCAST_SUCCEEDED', 'player')
  26.  
  27. f:SetScript('OnEvent', function(self, event, unit, spellName, _, _, spellID)
  28.     if (event == 'UNIT_SPELLCAST_CHANNEL_START' and Channeled[spellID]) then
  29.         PlaySoundFile("Interface\\AddOns\\HokutoNoMonk\\sounds\\" .. Channeled[spellID] .. ".ogg", "SFX")
  30.     elseif (event == 'UNIT_SPELLCAST_SUCCEEDED' and Instants[spellID]) then
  31.         PlaySoundFile("Interface\\AddOns\\HokutoNoMonk\\sounds\\" .. Instants[spellID] .. ".ogg", "SFX")
  32.     end
  33. end)

Basically, Spinning Crane Kick is firing a UNIT_SPELLCAST_SUCCEEDED event for the spellID 101546 when it's cast, but it also periodically triggers the event with the spellID 107270 after that. The problem with using the spell name is they're all called the same thing.

The simple solution is probably to use the spellID for everything, with the added bonus that it doesn't have to be localized, but you might have to double check that the IDs are accurate because I just went through and pulled the most likely candidates off of wowhead.

Last edited by semlar : 01-24-14 at 07:55 PM.
  Reply With Quote
01-24-14, 07:46 PM   #39
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by semlar View Post
You can type /etrace in-game to see what events are firing but it's probably going to be a little overwhelming.
After typing "/etrace" do some random stuff -- mouse over players, cast a spell, etc -- and click the "X" button next to each even you don't care about, before you go do your actual test. Even if you can eliminate a few of the spammiest events -- COMBAT_LOG_EVENT_UNFILTERED, SPELLS_CHANGED, CURSOR_UPDATE, etc. -- what's left will be much more usable.
__________________
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
01-25-14, 01:42 AM   #40
Nuru0190
A Fallenroot Satyr
Join Date: Jan 2014
Posts: 24
Thanks semlar,
Juste woke up (i live in France), gonna try this right now.

Alright, it works flawlessly!
It's really good because even for spells such as Flying Serpent Kick, i had the voice file triggered twice: once when i use the FSK and a second time when i click the spell again to land for the AoE snare effect. Basically, i had the 2 voice files playing with 1 or 2 seconds delay.
Your new code fixes all.

Since i added new spells since the last time, i'm gonna add them again with their IDs.

Last edited by Nuru0190 : 01-25-14 at 02:07 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » HELP: An eccho issue with a sound addon


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