|
|
Randomizer?
#124452
04/16/07 06:23
04/16/07 06:23
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
Hi, I got a question about the random function.
I use random(2) + 1 in an action. and that action is used by about 150 entitys. som my question is. how good is the randomizer. because i see the same result every time I start my game. and that aint what i want it to be.
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Randomizer?
[Re: jcl]
#124454
04/18/07 09:16
04/18/07 09:16
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
Well that is one thing i dont understund. random chould be random. it chouldnt give same result every time. so is there somehow to make it randomize better?
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Randomizer?
[Re: Tiinusen]
#124455
04/18/07 10:01
04/18/07 10:01
|
Joined: Jul 2000
Posts: 28,024 Frankfurt
jcl

Chief Engineer
|

Chief Engineer
Joined: Jul 2000
Posts: 28,024
Frankfurt
|
Not with computers  . Computers don't know 'true' random numbers, that's why you're always getting the same sequence as long as you have no clue how random numbers work and how to use them. The manual answers your question: http://manual.conitec.net/avar-randomize.htmAnd if you then still have no clue, ask on the forum...
|
|
|
Re: Randomizer?
[Re: jcl]
#124456
04/18/07 10:41
04/18/07 10:41
|
Joined: Sep 2006
Posts: 128 Sweden
Tiinusen
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 128
Sweden
|
well so i chould start with randomize(); in the main or do i have to use it everytime before i uses random(); ??
Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1
I'm 17 years old, with 4 years of programing
I can programming a lot of languages check my
Bio out,
|
|
|
Re: Randomizer?
[Re: Tiinusen]
#124457
04/18/07 12:09
04/18/07 12:09
|
Joined: Dec 2002
Posts: 3,375 Vindobona (Ostarichi)
Harry Potter
Expert
|
Expert
Joined: Dec 2002
Posts: 3,375
Vindobona (Ostarichi)
|
Quote:
well so i chould start with randomize(); in the main or do i have to use it everytime before i uses random(); ??
The answer for this question you can also find in the manual: 
Quote:
The number returned is fractional, and is always less than the upper limit. The random sequence starts always with the same numbers, unless 'randomized' at game start by randomize().
|
|
|
|
|
|