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
Defining a random x
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#6
RE: Defining a random x

No, I'm just going to be activating a random one out of four. It's a critical item you have to find, but I'm basically randomizing its location when you enter the level. I did some research, but I think this is basically what I'm going to have to do:

void OnStart()
{
AddEntityCollideCallback("Player", "ActivateRemnant", "ActivateRemnant", true, 1);
}

void ActivateRemnant(string &in asParent, string &in asChild, int alState)
{
int x = RandInt(1,4);
SetEntityActive("orbpiece_emerald_"+x, true);
FadeLightTo("OrbLight_"+x, 0.3f, 0.6f, 0.5f, 1, 0.5f, 1);
}

04-23-2012, 08:01 PM
Find


Messages In This Thread
Defining a random x - by Damascus - 04-23-2012, 06:07 AM
RE: Defining a random x - by Your Computer - 04-23-2012, 07:08 AM
RE: Defining a random x - by Damascus - 04-23-2012, 07:23 AM
RE: Defining a random x - by Your Computer - 04-23-2012, 08:03 AM
RE: Defining a random x - by Knittel - 04-23-2012, 01:19 PM
RE: Defining a random x - by Damascus - 04-23-2012, 08:01 PM
RE: Defining a random x - by Cranky Old Man - 04-23-2012, 08:07 PM
RE: Defining a random x - by overscore - 04-23-2012, 08:10 PM
RE: Defining a random x - by palistov - 04-23-2012, 08:40 PM
RE: Defining a random x - by Damascus - 04-23-2012, 10:53 PM
RE: Defining a random x - by palistov - 04-24-2012, 01:06 AM
RE: Defining a random x - by Damascus - 04-24-2012, 01:19 AM
RE: Defining a random x - by palistov - 04-24-2012, 02:25 AM



Users browsing this thread: 2 Guest(s)