Page 1 of 2
Help with general modifications!
Posted: Thu Aug 04, 2005 7:29 pm
by Guest
Rollie! Love your mod!
I have been playing around with things and developed a Star Wars Soundpack. One thing that I did in this soundpack is add a table for targeting opponents, so that a random sound will play each time you select someone.
As you probably realize, this fubar's all the other soundpacks due to the calling out of the table. I would like to fix this so that the MKombat.lua performs a check for what is in the soundpack, and then acts accordingly.
What I have done as a temp work around is change all the other soundpacks to reflect the addition of said table in their files. However, this isn't going to be convient for everyone else that has downloaded previous versions.
I would love to share this soundpack with everyone in the near future for WE ARE WAY OVERDUE FOR SOME NEW SOUNDPACKS! LOL
Here is the code I changed.
under:
elseif (event == "PLAYER_TARGET_CHANGED") then
from:
MKombat_PlayFile( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] );
end
to:
if( table.getn( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] ) ~= 0 ) then
local randomNum = math.random(1, table.getn( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] ) );
MKombat_PlayFile( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"][randomNum] );
end
In the soundpack file (SW.lua), I changed the script to a "table.insert" callout for each sound.
I'm sure you see the issue here. What do you suggest? I'd be happy to email you my soundpack for review if you like.
Posted: Thu Aug 04, 2005 10:13 pm
by Rollie
I'd love to see it =)
And yes, I believe it would be smart to change all sounds to be expected to be in tables instead of individual clips. That was shortsighted on my part.
ENROUTE!
Posted: Fri Aug 05, 2005 10:17 am
by Guest
I just finihsed sending the file. HUGE file! Almost 8M zipped.
Note that I made a lot of changes. But the email explains those. Use at your disgression (sp?).
-Kayde of Kargath
tables
Posted: Fri Aug 05, 2005 10:20 am
by Guest
Regarding the tables for all sounds, I believe that not all of them should have them available. It may not be necessary for many cases.
-Kayde of Kargath
Full Mailbox
Posted: Sun Aug 07, 2005 3:26 pm
by Kayde
Your MB is full! My client will continue to attempt to send the mod through in the meantime, but will time out after a period of time (unkown to me what this is exactly).
Kayde Of Kargath
Posted: Sun Aug 07, 2005 5:06 pm
by Rollie
Posted: Sun Aug 07, 2005 7:59 pm
by Kayde
aye, that is the one.
Kayde Of Kargath
REJECTIONS!
Posted: Wed Aug 10, 2005 4:18 pm
by Kayde
Rollie,
I have no way to send you the changes to all the mod as you requested. I continuously get a rejection from server:
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
rollie@warcraftrealms.com
It's killin me! I have everything all finalized for your review, but can't get it to ya!
Kayde Of Kargath
Posted: Tue Aug 30, 2005 2:30 pm
by California
It couldn't get the code above to work.
Is there any way to make multiple choices of sounds when targeting a hostile player?
Posted: Tue Aug 30, 2005 4:05 pm
by Rollie
Yes, but only by hacking the current version by making the changes suggested above.
I may adjust this in a future version.
Posted: Tue Aug 30, 2005 8:55 pm
by Kayde
I really didnt spell out how to do the exact changes that I had made. I will in the next couple days and post a step-by-step here for that hack alone.
With Rollie's permission of course.

Posted: Tue Aug 30, 2005 8:56 pm
by Rollie
Sure =)
I'll be incorporating some of your changes in the next version so in the future folks will hopefully not have any trouble with this!
Posted: Tue Aug 30, 2005 9:06 pm
by Kayde
Im humbled to hear that!
I haven't sent you an updated working version of the changes simply because I've not played a lot lately. I'm stationed in Canada atm and have limited access to a decent connection to play. Therefore, I've been unable to test the PVP battles and correct what I broke there.
Hopefully you've had time to test and/or change those issues.
Posted: Wed Aug 31, 2005 5:16 am
by California
Kayde wrote:I really didnt spell out how to do the exact changes that I had made. I will in the next couple days and post a step-by-step here for that hack alone.
With Rollie's permission of course.

Sounds great! Can't wait

Posted: Wed Aug 31, 2005 6:17 am
by Kayde
Okay, here we go.
IN THE "MKombat.lua" FILE:
UNDER:
function MKombat_OnEvent()
FIND:
elseif (event == "PLAYER_TARGET_CHANGED") then
REPLACE:
MKombat_PlayFile( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] );
WITH:
if( table.getn( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] ) ~= 0 ) then
local randomNum = math.random(1, table.getn( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"] ) );
MKombat_PlayFile( g_MKombat_Packs[MK_CurrentPack]["ENEMY_TARGET"][randomNum] );
end
---[This sets up the function to randomly play a variety of sounds in the event of targeting a mob]---
NEXT IN THE "mk.lua" FILE:
UNDER:
-- Played when you target an enemy player or duel target
REPLACE:
MK_Pack["ENEMY_TARGET"] = "Interface\\AddOns\\MKombat\\Sounds\\destiny.wav";
WITH:
table.insert( MK_Pack["ENEMY_TARGET"], "Interface\\AddOns\\MKombat\\Sounds\\destiny.wav" );
---[This replaces the regular file pathing with a table, and gives the proper realtion to the code inputed in the MKombat.lua file.]---
All you need to do now is add addtional tabled sounds to the file. For instance, if you also wanted to hear "Test your might!" played, add that file path directly underneath the above replaced text. It will then look like this:
table.insert( MK_Pack["ENEMY_TARGET"], "Interface\\AddOns\\MKombat\\Sounds\\destiny.wav" );
table.insert( MK_Pack["ENEMY_TARGET"], "Interface\\AddOns\\MKombat\\Sounds\\TYM.wav" );
Now, every time you target something, it will randomly play either "Choose your destiny!" or "Test your might!". Keep in mind that because it is random, it *could* play the same sound several times in a row. Just add more sounds to give a wider variety!
Enjoy!
<edit>
Also note that you will need to modify all the other soundpacks in the same manner in order for this to work correctly. If you don't, you will receive an error upon world entry, and none will work. What I'm speaking of is this:
IN THE "ut.lua" FILE:
UNDER:
-- Played when you target an enemy player or duel target
REPLACE:
UT_Pack["ENEMY_TARGET"] = soundPath .. "prepare.wav";
WITH:
table.insert( UT_Pack["ENEMY_TARGET"], soundPath .. "prepare.wav" );
And do the same for the "ap.lua" (Austin Powers) as well.
Posted: Wed Aug 31, 2005 6:44 am
by Rollie
Thanks for that walk through Kayde =)
Posted: Thu Sep 01, 2005 5:58 am
by California
I still get errors trying to use this ingame.
\Interface\Addons\MKombat\MK.lua:25: bad argument #1 to `insert' (table expected, got nil)
shows shortly after logon, while
\Interface\Addons\MKombat\MKombat.lua:178: attempt to index field `?' (a nil value)
appears each time i target something.
I don't know how to combat these errors, so any help would be appreciated.
(i used Notebook to alter the code by the way. Should I use something else?)
Posted: Fri Sep 02, 2005 6:37 am
by Kayde
There sems to be a problem with the orginal addon. Sorry Rollie...
I downloaded the MKombat-1500-2.1.zip from Rollie's page and installed that as is, WITHOUT any of my modifications and I'm getting errors too. Not sure why that one doesn't work by itself, but something is broken.
Code: Select all
File: Interface\AddOns\MKombat\MKombat.lua
Line: 166
Count: 1
Error: attempt to index field `?' (a nil value)
--------------------------------------------------
File: Interface\AddOns\MKombat\MKombat.lua
Line: 174
Count: 2
Error: attempt to index field `?' (a nil value)
I will look into this today. I cannot promise a result by days end (or by the holidays end as we are headed into Labor Day weekend here in the US), but I will find out why the orginal is broken hopefully and in turn, fix my changes as well.
Sorry for the inconvienence.
I know my changes were made to MKombat-1300-2[1].0, if that helps at all. I will assist with the fixes on this version.
Unless Rollie beats me to it...

Posted: Fri Sep 02, 2005 6:39 am
by Kayde
Notepad is perfectly fine to use. In fact, I still use that and Wordpad quite often as I have become habitual with them.
Posted: Thu Sep 08, 2005 7:54 am
by Kayde
Been out-of-the-loop for a few days now due to post-Labor Day recovery efforts.
I still intend to persue this fix, just not sure when I will have the time to attack it.