random variables...

Game Editor comments and discussion.

random variables...

Postby Oman » Fri May 04, 2007 10:47 pm

I would like to know how to, on create actor of my enemy, change my variable to a number anywhere between 1 and 10.

Any help is appreciated :)
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Sgt. Sparky » Fri May 04, 2007 11:05 pm

Code: Select all
your_variable = 1 + round(rand(9));

if you want it to not be a round number (whole number) make the variable real and use,

Code: Select all
your_variable = 1 + rand(9);

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Oman » Sat May 05, 2007 1:18 am

Thanks a bunch!
I will try that as soon as i can...
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron