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
Knittel Offline
Junior Member

Posts: 8
Threads: 1
Joined: Apr 2012
Reputation: 0
#5
RE: Defining a random x

But pay attention. If you want activate more than 1 of those objects by that, it may be that you activate the same object multiple times. I don't how exactly you want to use that code, but this would be the same problem, when making a program generating 6 diffrent numbers between 1 and 10. You need to pay attention that there isn't a number chosen, which was already used.

So a solution should look something like:

NotFoundANewOne = true;

while (NotFoundANewOne) do

{

x = random(1,4);

if ("Object" + x) is already active then

NotFoundANewOne = false;

}

Set ("Object" + x) = Active

(This is NOT code for the Amnesia script, but it shows the principle of what is to be done.


[Image: 2ZwH0ZGD0AwL2.png]
[TRACKMANIA]


(This post was last modified: 04-23-2012, 01:21 PM by Knittel.)
04-23-2012, 01:19 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: 1 Guest(s)