Deus Ex: Changing music with Order(?) Command

Dedicated to the discussion of OTP and Deus Ex in general.

Moderators: Master_Kale, TNM Team

Post Reply
User avatar
Lucius DeBeers
Thug
Posts: 16
Joined: Sun Mar 15, 2009 5:10 am

Deus Ex: Changing music with Order(?) Command

Post by Lucius DeBeers »

Hi everyone. I'm playing Deus Ex again and I forgot what the command was to change the in-game music manually. I believe it has Order 1, Order 2, Order 3; for ambient, action, death, conversation etc. but I don't have the command right, can't get it to work. How do I write it? I want to hear the various music and not just ambience while I'm fiddling around in the game. I searched online and couldn't find the command.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Deus Ex: Changing music with Order(?) Command

Post by bjorn98009_91 »

Take a look at the UpdateDynamicMusic function in DeusExPlayer in DeusEx.u
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
Lucius DeBeers
Thug
Posts: 16
Joined: Sun Mar 15, 2009 5:10 am

Re: Deus Ex: Changing music with Order(?) Command

Post by Lucius DeBeers »

I have taken a look at the section you mentioned and none of the phrases I've tried are working. It's been too many years for me to remember what it was, I'm afraid.
// ----------------------------------------------------------------------
// UpdateDynamicMusic()
//
// Pattern definitions:
// 0 - Ambient 1
// 1 - Dying
// 2 - Ambient 2 (optional)
// 3 - Combat
// 4 - Conversation
// 5 - Outro
// ----------------------------------------------------------------------

function UpdateDynamicMusic(float deltaTime)
{
local bool bCombat;
local ScriptedPawn npc;
local Pawn CurPawn;
local DeusExLevelInfo info;

if (Level.Song == None)
return;

//== Hacky attempt to fix the load music errors

// DEUS_EX AMSD In singleplayer, do the old thing.
// In multiplayer, we can come out of dying.
if (!PlayerIsClient())
{
if ((musicMode == MUS_Dying) || (musicMode == MUS_Outro))
return;
}
else
{
if (musicMode == MUS_Outro)
return;
}


musicCheckTimer += deltaTime;
musicChangeTimer += deltaTime;

if (IsInState('Interpolating'))
{
// don't mess with the music on any of the intro maps
info = GetLevelInfo();
if ((info != None) && (info.MissionNumber < 0))
{
musicMode = MUS_Outro;
return;
}

if (musicMode != MUS_Outro)
{
ClientSetMusic(Level.Song, 5, 255, MTRAN_FastFade);
musicMode = MUS_Outro;
}
}
else if (IsInState('Conversation'))
{
if (musicMode != MUS_Conversation)
{
// save our place in the ambient track
if (musicMode == MUS_Ambient)
savedSection = SongSection;
else
savedSection = 255;

ClientSetMusic(Level.Song, 4, 255, MTRAN_Fade);
musicMode = MUS_Conversation;
}
}
else if (IsInState('Dying'))
{
if (musicMode != MUS_Dying)
{
ClientSetMusic(Level.Song, 1, 255, MTRAN_Fade);
musicMode = MUS_Dying;
}
}
else
{
// only check for combat music every second
if (musicCheckTimer >= 1.0)
{
musicCheckTimer = 0.0;
bCombat = False;

// check a 100 foot radius around me for combat
// XXXDEUS_EX AMSD Slow Pawn Iterator
//foreach RadiusActors(class'ScriptedPawn', npc, 1600)
for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
npc = ScriptedPawn(CurPawn);
if ((npc != None) && (VSize(npc.Location - Location) < (1600 + npc.CollisionRadius)))
{
if ((npc.GetStateName() == 'Attacking') && (npc.Enemy == Self))
{
bCombat = True;
break;
}
}
}

if (bCombat)
{
if (musicMode != MUS_Combat)
{
// save our place in the ambient track
if (musicMode == MUS_Ambient)
savedSection = SongSection;
else
savedSection = 255;

if(musicChangeTimer >= 20.0)
ClientSetMusic(Level.Song, 3, 255, MTRAN_Instant);
else
ClientSetMusic(Level.Song, 3, 255, MTRAN_FastFade);
musicMode = MUS_Combat;
}

musicChangeTimer = 0.0;
}
else if (musicMode != MUS_Ambient)
{
// wait until we've been out of combat for 5 seconds before switching music
if (musicChangeTimer >= 5.0)
{
// use the default ambient section for this map
if (savedSection == 255)
savedSection = Level.SongSection;

if(musicChangeTimer >= 20.0)
ClientSetMusic(Level.Song, savedSection, 255, MTRAN_Instant);
// fade slower for combat transitions
else if (musicMode == MUS_Combat)
ClientSetMusic(Level.Song, savedSection, 255, MTRAN_SlowFade);
else
ClientSetMusic(Level.Song, savedSection, 255, MTRAN_Fade);

savedSection = 255;
musicMode = MUS_Ambient;
musicChangeTimer = 0.0;
}
}
}
}
}

function SetMusicMode(string TMusicMode)
{
switch(TMusicMode)
{
case "1":
MusicMode = MUS_Combat;
break;
case "2":
MusicMode = MUS_Conversation;
break;
case "3":
MusicMode = MUS_Outro;
break;
case "4":
MusicMode = MUS_Dying;
break;
case "0":
default:
MusicMode = MUS_Ambient;
break;
}
}

// ----------------------------------------------------------------------
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Deus Ex: Changing music with Order(?) Command

Post by bjorn98009_91 »

Well it should be as easy as calling:

Code: Select all

ClientSetMusic(Level.Song, 0, 255, MTRAN_FastFade);
Level.Song will use the song already specified in the map, you can use another song if you like by loading in dynamically like this.

Code: Select all

LevelSong = Music(DynamicLoadObject(SongString, class'Music'));
The second parameter in ClientSetMusic is the song section, the definitions you saw in the file. Number 0 is ambient.
The third parameter is CDTrack, not really sure what this does but it's always 255.
And the last parameter is the transition type, like if you want a fast fade, a slow fade, instant transition or whatever.

There seems to be a trigger called MusicEvent that allows you to change music from the map. Haven't tried it so don't know how it works.
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
Lucius DeBeers
Thug
Posts: 16
Joined: Sun Mar 15, 2009 5:10 am

Re: Deus Ex: Changing music with Order(?) Command

Post by Lucius DeBeers »

I simply want to play the different music types that are already assigned to each map in Deus Ex. All I've gotten from typing these phrases (along with 0, 1, 2 ,3) in with Teamsay or Say is "unrecognized command". I'm doing this in Deus Ex: Revision, by the way. I'm sorry, but can you write simply and plainly, or literally step by step what I have to do? I blame the asperger-like temperament of mine for the lack of understanding. I appreciate your help.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Deus Ex: Changing music with Order(?) Command

Post by bjorn98009_91 »

I don't think it's possible to change it via the console, as there is no exec method for that. What version of Revision are you playing? The 1.3.1 demo?
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
Lucius DeBeers
Thug
Posts: 16
Joined: Sun Mar 15, 2009 5:10 am

Re: Deus Ex: Changing music with Order(?) Command

Post by Lucius DeBeers »

Well, I guess none of us knows how to switch the track to the different ones for the corresponding maps. I am using Revision demo 1.3 (alongside shifterplus). I did use a console command to perform such function many years ago, I saw someone mention it in planetdeusex forum or something back then. I don't know of an "exec method". Oh well, Thanks for trying to help.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Deus Ex: Changing music with Order(?) Command

Post by bjorn98009_91 »

Oh you can always switch music via the legend cheat. Just type legend, then Play Music.
Producer and Quality Assurance Manager for Deus Ex: Revision.
Post Reply