Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,420 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

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.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