WarcraftReamls.com
  FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister 
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 
Help with general modifications!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> Other Mods
View previous topic :: View next topic  
Author Message
Guest








PostPosted: Thu Aug 04, 2005 7:29 pm    Post subject: Help with general modifications! Reply with quote

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.
Back to top
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Thu Aug 04, 2005 10:13 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Guest








PostPosted: Fri Aug 05, 2005 10:17 am    Post subject: ENROUTE! Reply with quote

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
Back to top
Guest








PostPosted: Fri Aug 05, 2005 10:20 am    Post subject: tables Reply with quote

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
Back to top
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Sun Aug 07, 2005 3:26 pm    Post subject: Full Mailbox Reply with quote

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
Back to top
View user's profile Send private message
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Sun Aug 07, 2005 5:06 pm    Post subject: Reply with quote

you sent to rollie@warcraftrealms.com ?
Back to top
View user's profile Send private message Visit poster's website
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Sun Aug 07, 2005 7:59 pm    Post subject: Reply with quote

aye, that is the one.

Kayde Of Kargath
Back to top
View user's profile Send private message
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Wed Aug 10, 2005 4:18 pm    Post subject: REJECTIONS! Reply with quote

Rollie,

I have no way to send you the changes to all the mod as you requested. I continuously get a rejection from server:

Quote:
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
Back to top
View user's profile Send private message
California
Guest







PostPosted: Tue Aug 30, 2005 2:30 pm    Post subject: Reply with quote

It couldn't get the code above to work.
Is there any way to make multiple choices of sounds when targeting a hostile player?
Back to top
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Tue Aug 30, 2005 4:05 pm    Post subject: Reply with quote

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

I may adjust this in a future version.
Back to top
View user's profile Send private message Visit poster's website
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Tue Aug 30, 2005 8:55 pm    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Tue Aug 30, 2005 8:56 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Tue Aug 30, 2005 9:06 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
California
Guest







PostPosted: Wed Aug 31, 2005 5:16 am    Post subject: Reply with quote

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


Sounds great! Can't wait Smile
Back to top
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Wed Aug 31, 2005 6:17 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Wed Aug 31, 2005 6:44 am    Post subject: Reply with quote

Thanks for that walk through Kayde =)
Back to top
View user's profile Send private message Visit poster's website
California
Guest







PostPosted: Thu Sep 01, 2005 5:58 am    Post subject: Reply with quote

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?)
Back to top
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Fri Sep 02, 2005 6:37 am    Post subject: Reply with quote

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:
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. Sad

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
Back to top
View user's profile Send private message
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Fri Sep 02, 2005 6:39 am    Post subject: Reply with quote

Notepad is perfectly fine to use. In fact, I still use that and Wordpad quite often as I have become habitual with them.
Back to top
View user's profile Send private message
Kayde



Joined: 07 Aug 2005
Posts: 20

WR Updates: 811
Kayde WR Profile

PostPosted: Thu Sep 08, 2005 7:54 am    Post subject: Reply with quote

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

I still intend to persue this fix, just not sure when I will have the time to attack it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> Other Mods All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
WarcraftRealms.com  


Powered by phpBB © 2001, 2005 phpBB Group