Gamestudio Links
Zorro Links
Newest Posts
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (JeyKey II, EW_bytes), 11,236 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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