- Jul 9, 2020
- 6
- 1
I'm fairly new to Renpy and coding in general so I apologize for the 'new guy' question', but I've been stuck on this for a while.
I'd like to set my script to pull a random variable from a list and then modify it. For instance, if I have a list of skills for a character and they get a bonus to a random skill, how do I put that through?
An abbreviated version of my current code is below. I'm fairly certain I know why this doesn't work, but I'm unsure what it should look like instead. Any help is greatly appreciated. Thank you!
I'd like to set my script to pull a random variable from a list and then modify it. For instance, if I have a list of skills for a character and they get a bonus to a random skill, how do I put that through?
An abbreviated version of my current code is below. I'm fairly certain I know why this doesn't work, but I'm unsure what it should look like instead. Any help is greatly appreciated. Thank you!
Code:
$ skill_list = [fight, wits, lore]
$ skill_boost = 5
$ selectedSkill = renpy.random.choice(skill_list)
$ selectedSkill += skill_boost