I'm attempting to build a random character generator for an RPG. I am attempting to Generate two skills from a select list, which if selected need to return true in the Common list.
I'm pretty new, so this may be a problem with inexperience.
What I did try was using instead of SkillChoice[0] = True I used (SkillChoice[0]).append(2) to add the modifier to a list, but with this method it cannot check if that skill was chosen.
import random
# Class
Barbarian = True
# Skills
Athletics_P = False
Acrobatics_P = False
Alchemy_P = False
Lockpicking_P = False
Sneak_P = False
if Barbarian:
ClassSkills = (Athletics_P, Acrobatics_P, Alchemy_P, Lockpicking_P,
Sneak_P)
SkillChoice = random.sample(ClassSkills, 2)
SkillChoice[0] = True
SkillChoice[1] = True
# print check
if Athletics_P:
print("Athletics")
if Acrobatics_P:
print("Acrobatics")
if Alchemy_P:
print("Alchemy")
if Lockpicking_P:
print("Lockpicking")
if Sneak_P:
print("Sneak")
The expected result would be it displaying two random skills, confirming that it can be checked if the variable was "True"
Actual results in nothing displaying, which leads me to believe what is actually happening is that the skills are not changing values.
No errors are displaying.