- Home /
Roleplay Engine that decides outcomes based on variables
I want to create a simple roleplay engine for me and my friends that basically is used for sports, or war matchups, and I want to ask for how i go on doing this, i want it to look something like this.
Subject: (ex. War, Sports Matchup) the subject is just asthetic and anything would be able to be put as a subject
Teams: (ex.) Blue Red Green Yellow
there should be an infinite amount of sides you may insert, and all can have different names. and from this example, blue should have a 25 percent chance of winning, and depending on how many sides there are, the chance of winning is equal, but smaller since there are more teams, and same vise versa
Matches?: (Ex: 3) any amount of matches is possible
Match 1: Red Wins
Match 2: Yellow wins
Match 3: Yellow Wins
Outcome: Yellow Wins (ex. War) whatever was the subject would be displayed here
if it is a tie, then it would display tie.
But yeah its just a simple app i want to create and i have no coding experience, so how would i go and start this. it is basically a more advanced flip a coin, dice or spin the wheel, and would be made for roleplay matchups.
Just to be clear you have no coding experience at all?
Alright then my recommendation would be to take a few unity courses first; to learn the basics. Before trying to build a game of this magnitude. Ben Tristen has some really good stuff https://www.udemy.com/unitycourse2/
Answer by Hassurunous · May 10, 2018 at 12:48 AM
What you seem to be getting at is building a dice roller, at least if all "teams" have an even chance of winning.
If all you care about is determining which of a random number of values is selected, you could use a simple Random.Range(1, X)
where X
is the number of "teams" you are using.
Now if you want a visual interface and everything for this, it will take a bit more time, but the gist is that you appear to be asking for a random number in a range of numbers, and there's already a nice function built for that. Hope that helps!
Your answer
Follow this Question
Related Questions
what is wrong whis this? 1 Answer
FPS Ai help 1 Answer
Can't add script to anything error 1 Answer
Pause game without using timeScale 3 Answers
Distance between two objects Unity 0 Answers