- Sep 30, 2017
- 2,348
- 4,917
Hi,
I'm trying to assist one of the developers on here, but I'm a complete noob when it comes to Renpy/Python.
What I'm trying to do is simply the following:-
There is an object from a class
init python:
class Person:
def __init__ (self, fname, lname, age):
self.fname = fname
self.lname = lname
self.age = age
So I create a "Person" object
default TClaire = Person("Claire","White",27)
Now I want to access TClaire and I'm able to access it via "text" like so:
(CharName = "TClaire")
hbox:
text "[" + CharName+ ".Name]":
size 10
And it Correctly outputs "Claire"
However, IF I assign it to a string. I get the following:
$ Playername ="[" + CharName+ ".Name]";
it outputs "[TClaire.Name} "
This is obviously not what I want.
IS it possible to do this in Renpy, It seems obvious, but I could not find any way that this will work.
I'm trying to assist one of the developers on here, but I'm a complete noob when it comes to Renpy/Python.
What I'm trying to do is simply the following:-
There is an object from a class
init python:
class Person:
def __init__ (self, fname, lname, age):
self.fname = fname
self.lname = lname
self.age = age
So I create a "Person" object
default TClaire = Person("Claire","White",27)
Now I want to access TClaire and I'm able to access it via "text" like so:
(CharName = "TClaire")
hbox:
text "[" + CharName+ ".Name]":
size 10
And it Correctly outputs "Claire"
However, IF I assign it to a string. I get the following:
$ Playername ="[" + CharName+ ".Name]";
it outputs "[TClaire.Name} "
This is obviously not what I want.
IS it possible to do this in Renpy, It seems obvious, but I could not find any way that this will work.