The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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?
NylePudding Offline
Member

Posts: 77
Threads: 23
Joined: Apr 2011
Reputation: 0
#1
Random Events?

How would you make it so then if you walked into a ScriptArea, there was a chance 3 different individual things would happen?

Would you have a variable for instance called: "RandomEvent" and basically say:

RandomEvent = 3

AddEntityCollideCallback("Player" , "ScriptArea_1" , "BodyFunc1" , true , 1);

RandomEventFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("corpse_male_1" , true);
AddTimer("tut03", 10, "Timer02");
RandomNumber(3) = RandomEvent ;
}

if RandomNumber == 0
{
Spawn Monster
}

if RandomNumber == 1
{
Put out candles
}

if RandomNumber == 2
{
An Evil Donkey of mass destruction kills you
}


I know a lot of that wasn't actually C++, but if actual functions were used would that work?

Also what would those functions be? Tongue
(This post was last modified: 05-01-2011, 02:45 PM by NylePudding.)
05-01-2011, 02:44 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)