[TIB] Re: AI
[Prev][Next][Index][Thread]
[TIB] Re: AI
well, the easiest way is to just use good old random #s... perhaps you could weight the different actions differently if you wanted relative percents...
The sensible way:
rand -> A
If A>.9
Disp "action 1! - A 10% chance!"
If A>.7 and A<=.9
Disp "Action 2! - A 20% chace!"
or, the fly by night way...
If rand>(1/3)
Then
Disp "action 1! A 33% chace!"
Else
If rand>.5
Then
Disp "action 2! A 33% chance!"
Else
Disp "action 3! A 33% chance!"
End
End
(the second way's my favorite for no good reason at all.)
Nick
Follow-Ups: