Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 623 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
random #271092
06/11/09 09:11
06/11/09 09:11
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
how can i use random values to cause damage between 10 and 20?
when i use random it uses a fixed value.
Regards
Mythran

Re: random [Re: Mythran] #271106
06/11/09 10:00
06/11/09 10:00

F
Fear411
Unregistered
Fear411
Unregistered
F



try
damage = random(10)+10;

Re: random [Re: ] #271110
06/11/09 10:04
06/11/09 10:04
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
yes, this is a common mistake.
inside your main function, before you load a level etc etc, write:

random_seed(0);

that makes sure the random REALLY is random every time.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: random [Re: Helghast] #271114
06/11/09 10:14
06/11/09 10:14

F
Fear411
Unregistered
Fear411
Unregistered
F



whats about randomize()?
I always use randomize();

Re: random [Re: ] #271234
06/11/09 21:16
06/11/09 21:16
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Tankyou all, i'll try that tommorow.
And see if i can kick some monsters ass randomly wink
Regards.


Moderated by  adoado, checkbutton, mk_1, Perro 

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