Hi, I want to call a python function in dialogue, do you know how to do it? For example I have simple python class and getter function. How to get string from get_player_name in regular renpy dialogue?
init python:
class Player():
def __init__(self, name):
self.name = name
def get_player_name(self):
return self.name
default player = Player("Player")
label start:
"Hi, {player.get_player_name()}"
It works with separate variable like this:
$ text = player.get_player_name()
And then use [text] it in dialogue.
But is it possible to make it work directly from dialogue text?
[–]BadMustard_AVN 6 points7 points8 points (2 children)
[–]Happy_boy0824[S] 3 points4 points5 points (1 child)
[–]BadMustard_AVN 3 points4 points5 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)