Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I script this?
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#2
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.
08-06-2012, 02:55 PM
Find


Messages In This Thread
How do I script this? - by CorinthianMerchant - 08-06-2012, 02:12 PM
RE: How do I script this? - by ApeCake - 08-06-2012, 02:55 PM
RE: How do I script this? - by CorinthianMerchant - 08-06-2012, 03:28 PM



Users browsing this thread: 1 Guest(s)