ID:173196
 
Well, first with the explaination
On creation, mobs are given effectively a stat-roll, between 1-5 for each of five base variables. While this is a simple method of doing things, and what I am currently using:
O.goal = rand(1,5)
O.finish = rand(1,5)
O.tackle = rand(1,5)
O.pass = rand(1,5)
O.rep = rand(1,5)

But since these 5 variables have a strong holding on 'ability' so to speak, I'd like a more even method of doing things.

What I'd like
What I'd like, is for the attributes to be generated from a pool of points. For example, say there are 20 (number hasn't really been decided on yet) creation points to be randomly distributed between the aforementioned 5 variables. Say, Var1 manages to roll 5, there would be 15 points left to be distributed between the remaining 4 attributes.

My problem
I could go with a rigid distribution:
Var1 would get first pick from the full pool.
Var2 then gets to take something from it.
...Var5 finally comes around, and is simply left with what remains.

I'd rather a system whereby each Variable has a chance to get first pick from the pool. Problem is, I'm not sure how to go about this random system, and an effective version of the point pool.

I appreciate any help, and grateful for any ideas.
I would say use a list and use the Pick() proc to get a random number out of it, then remove what you picked from the list and continue for var2.

Dunno if this was what u ment though.

Fint
In response to Fint
Yeah, I had looked at this aspect. But, I'm not really sure on how to go about it with the mentioned point pool system.
In response to Fliint
var/WhoFirst=rand(1,5)
if(WhoFirst=1)
newpoints=rand(1,5)
O.var1+=newpoints
PoolPoints-=newpoints
In response to Airjoe
None of the described methods will work very well. If you choose an order, and then give a random number to the first four, and the last gets what's left, if the first four use up the pool, the last gets 0 (not in the range) or the first four get 1 each, the last will have 16 points.

What you want is something like this:
var/list/stats = list(1,2,3,4,5)
while(points > 0)
switch(pick(stats))
if(1)
//Increase the first stat by 1
//If the first stat is over the max
//Remove 1 from the list
if(2)
//Etc.
In response to Garthor
I went for the system you suggested Garthor, and it seems to work just as I want it to at the moment; Thanks. Sure, the code is a little messy at the moment, but it's something that can be worked on.

All in all, thanks for the help everyone.