RE: How do I script this?
Use AddEntityCollideCallback and timers. The script would look like this:
void OnStart()
{
AddEntityCollideCallback("Player", "nameofScriptArea", "spawnmonster", true, 1);
}
void spawnmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Nameofmonster", true);
AddEnemyPatrolNode("Nameofmonster", "PathNodeArea_1", 0, "");
AddTimer("playsound", 10, "PlaySound");
}
void PlaySound(string &in asTimer)
{
//play sound here, use either PlayGuiSound or PlaySoundAtEntity, example below.
PlaySoundAtEntity("","react_breath_slow.snt", "Player", 0, false);
AddTimer("startcredits", 20, "StartCredits");
}
void StartCredits(string &in asTimer)
{
StartCredits("creditsmusic.ogg", true, "Ending", "MainCredits", 1337);
}
I'm fairly sure that should work.
|