Can you help me pls?
Code: Select all
init python:
class place(object):
def __init__ (self, name, locs, mapped, unlocked):
self.name = name
self.locs = locs
self.mapped = mapped
self.unlocked = unlocked
Rooms = []
#home
Rooms.append(place("Porch", ["Hallway"], True, True))
Rooms.append(place("Hallway", ["Porch", "Living room"], False, True))
location = Rooms[0].name.lower()
def BGDeclare():
global locations
global BGimage
BGimage = location.lower()
BGimage = BGimage.replace(" ", "_")
BGimage = "places/" + BGimage + ".jpg"
screen BGIMAGE():
$ BGDeclare()
add BGimage
for q in Rooms:
$ TempName = "places/" + q.locs + "_%.png"
imagebutton:
idle TempName
hover TempName
focus_mask True
action SetVariable("clickType", "mapSelect"), Return(q.locs)
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 18, in script
$ UIreturn = renpy.call_screen("MainUI")
File "game/script.rpy", line 18, in <module>
$ UIreturn = renpy.call_screen("MainUI")
File "game/screens/MainUI.rpy", line 1, in execute
screen MainUI():
File "game/screens/MainUI.rpy", line 1, in execute
screen MainUI():
File "game/screens/MainUI.rpy", line 2, in execute
use BGIMAGE
File "game/screens/BGimage.rpy", line 1, in execute
screen BGIMAGE():
File "game/screens/BGimage.rpy", line 1, in execute
screen BGIMAGE():
File "game/screens/BGimage.rpy", line 4, in execute
for q in Rooms:
File "game/screens/BGimage.rpy", line 5, in execute
$ TempName = "places/" + q.locs + "_%.png"
File "game/screens/BGimage.rpy", line 5, in <module>
$ TempName = "places/" + q.locs + "_%.png"
TypeError: coercing to Unicode: need string or buffer, RevertableList found
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 18, in script
$ UIreturn = renpy.call_screen("MainUI")
File "renpy/ast.py", line 913, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "renpy/python.py", line 2111, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/script.rpy", line 18, in <module>
$ UIreturn = renpy.call_screen("MainUI")
File "renpy/exports.py", line 2969, in call_screen
rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
File "renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "renpy/display/core.py", line 2978, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "renpy/display/core.py", line 3378, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/core.py", line 566, in visit_all
d.visit_all(callback, seen)
File "renpy/display/screen.py", line 432, in visit_all
callback(self)
File "renpy/display/core.py", line 3378, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "renpy/display/screen.py", line 443, in per_interact
self.update()
File "renpy/display/screen.py", line 631, in update
self.screen.function(**self.scope)
File "game/screens/MainUI.rpy", line 1, in execute
screen MainUI():
File "game/screens/MainUI.rpy", line 1, in execute
screen MainUI():
File "game/screens/MainUI.rpy", line 2, in execute
use BGIMAGE
File "game/screens/BGimage.rpy", line 1, in execute
screen BGIMAGE():
File "game/screens/BGimage.rpy", line 1, in execute
screen BGIMAGE():
File "game/screens/BGimage.rpy", line 4, in execute
for q in Rooms:
File "game/screens/BGimage.rpy", line 5, in execute
$ TempName = "places/" + q.locs + "_%.png"
File "game/screens/BGimage.rpy", line 5, in <module>
$ TempName = "places/" + q.locs + "_%.png"
TypeError: coercing to Unicode: need string or buffer, RevertableList found