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?
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
#1
How do I script this?

When the player enters a script area, a monster's spawns, follows only one pathnode, and after 10 seconds a sound is played, and after 30 seconds the credits start.
If it's easier can I make different script areas.

Still hasn't gotten over the loss of wubwub...
(This post was last modified: 08-06-2012, 02:12 PM by CorinthianMerchant.)
08-06-2012, 02:12 PM
Find
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
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
#3
RE: How do I script this?

Thanks a lot!

Still hasn't gotten over the loss of wubwub...
08-06-2012, 03:28 PM
Find




Users browsing this thread: 2 Guest(s)