[SOLVED] How to make Irisin/out transitions have different shapes?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Cherubunny
Regular
Posts: 26
Joined: Sat Feb 24, 2018 6:52 am
Tumblr: cherubunny
Deviantart: cherubunny
Contact:

Re: How to make Irisin/out transitions have different shapes?

#16 Post by Cherubunny » Sat Feb 24, 2018 2:23 pm

trying to test what you said, but it says this in response:

Code: Select all

While running game code:
  File "game/options.rpy", line 210, in <module>
    config.enter_transition = AlphaDissolve( DynamicDisplayable(heart_zoom), 1.0 )
NameError: name 'heart_zoom' is not defined
...feels kinda like a similar error to what we had in the beginning? i copy pasted ur code to replace the one in script.rpy

note: i havent tested it using the with statement, im mostly focusing on the transitions between screens in options.rpy

EDIT: just switched back to ImageDissolve like u said. no changes tho.
Last edited by Cherubunny on Sat Feb 24, 2018 2:25 pm, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1305
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to make Irisin/out transitions have different shapes?

#17 Post by Remix » Sat Feb 24, 2018 2:24 pm

Roll back and read the reply about config being set before defaults etc... it is the same concept, same fix...

Basically

Code: Select all

init python:
    
    def heart_zoom(st, at):
        return Transform("images/heart.png", anchor=(0.5,0.5), pos=(0.5,0.5), zoom=at*2), 0

    config.enter_transition = AlphaDissolve( DynamicDisplayable(heart_zoom), 1.0 )
could work (as heart_zoom is defined before the config is set)
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Cherubunny
Regular
Posts: 26
Joined: Sat Feb 24, 2018 6:52 am
Tumblr: cherubunny
Deviantart: cherubunny
Contact:

Re: How to make Irisin/out transitions have different shapes?

#18 Post by Cherubunny » Sat Feb 24, 2018 2:32 pm

... well this is strange; it works but it... it's just a regular iris. it's rectangular? and not heart shaped?

User avatar
Remix
Eileen-Class Veteran
Posts: 1305
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to make Irisin/out transitions have different shapes?

#19 Post by Remix » Sat Feb 24, 2018 2:35 pm

Change it to ImageDissolve (as mentioned)...
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Cherubunny
Regular
Posts: 26
Joined: Sat Feb 24, 2018 6:52 am
Tumblr: cherubunny
Deviantart: cherubunny
Contact:

Re: How to make Irisin/out transitions have different shapes?

#20 Post by Cherubunny » Sat Feb 24, 2018 2:40 pm

(gosh ur right sorry i thought i did and apparently i changed it back; that was a nooby mistake on my part!)

ok... this is PROBABLY gonna be the last thing thank u for being so patient with me
but now i have this error?

Code: Select all

While running game code:
Exception: Expected an image, but got a general displayable.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "lib/windows-i686/_layout/screen_main_menu.rpymc", line 28, in script
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\ast.py", line 814, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\python.py", line 1719, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 30, in <module>
    ui.interact()
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2526, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2746, in interact_core
    new_widget=layers_root)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\curry.py", line 38, in __call__
    **dict(self.kwargs.items() + kwargs.items()))
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\display\transition.py", line 475, in __init__
    self.image = renpy.display.im.MatrixColor(image, matrix)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\display\im.py", line 1066, in __init__
    im = image(im)
  File "C:\Users\Stein\Downloads\renpy-6.99.12.4-sdk\renpy\display\im.py", line 1578, in image
    raise Exception("Expected an image, but got a general displayable.")
Exception: Expected an image, but got a general displayable.

User avatar
Remix
Eileen-Class Veteran
Posts: 1305
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to make Irisin/out transitions have different shapes?

#21 Post by Remix » Sat Feb 24, 2018 3:41 pm

No idea on that one, might not even be related to what we did.

Maybe go back to a test environment, get it working there (like my example code earlier)... Get your game working without it (maybe with irisout as a replacement)... Then try to combine the two.

The traceback shows little useful info, so guessing further without seeing all the code (especially whatever is in options) is plain guessing.
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Cherubunny
Regular
Posts: 26
Joined: Sat Feb 24, 2018 6:52 am
Tumblr: cherubunny
Deviantart: cherubunny
Contact:

Re: How to make Irisin/out transitions have different shapes?

#22 Post by Cherubunny » Sat Feb 24, 2018 4:03 pm

went back into a test environment, tried it there -- same error?

User avatar
Remix
Eileen-Class Veteran
Posts: 1305
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to make Irisin/out transitions have different shapes?

#23 Post by Remix » Sat Feb 24, 2018 4:48 pm

Works fine here.
Are you using a new, clean test environment? A [create new project] one? Or just changing script.rpy and keeping options/gui/screens the same?
If not using new-clean-fresh, the error must be in one of the other files instead.
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Cherubunny
Regular
Posts: 26
Joined: Sat Feb 24, 2018 6:52 am
Tumblr: cherubunny
Deviantart: cherubunny
Contact:

Re: How to make Irisin/out transitions have different shapes?

#24 Post by Cherubunny » Sat Feb 24, 2018 5:00 pm

yes i am o: im not sure why we're getting different outcomes? for clarification, can you post what you have so i can compare with what i have?

EDIT: out of curiosity, would using legacy vs the new GUI interface affect the code?

User avatar
Remix
Eileen-Class Veteran
Posts: 1305
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to make Irisin/out transitions have different shapes?

#25 Post by Remix » Sat Feb 24, 2018 8:03 pm

On Ren'py 6.99.14.1 just do [+Create New Project] (so it uses default files) and only change script.rpy to similar to what I posted earlier.

Older versions (legacy gui etc) than that I could not even test on, so you'd have to track the problem yourself.
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
ComputerArt.Club
Veteran
Posts: 406
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: [SOLVED] How to make Irisin/out transitions have different shapes?

#26 Post by ComputerArt.Club » Sun Apr 22, 2018 4:15 am

Hey! I'm trying something similar with a star shaped iris for a portrait aspect ratio game but I am having trouble getting it to work.
Here is the alpha mask:
https://photos.app.goo.gl/rCc5UXy1W1Om8i6Q2
I assume that is what we are looking for?
I tried to modify the above code, but I couldn't get it right, I am getting the following error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 174, in script
    show haobang with star_zoom
TypeError: star_zoom() got an unexpected keyword argument 'old_widget'
Here is what the relevant code looks like:

In the script header:

Code: Select all

init python:
    
    def star_zoom(st, at):
        return Transform("images/stariris.png", anchor=(0.5,0.5), pos=(0.5,0.5), zoom=at*2), 0

    config.enter_transition = AlphaDissolve( DynamicDisplayable(star_zoom), 1.0 )

# The game starts here.

label start:
I also tried:

Code: Select all

init python:
    
    def star_zoom(st, at):
        return Transform("images/stariris.png", anchor=(0.5,0.5), pos=(0.5,0.5), zoom=at*2), 0

    config.enter_transition = ImageDissolve( DynamicDisplayable(star_zoom), 1.0 )

# The game starts here.

label start:
and in the relevant part of the game the code looks like this:

Code: Select all

    if result == "b":
        play sound "gmhaobang.ogg"
        show haobang with star_zoom
        jump game
Any ideas?

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: [SOLVED] How to make Irisin/out transitions have different shapes?

#27 Post by kivik » Sun Apr 22, 2018 5:12 am

According to this thread:

viewtopic.php?f=8&t=27756

You're mixing up transforms (use with keyword "at") and transitions (use with keyword "with"), so the following should work:

Code: Select all

show haobang at star_zoom

User avatar
Alex
Lemma-Class Veteran
Posts: 2308
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [SOLVED] How to make Irisin/out transitions have different shapes?

#28 Post by Alex » Sun Apr 22, 2018 5:20 am

Try ImageDissolve, but you need to modify your star - recolor it to gradient from white to black. Also, see the example in tutorial game.
https://www.renpy.org/doc/html/transiti ... geDissolve

User avatar
ComputerArt.Club
Veteran
Posts: 406
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: [SOLVED] How to make Irisin/out transitions have different shapes?

#29 Post by ComputerArt.Club » Sun Apr 22, 2018 10:14 am

Alex wrote:
Sun Apr 22, 2018 5:20 am
Try ImageDissolve, but you need to modify your star - recolor it to gradient from white to black. Also, see the example in tutorial game.
https://www.renpy.org/doc/html/transiti ... geDissolve
Thanks Alex, you helped me solved a few problems, unfortunately I then encountered a new one, rather than showing the original image(a screen) in the background, it is just showing blackness. Can I do this on top of a screen or do I need to find a different approach? Workaround: I used a static image of the screen behind the mask to get around this problem, works for me in this situation, though not the most elegant or versatile approach.

Anyway, for anyone else trying to do this, here is how I got around the problems: The gradient is needed to create the zooming effect, otherwise it is static, but if you use a radial gradient you get a circular mask inside your shape. To prevent the circular iris effect and instead have a zooming shape effect I created many star shapes with the darkness gradually increasing.

Image

Here is the code I used in the header:

Code: Select all

define staririsout = ImageDissolve("stariris6.png", 0.5)
define staririsin = ImageDissolve("stariris6.png", 0.5, reverse=True)    
    
Here is the code in the game:

Code: Select all

        show haobang with staririsout
        hide haobang with staririsin

User avatar
ComputerArt.Club
Veteran
Posts: 406
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: [SOLVED] How to make Irisin/out transitions have different shapes?

#30 Post by ComputerArt.Club » Mon Apr 23, 2018 10:11 am

Thanks everyone, I made some slightly better looking transitions, including a heart one for the original poster.
Image

More over at this thread:
posting.php?mode=edit&f=52&p=484899

Post Reply

Who is online

Users browsing this forum: Bing [Bot], viper, XxrenxX