Python Forum
Unknown Error with Random Stat Assigner
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unknown Error with Random Stat Assigner
#7
(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 + 1
Your 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
"I want to be a human being, not a human doing."
Reply


Messages In This Thread
Unknown Error with Random Stat Assigner - by FC8 - Dec-01-2021, 05:29 PM
RE: Unknown Error with Random Stat Assigner - by FC8 - Dec-06-2021, 01:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error UserWarning: Unknown option ssl_ca_certs warnings.warn(str(exc)) Vijayaraj 0 832 Jul-11-2023, 06:01 AM
Last Post: Vijayaraj
  Failing to get Stat for a Directory tester_V 11 3,866 Jul-20-2021, 10:59 PM
Last Post: Larz60+
  Unknown error occurred: Port not found NewBeie 0 1,514 Aug-27-2020, 08:50 PM
Last Post: NewBeie
  Help!Unknown ERROR bwdu 1 2,170 Apr-20-2020, 02:09 PM
Last Post: deanhystad
  Unknown error TheIDarKIKnight 0 1,571 Apr-19-2020, 05:27 PM
Last Post: TheIDarKIKnight
  Unknown error in pygame :( TheDovah77 1 2,961 Apr-14-2019, 10:22 PM
Last Post: metulburr
  Unknown syntax error (Im new to this) reasonablelevel 2 2,940 Jul-25-2018, 11:59 AM
Last Post: reasonablelevel
  weird error in random sentence generator bobger 9 5,940 Nov-29-2017, 07:34 PM
Last Post: bobger
  Unknown Syntax Error AlwaysNew 6 5,467 Sep-09-2017, 01:57 AM
Last Post: AlwaysNew

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020