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
0 registered members (), 18,561 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
random function does not work correctly #303384
12/28/09 16:56
12/28/09 16:56
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Using the random function is a number between 0 and 6 would be obtained. But this number is always 4. A number between 0 and 100 if I want to receive the constant is 58. That is not always the same number. Thanks in advance.

Re: random function does not work correctly [Re: WickWoody] #303387
12/28/09 17:04
12/28/09 17:04
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Quote:

the random sequence starts always with the same numbers, unless 'randomized' at game start by random_seed().

source: http://www.conitec.net/beta/avar-random.htm

more details: http://www.conitec.net/beta/avar-randomize.htm

Re: random function does not work correctly [Re: Xarthor] #303391
12/28/09 17:11
12/28/09 17:11
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Call the function "randomize()" to create a new seed before you call function "random()". You'll get a new random number every time.


Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: random function does not work correctly [Re: Redeemer] #303433
12/28/09 21:20
12/28/09 21:20
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
random_seed worked. Thank you.

Last edited by WickWoody; 12/28/09 21:20.
Re: random function does not work correctly [Re: WickWoody] #303494
12/29/09 10:25
12/29/09 10:25
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@Redeemer:
As far as I know, "randomize()" is C-Script and no longer supported in lite-C or as replaced by random_seed in a more recent version of the acknex engine.


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