Quaking Dissolve

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.
Post Reply
Message
Author
User avatar
Meinos Kaen
Regular
Posts: 107
Joined: Wed Jan 04, 2012 1:01 pm
Completed: JPDE - Sonata of Fire
Projects: JPDE, Ars Oratoria, ONHA
Skype: therealmeinoskaen
Location: Somewhere in Italy...
Contact:

Quaking Dissolve

#1 Post by Meinos Kaen »

Good afternoon from Italy!

So, as I was coding for my Visual Novel, I realized that I need a particular kind of transitions to make the monster enemies killed by the main characters disappear.

What I was thinking of was a transition that makes the sprite shake while dissolving. Can this be done? And if so, with what kind of code?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Quaking Dissolve

#2 Post by Donmai »

Buon pomeriggio dal Brasile. :)
You want an ATL transform.
https://www.renpy.org/doc/html/atl.html ... n-language
Something like:

Code: Select all

transform blast:
        alpha 1.0 xoffset 0
        choice:
            block:
                linear 0.05 xoffset 10
                linear 0.05 xoffset -10
                repeat 2
            block:    
                choice:
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    repeat 2
                choice:
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    linear 0.05 xoffset 10                    
                    repeat 2
        choice:
            block:
                linear 0.05 xoffset -10
                linear 0.05 xoffset 10
                repeat 2
            block:
                choice:
                    linear 0.05 xoffset -10
                    linear 0.05 xoffset 10
                    repeat 2        
                choice:
                    linear 0.05 xoffset -10                    
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    repeat 2
        linear 0.07 xoffset 0
        linear 2.0 alpha .0 # two seconds to dissolve
You can use it this way:

Code: Select all

    play sound "fx/blast.ogg"
    show monster at blast, center #center, or any other screen position the monster was located before being "blasted"
    m "Argh!"
    hide monster # don't forget to actually hide it, to free memory
I like to create a separate script called transforms.rpy, and put my special effects there.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Meinos Kaen
Regular
Posts: 107
Joined: Wed Jan 04, 2012 1:01 pm
Completed: JPDE - Sonata of Fire
Projects: JPDE, Ars Oratoria, ONHA
Skype: therealmeinoskaen
Location: Somewhere in Italy...
Contact:

Re: Quaking Dissolve

#3 Post by Meinos Kaen »

Donmai wrote:Buon pomeriggio dal Brasile. :)
You want an ATL transform.
https://www.renpy.org/doc/html/atl.html ... n-language
Something like:

Code: Select all

transform blast:
        alpha 1.0 xoffset 0
        choice:
            block:
                linear 0.05 xoffset 10
                linear 0.05 xoffset -10
                repeat 2
            block:    
                choice:
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    repeat 2
                choice:
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    linear 0.05 xoffset 10                    
                    repeat 2
        choice:
            block:
                linear 0.05 xoffset -10
                linear 0.05 xoffset 10
                repeat 2
            block:
                choice:
                    linear 0.05 xoffset -10
                    linear 0.05 xoffset 10
                    repeat 2        
                choice:
                    linear 0.05 xoffset -10                    
                    linear 0.05 xoffset 10
                    linear 0.05 xoffset -10
                    repeat 2
        linear 0.07 xoffset 0
        linear 2.0 alpha .0 # two seconds to dissolve
You can use it this way:

Code: Select all

    play sound "fx/blast.ogg"
    show monster at blast, center #center, or any other screen position the monster was located before being "blasted"
    m "Argh!"
    hide monster # don't forget to actually hide it, to free memory
I like to create a separate script called transforms.rpy, and put my special effects there.
Hi, thanks for the answer!

Sadly it doesn't work :/ The game crashes when it tries to do your thing.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Quaking Dissolve

#4 Post by Donmai »

Of course it works, I've used that code myself. What exactly "The game crashes" means?
ShakeDissolve.zip
(296.74 KiB) Downloaded 78 times
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Meinos Kaen
Regular
Posts: 107
Joined: Wed Jan 04, 2012 1:01 pm
Completed: JPDE - Sonata of Fire
Projects: JPDE, Ars Oratoria, ONHA
Skype: therealmeinoskaen
Location: Somewhere in Italy...
Contact:

Re: Quaking Dissolve

#5 Post by Meinos Kaen »

Huh. Weird. I tried using it again and now it works. Nevermind :P

Post Reply

Who is online

Users browsing this forum: Zahdernia