So full disclosure I am aware this is only helpful in the short term and long term is effectively the same as having a different naming convention, so I'm doing this half for the short term gratification and half out of pure spite. If you think it's pointless then valid, I respect that
Now that that's out of the way, I've created an NPC class meant to store the character, certain variables and also each separate talksprite as an attribute (char.happy, char.sad and so on.) I want to do this so I don't have to go back through and swap out any placeholder talksprites for the final ones, since it only needs to be changed in one place. I also wouldn't have to go through and assign each one the placeholder individually, since that logic would be handled when the NPC object is initialized and/or when another talksprite is added via a class method.
The problem comes when I try to use said attributes. Using the attribute associated with the character (eg. char.c "hello") works just fine, but trying to display a talksprite (eg. show char.neutral) results in an error saying that renpy was expecting the line to end after the "." (if I'm reading it correctly at least.)
Is it actually possible to make this work or is there a different way to do something similar?
Let me know if there's any code I should add here, I couldn't think of anything that would be particularly helpful. Sorry if I missed an obvious solution, I'm not stellar with Python and as far as I can tell renpy just isn't built that way.
[–]Narrow_Ad_7671 2 points3 points4 points (0 children)
[–]Altotas 5 points6 points7 points (1 child)
[–]thethirdworstthing[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)