Frictional Games Forum (read-only)

Full Version: music error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When i launch my map i get an error that says:
main (11,1) ERR: No matching signatures to "PlayMusic(string@&in,string@&in,const bool, const double, const uint, const bool)

Here is my script:

void OnStart()
{
AddEntityCollideCallback("Player", "CheapScare", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction_two", true, 1);
AddUseItemCallback("", "key_study_1", "castle_4","UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Music_1", "PlayMusic", true, 1);
}

void PlayMusic(string&in asParent, string &in asChild, int alState)
{
PlayMusic("", "scary.snt", true, 0.0, 2, 0, true);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
}

void MonsterFunction_two(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_4", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_4", 0.0f, false);
RemoveItem("key_study_1");
}
.snt is for sounds. You cannot use PlayMusic on a sound file.
(08-20-2012, 08:20 PM)lolmaster Wrote: [ -> ].snt is for sounds. You cannot use PlayMusic on a sound file.
i changed that to "music.ogg" and i still have the same problem
(08-20-2012, 08:26 PM)tokugawa1 Wrote: [ -> ]
(08-20-2012, 08:20 PM)lolmaster Wrote: [ -> ].snt is for sounds. You cannot use PlayMusic on a sound file.
i changed that to "music.ogg" and i still have the same problem
Try taking the ".ogg" away. If it doesn't work, put it back, then restart the game.
Read it again: http://wiki.frictionalgames.com/hpl2/amn...unds_music

PlayMusic takes only one string.
(08-20-2012, 08:28 PM)Nemet Robert Wrote: [ -> ]
(08-20-2012, 08:26 PM)tokugawa1 Wrote: [ -> ]
(08-20-2012, 08:20 PM)lolmaster Wrote: [ -> ].snt is for sounds. You cannot use PlayMusic on a sound file.
i changed that to "music.ogg" and i still have the same problem
Try taking the ".ogg" away. If it doesn't work, put it back, then restart the game.
still not working
As YC said, "PlayMusic takes only one string", which means, you can't have two of them.

Remove the red-marked string from PlayMusic:
PlayMusic("", "scary.ogg", true, 0.0, 2, 0, true);

It should be:
PlayMusic("scary.ogg", true, 0.0, 2, 0, true);
(08-20-2012, 08:34 PM)Your Computer Wrote: [ -> ]Read it again: http://wiki.frictionalgames.com/hpl2/amn...unds_music

PlayMusic takes only one string.
ok after doing that i can play the map (no error) but i cant hear the music
Your volume is set at 0, try putting it to 1.0f.
(08-20-2012, 08:46 PM)andyrockin123 Wrote: [ -> ]Your volume is set at 0, try putting it to 1.0f.
still not working. Well the audio file was mp3 and i changed it to .ogg does that make any difference?
Pages: 1 2