I've been trying to learn how to code in renpy using Emp's youtube tutorials and have encountered an error when trying out the hint system. https://www.youtube.com/watch?v=SDXG17W0cBA& I'm still very new to coding and rely mostly on copying examples in the video.
I keep getting 'bool' object has no attribute 'use_outline' despite copying word for word the functions. I did change the example name and the images.
Here's the traceback
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/Lesson04 - Screens.rpy", line 215, in script
r "red and black chibis hints should also show"
File "game/screens_custom.rpy", line 309, in execute
screen scr_hint(hints=[]):
File "game/screens_custom.rpy", line 309, in execute
screen scr_hint(hints=[]):
File "game/screens_custom.rpy", line 310, in execute
for hint in hints:
File "game/screens_custom.rpy", line 311, in execute
if hint.use_outline():
AttributeError: 'bool' object has no attribute 'use_outline'
Code: Select all
screen scr_hint(hints=[]):
for hint in hints:
if hint.use_outline():
imagebutton idle hint.outline:
focus_mask True
action NullAction()
hovered Function(hint.call_func)
xalign hint.x
yalign hint.y
imagebutton idle hint.img:
focus_mask True
action NullAction()
hovered Notify(hint.hint_text)
xalign hint.x
yalign hint.y
Code: Select all
init python:
class Hint:
def __init__(self, img, outline, x, y, var_check, func, hint_text):
self.img = img
self.outline = outline
self.x = x
self.y = y
self.var_check = var_check
self.func = func
self.hint_text = hint_text
def call_func(self):
self.func()
def use_outline(self):
return self.var_check()
def seen_red():
store.red_seen = True
def has_seen_red():
return not red_seen
def seen_black():
store.black_seen = True
def has_seen_black():
return not black_seen
red_hint = Hint("Chibi_red_idle.png", "Chibi_red_outline.png", 0.35, 0.50, has_seen_red, seen_red, "Hey have you seen Red?")
black_hint = Hint("Chibi_black_idle.png", "Chibi_black_outline.png", 0.65, 0.50, has_seen_black, seen_black, "Hey have you seen Black?")
default red_seen = False
default black_seen = False
Code: Select all
r "Next screen shows an incorporated hint system. Here we created a python function Hint"
show screen scr_hint([red_hint, black_hint])
r "red and black chibis hints should also show"
Help would be very much appreciated!