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
Random Events?
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#3
RE: Random Events?

This is what it could look like:

OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
int x = RandInt(1,3);
if (x == 1)
{
[spawn monster]
return;
}
else if (x == 2)
{
[put out candles]
return;
}
else if (x == 3)
{
[an evil donkey of mass descruction kills you]
return;
}
}

I would usually indent the lines correctly, but the post doesn't like it. Smile

(This post was last modified: 05-01-2011, 03:13 PM by Kyle.)
05-01-2011, 03:12 PM
Find


Messages In This Thread
Random Events? - by NylePudding - 05-01-2011, 02:44 PM
RE: Random Events? - by MrBigzy - 05-01-2011, 02:57 PM
RE: Random Events? - by Kyle - 05-01-2011, 03:12 PM



Users browsing this thread: 1 Guest(s)