Frictional Games Forum (read-only)
[SCRIPT] Music don't start in script - 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: [SCRIPT] Music don't start in script (/thread-29617.html)



Music don't start in script - MaksoPL - 02-15-2015

I've maked script to play music in area, and it's don't work.
Callback: AddEntityCollideCallback("Player","grunt_music","Monster1_Music",false,1);
Void: void Monster1_Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("12_event_blood",true,1,01,1.0,true);
}
What's wrong?


RE: Music don't start in script - PutraenusAlivius - 02-15-2015

PlayMusic("12_event_blood",true,1,01,1.0,true);

Use dots, not commas.


RE: Music don't start in script - MrBehemoth - 02-18-2015

That's not exactly the problem.

MaksoPL, check the values you're using and the order you're using them in.

Remember, a float is a real number with a decimal fraction, and it always has a point (.) and ends in f. An int (integer) is a whole number with no fraction. E.g.:

Code:
float a = 1.0f;
float b = -0.5f;
float c =  3.1415926535f;

int x = 1;
int y = 0;
int z = -999;

void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

I think your line of code should probably be this:

Code:
PlayMusic("12_event_blood", true, 1.0f, 1.0f, 1, true);