- Sep 24, 2017
- 426
- 336
I am attempting to create a drop-in replacement for the renpy scene function. It needs to be capable of everything scene is... but it also needs to automatically "show" an additional image unique to each scene when certain criteria are met. The idea is that I can have an element of all scenes (such as a character's outfit) that can be changed by player choices yet is seamlessly displayed in each scene as if the scene had been rendered with that element.
Since every single render is going to have characters is different poses and positions within the scene... renpy's layered image features seem far too cumbersome to work here. If I understand it right, because I am not using sprites, I would need to write out a layered image definition for every single scene.
What I have doesn't work:
Unfortunately I'm rather new to both python and renpy. I have quite a bit of experience with javascript, perl, and php... but not python.
I'm certainly open to a different approach. I don't particularly like overriding core functionality.
Since every single render is going to have characters is different poses and positions within the scene... renpy's layered image features seem far too cumbersome to work here. If I understand it right, because I am not using sprites, I would need to write out a layered image definition for every single scene.
What I have doesn't work:
Python:
init python:
def cscene(name, at_list=[], layer='master', what=None, zorder=0, tag=None, behind=[]):
renpy.scene(layer)
renpy.show(name, at_list, layer, what, zorder, tag, behind)
if pc and not pc.outfit == 0:
ofname = name + ' of' + str(pc.outfit)
if renpy.loadable(ofname):
renpy.show(ofname, at_list, layer, what, zorder, tag, behind)
return
config.scene = cscene
Code:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00start.rpy", line 205, in script
scene black
File "game/script.rpy", line 10, in cscene
renpy.show(name, at_list, layer, what, zorder, tag, behind)
AttributeError: 'NoneType' object has no attribute 'split'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/00start.rpy", line 205, in script
scene black
File "renpy/ast.py", line 1279, in execute
renpy.config.scene(self.layer)
File "game/script.rpy", line 10, in cscene
renpy.show(name, at_list, layer, what, zorder, tag, behind)
File "renpy/exports.py", line 678, in show
name = tuple(name.split())
AttributeError: 'NoneType' object has no attribute 'split'
Windows-10-10.0.19041
Ren'Py 7.4.4.1439
The Long Dark 0.1
Sun Jun 6 11:33:31 2021
I'm certainly open to a different approach. I don't particularly like overriding core functionality.