Subj : help needed To : Dennis Collins From : Jasen Betts Date : Wed Oct 11 2000 11:41 pm Hi Dennis. 11-Oct-00 12:41:00, Dennis Collins wrote to All DC> hi DC> I am working on a game currently and have come to a section that DC> is causing me a small amount of grief..... DC> the routine has to return a boolean based on a percentage ie TRUE DC> = hit, FALSE = miss, and there are different percentages for the DC> different types of weapons used DC> example: weapon 1 has 1% chance of hitting target weapon 2 has 13% DC> chance of hitting target etc weapon 10 DC> as these percentages are configurable at the time of the game DC> setup they could be anything from 1% to 99 DC> hoping someone can shed some light on an easy way to achieve this. put them all in an array (either entire weapons or just the percentages) (assuming your waepons are nuumbered) and when you want to test for a hit make a random number between 0% and 99% if it's smaller than the hit percentage in the array then it's a hit. DC> cheers -=> Bye <=- --- * Origin: 3 * 17 * 521 / 50 (3:640/531.42) .