Dec-06-2021, 01:56 PM
(Dec-01-2021, 07:38 PM)deanhystad Wrote: You need the range of the generator to match the range of the checkers. Since Python starts at 0 I would generate values 0..99 to have 100 possible values for statpoint. Next I would write the if code differently
for i in range (level): statpoint = random.randint(0, 99) if statpoint < 20): HP = HP + 1 elif statpoint < 40: MP = MP + 1 elif statpoint < 60: ME = ME + 1 elif statpoint < 80: ATK = ATK + 1 else SPD = SPD + 1Your RPG is going to be pretty lonely with only 1 player and no NPC's. How do you keep track of stats for multiple characters?
I could have sworn I replied to this. This is not directly relating to the RPG itself, but is instead a concept for an algorithm for generating enemy levels. Let's say you are playing a tabletop RPG with your friends (which are not my area of expertise so forgive me if this is a bad example), and their characters encounter a goblin. Now let's say I am the gamemaster and being the creative drain I am, I cannot decide the stat levels for the monster. (The characters, or players, choose their stats or level them up. An RPG with random player stats would be frustrating, if I may say so myself.) Anyway, I can choose the level of the goblin by inputting a range (in RPGs, levels tend to pertain to areas.), leave it random, or decide myself. Then it would assign the stats for me so I don't have to.
If I were to apply this to a game, each stat point would give a certain amount of stats pertaining to the monster... please forgive my terrible communication skills. If you've ever played ARK: Survival Evolved, tamed creatures can be assigned points upon leveling up, which increases the stats by a value that depends on the creature and/or chosen stat. This would automatically apply this to monsters, with adjustments, of course.
And of course, thank you very much!
![Big Grin Big Grin](https://python-forum.io/images/smilies/biggrin.png)
"I want to be a human being, not a human doing."