593 Subj : help needed To : Dennis Collins From : Leonard Erickson Date : Wed Oct 11 2000 05:47 pm -=> Quoting Dennis Collins to Leonard Erickson <=- LE> DC> I am working on a game currently and have come to a LE> DC> section that is causing me a small amount of LE> DC> grief...... the routine has to return a boolean based LE> DC> on a percentage ie TRUE = hit, FALSE = miss, and there LE> DC> weapons used. example: weapon 1 has 1% chance of LE> DC> hitting target weapon 2 has 13% chance of hitting LE> DC> target etc weapon 10 DC> thanks for the assist. LE> I'm not entirely clear what you want to routine to *do*. LE> Yes, I understand that you want it to return true or false. LE> What I'm *not* clear on is how it is supposed to *do* that. DC> if the player uses weapon 1 which has for example an accuracy of 3% DC> then if he uses it 100 times then he will randomly hit the target only DC> 3 times, Actually, with a 3% chance to hit on *one* attempt, the chances to hit on 100 attempts isn't necessarily 3 hits. DC> if the player uses another weapon with an accuracy of 38% DC> and plays 100 times again he would hit the target 38 times, however DC> if he only plays 50 turns then he will only achive a hit 19 times. Well, something like the code sample I included should do the trick. --- FMailX 1.59b/beta * Origin: Shadowshack (1:105/51) . 0