Help with general modifications!

Info on other Mods that I have written/created/updated
Guest

Help with general modifications!

Post 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.

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post 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.
phpbb:phpinfo()

Guest

ENROUTE!

Post 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

Guest

tables

Post 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

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Full Mailbox

Post 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

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

phpbb:phpinfo()

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post by Kayde »

aye, that is the one.

Kayde Of Kargath

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

REJECTIONS!

Post 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

California

Post 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?

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Yes, but only by hacking the current version by making the changes suggested above.

I may adjust this in a future version.
phpbb:phpinfo()

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post 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. :)

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post 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!
phpbb:phpinfo()

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post 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.

California

Post 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 :)

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post 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.

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Thanks for that walk through Kayde =)
phpbb:phpinfo()

California

Post 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?)

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post 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&#58; Interface\AddOns\MKombat\MKombat.lua
Line&#58; 166
Count&#58; 1
Error&#58;  attempt to index field `?' &#40;a nil value&#41;
--------------------------------------------------
File&#58; Interface\AddOns\MKombat\MKombat.lua
Line&#58; 174
Count&#58; 2
Error&#58;  attempt to index field `?' &#40;a nil value&#41;
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... :wink:

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post 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.

Kayde
Posts: 20
Joined: Sun Aug 07, 2005 3:14 pm

Post by Kayde »

Been out-of-the-loop for a few days now due to post-Labor Day recovery efforts. :D

I still intend to persue this fix, just not sure when I will have the time to attack it.

Post Reply