Frictional Games Forum (read-only)

Full Version: Music don't start in script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
PlayMusic("12_event_blood",true,1,01,1.0,true);

Use dots, not commas.
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);