Frictional Games Forum (read-only)
music error - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: music error (/thread-17866.html)

Pages: 1 2


music error - tokugawa1 - 08-20-2012

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");
}


RE: music error - lolmaster - 08-20-2012

.snt is for sounds. You cannot use PlayMusic on a sound file.


RE: music error - tokugawa1 - 08-20-2012

(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


RE: music error - Robby - 08-20-2012

(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.


RE: music error - Your Computer - 08-20-2012

Read it again: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#sounds_music

PlayMusic takes only one string.


RE: music error - tokugawa1 - 08-20-2012

(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


RE: music error - Mackiiboy - 08-20-2012

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);


RE: music error - tokugawa1 - 08-20-2012

(08-20-2012, 08:34 PM)Your Computer Wrote: Read it again: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#sounds_music

PlayMusic takes only one string.
ok after doing that i can play the map (no error) but i cant hear the music


RE: music error - Adny - 08-20-2012

Your volume is set at 0, try putting it to 1.0f.


RE: music error - tokugawa1 - 08-20-2012

(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?