Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,499 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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