Ren'Py Variable for relationship points (Love, Lust etc ...)

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,564
Is there a variable on ren'py affixed by relationship points, which contains a score, a text and a color?
an icon (emoticon) can be added in front of the text.
 
  • Like
Reactions: Tor4534543

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,234
Is there a variable on ren'py affixed by relationship points, which contains a score, a text and a color?
an icon (emoticon) can be added in front of the text.
No. Ren'py is just a core engine, and one mostly oriented to Visual Novel, it have nothing that regard the game mechanism.
You have to create your own variables for everything that regard the game mechanism, and in fact create your own game mechanism.


Thanks, but that's not good because Character is a string variable.
Er, not at all, Character is a class object (well, technically it's a function interface for a class object), not at all a string.
Some devs extend the class to add their own variables, and so group them together with the generic Ren'py object. But it's not recommended, because the said class isn't intended to be saved, and also evolve with time, which can lead to name conflict for the attributes.
 

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,564
No. Ren'py is just a core engine, and one mostly oriented to Visual Novel, it have nothing that regard the game mechanism.
You have to create your own variables for everything that regard the game mechanism, and in fact create your own game mechanism.




Er, not at all, Character is a class object (well, technically it's a function interface for a class object), not at all a string.
Some devs extend the class to add their own variables, and so group them together with the generic Ren'py object. But it's not recommended, because the said class isn't intended to be saved, and also evolve with time, which can lead to name conflict for the attributes.
Thank you.
To create a new "variable type" that I can use on Ren'py, do I create a structure on Pyton? or is there a better solution?
 

yuqiu314

New Member
May 4, 2018
5
3
A good way to do this is to use the character namespace.

Define a data object to store the stats.
Python:
init python:
    class CharacterStats(object):
        def __init__(self, love, lust):
            self.love = love
            self.lust = lust
Define the character like this.
Python:
define character.e = Character(_("Sylvie"), color="#c8ffc8")
define e = CharacterStats(0, 0)
Then you may use it like this.
Python:
$ e.love += 1
"Love: [e.love]"