music scripts are not working.

Started by axloo7, Wed 28/05/2008 16:14:19

Previous topic - Next topic

axloo7

When I tri to use the play music script it dos not come up with a script error. I have check every thing that the tutorials sad to check. But when I start mi game it fades in but there is no back grand music. Can some one help me this has bean bugging mi for days and I need to get this dun for school. Pleas reply.

Gilbert

Please post your exact scripts here, other we can't find out what's wrong by just guessing. :P

axloo7

// room script file

function hHotspot1_WalkOn()
{
player.ChangeRoom(2, 140, 140);
}

function hHotspot2_Look()
{
Display("a tabe.");
}

function hHotspot3_Look()
{
Display("looks cozy.");
}

function hHotspot4_Look()
{
Display("hi def tv.");
}

function hHotspot5_WalkOn()
{
player.ChangeRoom(3, 140, 140);
}

function hHotspot1_Look()
{
Display("to a place");
}


Khris

There's no command in there related to music. Did you set room/specific music in the editor?

Make sure that
-the file is inside the Music dir
-is called e.g. music2.mp3, NOT music02.mp3 or my_piece2.mp3
-is actually what the extension says (although this might not matter to AGS)
-you didn't mute sound somewhere (check Windows' audio prefs)
-is called music2.mp3, NOT music2.mp3.mp3

axloo7

I did what you sad and it still dos not work. I have made sure that I’m not muting because I’m listening to music wile I right mi script (no it’s not mi music that’s making me not hear it.). This is mi script now (the name of the music MP3 is “music1.MP3”
________________________________________________________________________


// room script file

function hHotspot1_WalkOn()
{
player.ChangeRoom(2, 140, 140);
}

function hHotspot2_Look()
{
Display("a tabe.");
}

function hHotspot3_Look()
{
Display("looks cozy.");
}

function hHotspot4_Look()
{
Display("hi def tv.");
}

function hHotspot5_WalkOn()
{
player.ChangeRoom(3, 140, 140);
}

function hHotspot1_Look()
{
Display("to a place");
}


function room_AfterFadeIn()
{
PlayMP3File("music1.MP3");
}                   not a script error

OneDollar

The command you want is PlayMusic(1); not PlayMP3File. From the manual:
Quote
PlayMP3File

Since normally MP3 files are built into the MUSIC.VOX file, there may be occasions where you want one MP3 (for example, the intro music) to be distributed with your main game rather than the music pack. So, this function allows you to play any named MP3 or OGG file. However, you will have to bundle the file separately in your game distribution (it is not automatically compiled into the EXE)

PlayMusic(1) will play the first file it finds in the music folder called music1.ogg, music1.mp3, music1.mid, music1.mod or music1.xm, and when your game is compiled the contents of the music folder will be bundled into music.vox ready to be distributed with your game.

Also, and somebody can correct me if I'm wrong about this, but I think a file called music1.whatever will be played automatically when your game starts, so if you don't want that you should call it music2.mp3 instead.

Khris



SMF spam blocked by CleanTalk