Help with general modifications!
Help with general modifications!
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.
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.
Full Mailbox
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
Kayde Of Kargath
REJECTIONS!
Rollie,
I have no way to send you the changes to all the mod as you requested. I continuously get a rejection from server:
Kayde Of Kargath
I have no way to send you the changes to all the mod as you requested. I continuously get a rejection from server:
It's killin me! I have everything all finalized for your review, but can't get it to ya!This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
rollie@warcraftrealms.com
Kayde Of Kargath
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.
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.
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.
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.
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?)
\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?)
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.
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...
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)
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...
