Randomizing distribution points on a list of things
Posted: 13 Aug 2019, 00:10
Hello, I'm making a random character generator for an rpg like d&d where I have a list of "profiles" (like archer, swordman, etc.), 6 stats (Agi, Dex, etc.), a list of weapons, a list of armors and a list of skills.
With all that in mind I have X and Y amount of points depending on the lvl of the npc, X being stat points and Y being skill points.
What I need it to do:
The rules for this part are:
The rules for this part are:
Also, I was thinking about looping a random on each skill but again this will make it have less points or make some weird results like: "Bow skill: 61, Running skill: 50, Talking skill: 50" and the rest would be 0 because it ran out of points on the first 3.
So my final question is: Is it posible to distribute a defined amount of points in a list of "skills" adding some "weight" to some of them without having the problems I explained before?
Thanks in advance
With all that in mind I have X and Y amount of points depending on the lvl of the npc, X being stat points and Y being skill points.
What I need it to do:
- Randomly select a level. Done
- Randomly select a profile. Done
- Randomly distribute stat points depending on that profile and lvl. Need Help
- Randomly distribute skill points depending on that profile and lvl. Need Help
- Randomly picking an armor, helmet and weapons depending on level and profile. Done
The rules for this part are:
- Stat cannot be lower than 5.
- Stat cannot be higher than 31.
The rules for this part are:
- Skill can be 0.
- Skill cannot be higher than 61.
Also, I was thinking about looping a random on each skill but again this will make it have less points or make some weird results like: "Bow skill: 61, Running skill: 50, Talking skill: 50" and the rest would be 0 because it ran out of points on the first 3.
So my final question is: Is it posible to distribute a defined amount of points in a list of "skills" adding some "weight" to some of them without having the problems I explained before?
Thanks in advance