[request] Random deck also has opponentID's music

All suggestions and feature requests to improve wagic.
Sub forums Card Coding & Parser ,Game Mode ,Deck Editor
Locked
parko
Posts: 3
Joined: Tue Jul 19, 2011 7:53 am

[request] Random deck also has opponentID's music

Post by parko »

There is a feature I want to request:

Random deck also has opponentID's music.

the old one is currently:
//start of in game music code
musictrack = "";
//check opponent id and choose the music track based on it
if (OpponentsDeckid)
{
char temp[4096];
sprintf(temp, "ai_baka_music%i.mp3", OpponentsDeckid);
musictrack.assign(temp);
}
else if (mParent->gameType == GAME_TYPE_CLASSIC)
musictrack = "ai_baka_music.mp3";

else if (mParent->gameType == GAME_TYPE_MOMIR)
musictrack = "ai_baka_music_momir.mp3";
else if (mParent->gameType == GAME_TYPE_RANDOM1 || mParent->gameType == GAME_TYPE_RANDOM2) musictrack
= "ai_baka_music_random.mp3";

if (!MusicExist(musictrack)) musictrack = "ai_baka_music.mp3";

GameApp::playMusic(musictrack);

but this will not play my assigned opponentID's music when I use random AI deck option. So I want to change it to this:
//start of in game music code
musictrack = "";
//check opponent id and choose the music track based on it
if (OpponentsDeckid)
{
char temp[4096];
sprintf(temp, "ai_baka_music%i.mp3", OpponentsDeckid);
musictrack.assign(temp);
}
else if (mParent->gameType == GAME_TYPE_CLASSIC)
{
char temp[4096];
sprintf(temp, "ai_baka_music%i.mp3", OpponentsDeckid);
musictrack.assign(temp);
}

else if (mParent->gameType == GAME_TYPE_MOMIR)
musictrack = "ai_baka_music_momir.mp3";
else if (mParent->gameType == GAME_TYPE_RANDOM1 || mParent->gameType == GAME_TYPE_RANDOM2) musictrack
= "ai_baka_music_random.mp3";

if (!MusicExist(musictrack)) musictrack = "ai_baka_music.mp3";

GameApp::playMusic(musictrack);
Last edited by parko on Tue Jul 19, 2011 8:35 am, edited 1 time in total.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [request] Random deck also has opponentID's music

Post by Zethfox »

i might just be really bad at playing "spot the difference" but i can't see the changes between the first box and the 2nd one..want to seperate it with smileys, bold charectors, different colors, anything so i can see it better?
parko
Posts: 3
Joined: Tue Jul 19, 2011 7:53 am

Re: [request] Random deck also has opponentID's music

Post by parko »

Fixed. Using quote instead of code box. looks a bit messy, but I think I could get my point across this time.
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: [request] Random deck also has opponentID's music

Post by wololo »

I hope you're not a programmer.
If you're a dev, you have 5 seconds to find the obvious bug in your code suggestion ;)

Edit: your request makes sense, but your code suggestion is not how this can be coded.
parko
Posts: 3
Joined: Tue Jul 19, 2011 7:53 am

Re: [request] Random deck also has opponentID's music

Post by parko »

welp. looks like I'm too careless. yeah. I see that.
but, well, you understand me anyway. So yeah.
Locked