Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 02:32
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (qin), 3,221 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Randomizer? #124452
04/16/07 06:23
04/16/07 06:23
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline 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: Tiinusen] #124453
04/16/07 07:35
04/16/07 07:35
Joined: Jul 2000
Posts: 28,050
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,050
Frankfurt
The randomizer is as good as the programmer who uses it. Initialize your random sequence. See Manual -> randomize.

Re: Randomizer? [Re: jcl] #124454
04/18/07 09:16
04/18/07 09:16
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline 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,050
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,050
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.htm

And 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 Offline OP
Member
Tiinusen  Offline 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 Offline
Expert
Harry Potter  Offline
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().




Re: Randomizer? [Re: Harry Potter] #124458
04/18/07 18:45
04/18/07 18:45
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
thanks alot


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,

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1