Hello !
Man I do appreciate the effort but your code is very depressing me lol. I got a lot of error with it (probably because I don't understand most of the things I'm doing lol).
I've got an error that I solved (Tab characters are not allowed in Ren'Py scripts.) but I took me consequent time to understand the indentation error that I needed to re-indenting was after the end of the line and not before lol. Anyway, now I get the error :
File "game/screen_3_complexescreen.rpy", line 769, in announce
at_list=[announcer_float(xalign,yalign_start,delay),])
NameError: name 'announcer' is not defined
And saddly I'm not able to fix it myself. I know a variable is not defined but I'm strugguling to much with Python unknown syntaxe to do it successfully and in a logicial way which match the current code.
So I was wondering, in order to avoid being so dependant from you and harass you with all my questions, maybe I should base this screen I need on a more "renpy" oriented solution. With ALT Transfrom, on hide: on show: linear 0, renpy.random, etc in order to be able to modify it myself.
Because right now, you're python code in my game look like this :
Code: Select all
################################################################################
## DELIRIUM WORDS SCREEN
################################################################################
## total duration of animation
define announcer_rise_time = 6 # in seconds
define delirium_words = "traitor liar cheater killer butcher pervert crazy sick die punishment horrible demon guilty".split()
define time = 4.0
transform announcer_float(x=0.5, y=0.5, delay=0):
# animation for the announced text.
# floats the text to the top of the screen while it fades out.
# x,y must be floats because the linear compares them to floats and it doesn't
# work if they don't match.
align (x,y)
zoom 0.01 alpha 0
pause delay
easein_back 0.15 zoom 1 alpha 1
linear 0.25*announcer_rise_time yanchor 0.625 ypos (y+0.25*(announcer.yalign_end-y))
linear 0.75*announcer_rise_time xalign 0.5+1.1*(x-0.5) yanchor 1.0 ypos announcer.yalign_end zoom announcer.zoom_end alpha 0.
init python:
import time# ⬅︎ add this
def announce(txt):
display_id = "ann_%d" % hash(txt)
xalign = 0.35 + 0.3*renpy.random.random()
delay = 0# i also forgot to copy the part where I defined these variables
yalign_start = 0.5
zorder = 8
layer = 'screens'
renpy.show(display_id, what=renpy.text.text.Text(txt, style="announce_text"), \
layer=layer, \
zorder=zorder, \
at_list=[announcer_float(xalign,yalign_start,delay),])
def hide_announce():
time.sleep(announcer_rise_time)
renpy.hide(display_id)
renpy.invoke_in_thread(hide_announce)
return
# i also forgot to include this earlier
style announce_text is say_label:
size 48
outlines [ (absolute(1), "#ccc", 0, 0) ]
init python:
def delirium_show_word(words):
word = renpy.random.choice(words)
announce(word)
screen delirium_words_screen():
default delay_seconds = 2.5
timer delay_seconds repeat True action Function(delirium_show_word, delirium_words)
################################################################################
And even though I thought I could work on it on my own, right now I realize that I can't devote so much time to it, partly because it means I might have to learn more about Python coding. I've already wasted too much time and my next update is taking longer than expected... So either I'm going to have to give up this visual effect, because if it's a code that I don't understand it would have to it is already exploitable in the state or that it is at least in simple renpy.