(02-24-2011, 08:56 PM)junkfood2121 Wrote: I'm still relatively new to scripting, how do you make an area where the music only plays if ur in it?
Make a Script Area in the level editor, then in your .hps file you would add an EntityCollideCallback making it play the music when the player is in the area. Something like
OnEnter()
{
AddEntityCollideCallback("Player", "name_of_script_area", "name_of_function_", true, 1);
}
Then your function would be
void Name_of_Function (string &in asParent, string &in asChild, int alState)
{
PlayMusic("Name_of_music_file", true, 1, 1, 1, true);
}
That probably won't work exactly as intended, but it should give you a solid basis to work off of.