I know this can be done with bools, but how do I make it depend on percents what the outcome is?
Not exactly.
A bool is the most simple kind of variable, as it holds either
true oder
false.
But you don't need a bool to work with chances (at least not the way I guess you're thinking of).
Especially because in an RPG the outcome won't stay the same, it doesn't make sense to use a variable at all.
You'll want something like this:
[code]function attack_success(int chance_of_hit) {
if (Random(99)<chance_of_hit) return true;
else return false;
}
...
if (attack_success(95)) {
// reduce foe's HP, etc...
}
else
Display("You missed!");[/code]
Of course it's possible (and elegant) to write the outcome of a condition right into a bool, but Yurina is a variable beginner, so let's not trick her into thinking that writing a single line of code will provide her with a constantly changing attack_success bool
