Menu

D&D random stat generator

Home / portfolio / D&D random stat generator

D&D random stat generator

This small and simple generator is a stat and feat generator for a system in a friends d&d campaign. He asked me to make him a generator that could would generate random stats and feats for his random creature system. How does the system work? Simple, when you buy the item in the game you get a random creature out of a list of 100 creatures. When you have that you generate the stats and feats of the creature so it is to pure luck if the creature is good or not.


Next to that this is the first project I made in Python and had to learn a lot. It was a really nice opportunity to learn more about different systems. In this project I learnd some basics such as variables, lists, random generation and OS system functions. Next to that I have used the MbConstants pop-up for a simple pop-up and how to implement this with what I wanted to make.


img-Image


First the for loop will generate a random amount of special features. When the forloop is completed you will enter the area where the MbConstants will take over and make a pop up menu. In this menu you will see some information of the different stats like health, armor, strenght, etc.



img-Image


The def "restart()" is basically a small function that restarts the entire code script to restart the generator when you want to generate a new outcome. then you have a class where the different states of the MbConstants library are stored so the code knows what states I have and add those with the buttons on the pop up.


If you enjoyed this read or have questions feel free to contact me!

Download/View project

Share