Hello how do i define a Character class in renpy and then call this character in the text

darkshaw

Newbie
Jan 20, 2019
64
26
init python:
class Person:
def __init__(self, character, name, trust = 0, happiness = 0):
self.c = character
self.name = name
self.trust = trust
self.happiness = happiness

$ K = Person(Character("Kimura"), "Kimura")


"Lorem Ipsum [K] Lorem Ipsum. ".

How i make K work here?
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,099
7,487
Tried first thing but


" Lorem Ipsum [K.c]Lorem Ipsum".

View attachment 3885817


Python:
init python:
    class Person:
        def __init__(self, character, name, trust = 0, happiness = 0):
            self.c = character
            self.name = name
            self.trust = trust
            self.happiness = happiness
 
define e = Character("Eileen", what_color = "#ffffff")
     
label start:
    $ K = Person(Character("Kimura"), "Kimura")
    e "blabla [K.c]"