Code: Select all
define p = Character(_("Player"), color="#c8c8ff")
init python:
class Skill(object):
def __init__(self, name="Skill_naming_error", start = 0):
self.name = name
self.value = start
def challenge(self, difficulty = "medium", emotion = "anger"):
renpy.say(p, "Challenge of [self.name] with a skill of [self.value]")
Smoothtalking = Skill("Smoothtalking", 5)
Code: Select all
$ smoothtalking.challenge("easy", "anger")
Code: Select all
p "Challenge of smoothtalking with a skill of 5"
I'm probably misunderstanding something fundamental.
How can I make renpy.say() spit out the name or other variables from inside a class' method?
Of course it works without using the [self.name] and [self.value], but I'd like to dynamically be able to use these.