ID:170503
Jan 16 2005, 5:17 pm
|
|
Okay, heres what I need to know. I have a variable called cgravity, which stands for Center of Gravity. This will determine how my characters grow stat wise. Now, I want this to be totally random, anywere between 1-100%. This variable will be defined at the creation of a mob. Now, can anyone tell me how to make the cgravity variable random? Help is much appreciative.
|
In response to Elation
|
|
Thanks!!
|
In response to Elation
|
|
It's not working..
|
In response to Plagu3r
|
|
There's nothing wrong with his second example, it just doesn't fit into your game automatically. You'd have to call that proc from a mob when you wanted that mob's cgravity variable randomized (most likely in mob/Login() or mob/New()).
Elation, in case you're wondering why I only said there was nothing wrong with your second example, in the first example, since cgravity is a mob variable and you're declaring it, I assumed that you were setting it to a random number at compile-time. Without context, of course, I couldn't possibly know, so you can just say it was a temporary variable in mob/New() to set src.cgravity to, if you want. =P /me fills his daily quota of commas. |
OR
call a proc to change it