DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

(Help) Chaning In-game Music when you face a boss
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 13 Sep 2018

Topics: 97
Posts: 1508
Location: New Jersey
usa.gif

PostPosted: Wed Sep 04, 2013 7:32 am
   Subject: (Help) Chaning In-game Music when you face a boss
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I know there is a TUT for this here

http://diehardwolfers.areyep.com/viewtopic.php?t=4663&highlight=music

But Combinding with the Advance Sound Manager Seems Hard....I need help with this....does anyone has Any Ideas?

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
WSJ
DieHard Officer
DieHard Officer


Joined: 17 Apr 2004
Last Visit: 08 May 2017

Topics: 24
Posts: 521

blank.gif

PostPosted: Wed Sep 04, 2013 9:33 am
   Subject: (Help) Chaning In-game Music when you face a boss
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Once you've added AlumiuN's advanced sound manager and got it to work, go into wl_def.h and look for:

::: CODE :::

    short       health;


Under that line, add this:

::: CODE :::

    short       music;


Then further down, find this:

::: CODE :::

void    ContinueMusic(int offs);


Below that line, add these ones:

::: CODE :::

void    ChangeGameMusic(int song);
void    SetLevelMusic(void);


In wl_play.cpp, go down to this:

::: CODE :::

void StartMusic ()
{
    SD_MusicOff ();
    lastmusicchunk = (musicnames) songs[gamestate.mapon + gamestate.episode * 10];
    SD_StartMusic(STARTMUSIC + lastmusicchunk);
}

void ContinueMusic (int offs)
{
    SD_MusicOff ();
    lastmusicchunk = (musicnames) songs[gamestate.mapon + gamestate.episode * 10];
    SD_ContinueMusic(STARTMUSIC + lastmusicchunk, offs);
}


and replace it with this:

::: CODE :::

void StartMusic ()
{
    SD_MusicOff ();
    lastmusicchunk = (musicnames) (gamestate.music);
    SD_StartMusic(STARTMUSIC + lastmusicchunk);
}

void ContinueMusic (int offs)
{
    SD_MusicOff ();
    lastmusicchunk = (musicnames) (gamestate.music);
    SD_ContinueMusic(STARTMUSIC + lastmusicchunk, offs);
}

void ChangeGameMusic (int song)
{
    if (gamestate.music == song || song >= LASTMUSIC)
        return;

    StopMusic ();
    gamestate.music = song;
    StartMusic ();
}

void SetLevelMusic (void)
{
    gamestate.music = songs[gamestate.mapon+gamestate.episode*10];
}


In wl_game.cpp, go down to this in the SetupGameLevel function:

::: CODE :::

            = pwallstate = pwallpos = facetimes = 0;


Below that, add:

::: CODE :::

        SetLevelMusic ();


Now to use this feature, all you have to do is put a ChangeGameMusic(SONGNAME_MUS); line where you want the music to change. So for example, if you wanted it to change to "Ultimate Conquest" when Hans gets alerted, you'd go into wl_state.cpp and do this:

::: CODE :::

        case bossobj:
            SD_PlaySound(GUTENTAGSND);
            ChangeGameMusic(ULTIMATE_MUS);
            NewState (ob,&s_bosschase1);
            ob->speed = SPDPATROL*3;        // go faster when chasing player
            break;


I hope this tutorial will be helpful.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 10853 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2998 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 3286 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3204 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3264 Tue May 06, 2008 1:15 pm
Ripper View latest post
 
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


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group