How do I create a victory odds % formula?

Basically what I'm needing is a template formula that can be done through either events or scripts.


Like for examples: The mission has a 50% chance of success, The mission has a 30% chance of success, so on.


I need a formula that can generate a percentage chance of victory based on 3-4 variables or less.


I want to be clear that I'm not wanting this formula to run in absolutes.


So even if the mission has a 10% chance of victory, while the odds are low and most likely won't succeed, I want that 10% chance to STILL have a chance of making the mission successful.


Am I making sense or confusing the heck out of people?


as a side note, I'd love it if I could display these odds to the player but that would probably require a plugin or something so the formula alone will do.
Testing a percentage is simple - just use a control variable command with a random number between 1 and 100, and then use a conditional branch to check if the result is lower than 10 (for 10%) or so on.


Determing which number to check is your task as a developer - you are the one who says that a check has a chance of 50% or 30% or whatever.


If you don't want that chance to be set by your own but based on some other values, you need to tell us which other values should be involved how.
Testing a percentage is simple - just use a control variable command with a random number between 1 and 100, and then use a conditional branch to check if the result is lower than 10 (for 10%) or so on.


Determing which number to check is your task as a developer - you are the one who says that a check has a chance of 50% or 30% or whatever.


If you don't want that chance to be set by your own but based on some other values, you need to tell us which other values should be involved how.

Knew I was forgetting something when I made that post earlier but anyways, basically the 3-4 varibles would run like this:


Variable 1: Victory odds, Determines if the mission is a success or not.


Variable 2:  Rank 1 Troops, each troop adds 0.5% per troop (based on rank) to the victory odds variable.


Variable 3: Mission difficulty, gives a flat Percentage to minus from the victory odds variable.


Variable 4: Rank 2 troops, Adds to 1% to the Victory Odds variable.


If the troops variables make the victory odds variable a 100% chance then no math is needed but if any less then it runs the percentage chance math to determine if its a success or not.
Rarity%20and%20twilight%20bump%20a%20thread.png



But seriously...need some help here...I suck at math. >.<

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-create-a-victory-odds-formula.61539/