Gasil
Member
Hello, I'm trying to figure out a simple way to to this, but I don't think I could without help.
I have these three outcomes or accidents while performing activities, each one has a different chance to occur: 20%, 30% and 50%, so I want a check to determine which will happen over the other two based on its probability.
How would you code something like that? I have no code whatsoever other than:
Thank you for your suggestions.
I have these three outcomes or accidents while performing activities, each one has a different chance to occur: 20%, 30% and 50%, so I want a check to determine which will happen over the other two based on its probability.
How would you code something like that? I have no code whatsoever other than:
GML:
//Check if accident will happen.
roll = irandom(99);
if(roll < BASE_ACCIDENT_CHANCE)
{
//Check which of the 3 different incidents will happen.
}