So I've finally made it work! Thanks so much to
@LimitElta on twitter for helping me figuring this out! And to Remix for showing me the first steps to figuring this out!
I'm posting the solution in case someone wants help on this too!!
You have this animation made with ATL:
Code: Select all
transform blink:
alpha 0.0
linear 1.0 alpha 1.0
linear 1.0 alpha 0.0
repeat
So you want the player be able to disable it because the animation can probably make someone's head a bit dizzy (like flashy lights or things that appears and dissapear too fast). You simply need to put this code:
Code: Select all
init python:
def atl_can_run(*args):
if persistent.atl_allowed:
return 1.0 ##you need to put here 1.0 and not None.
return None
transform blink:
function atl_can_run ##it needs to be put here first before alpha 0.0 bc otherwise, the persistent won't work
alpha 0.0
linear 1.0 alpha 1.0
linear 1.0 alpha 0.0
repeat
Then, on the screen of Options/Configuration, you put this:
Code: Select all
textbutton "No Anim" action ToggleField(persistent, "atl_allowed", true_value=True, false_value=False)
And if you want the
animation to play by
default and to give the option to the player to disable it manually just put, outside of any label or screen statement, the following:
Code: Select all
default persistent.atl_allowed = False
With this, by default, the animation will play. But if you go to the Options/Configuration Screen and disable it, only the images you've put will appear but not the blinking animation.
BUT if you want to use an alternative image when disabling it, in your script, put:
Code: Select all
if persistent.atl_allowed:
scene bg background_image #or
show whatever_image_u_like
else:
show image at blink
[edited] It works fine like this now! ^^
Thanks to everyone who helped me out here! <3