I need help with animation

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
zeo1fan
Newbie
Posts: 18
Joined: Mon Aug 01, 2011 9:35 pm
Contact:

Re: I need help with animation

#16 Post by zeo1fan » Tue Aug 02, 2011 3:33 pm

Wait, so I need to assign a number to the image rather than a word then? Some_move_trans sounds kind of vague. :o

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

Re: I need help with animation

#17 Post by Alex » Tue Aug 02, 2011 3:49 pm

Your code looks rather messy now... slight changes and it would look fine.
At first, you should declare the transform and then - use it, like

Code: Select all

init:
    image Negi = "magic.png"

    transform some_move_trans:
        xalign 0.7 yalign 0.0
        linear 3 xalign 0.3 yalign 0.5

label start:
    show Negi with dissolve at some_move_trans

    L "Yo!"
In your example, it also mixed the showing of an ATL image (http://www.renpy.org/doc/html/atl.html# ... -statement) and transform declaration (http://www.renpy.org/doc/html/atl.html# ... -statement).
And pay more attention to indentation of lines (http://www.renpy.org/wiki/renpy/FAQ#How ... _blocks.3F)

zeo1fan
Newbie
Posts: 18
Joined: Mon Aug 01, 2011 9:35 pm
Contact:

Re: I need help with animation

#18 Post by zeo1fan » Tue Aug 02, 2011 4:06 pm

So if I want to do a transform I need to definite it before Init? Sorry, please be patient. This is the first time I've ever programmed.

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

Re: I need help with animation

#19 Post by Alex » Tue Aug 02, 2011 4:16 pm

zeo1fan wrote:So if I want to do a transform I need to definite it before Init? ...
Inside <init:> block. There you can declare transforms, displayables, characters, etc.

zeo1fan
Newbie
Posts: 18
Joined: Mon Aug 01, 2011 9:35 pm
Contact:

Re: I need help with animation

#20 Post by zeo1fan » Tue Aug 02, 2011 4:50 pm

Okay. Now how do I set different options for the menu.

For example, if the player picks option A then so-and-so sees one image, but if the player picks option b then so-and-so sees another image. Basically, how do you specify what's going to happen when one option is picked?

User avatar
squark
Veteran
Posts: 277
Joined: Fri Aug 17, 2007 9:59 am
Completed: Tour de Pharmacy (Proofreader), The Abandoned Land: Book One (Proofreader)
Projects: Raven Hollow (Core Coder, Proofreader), The Universal Hope (Core Coder, Proofreader)
Organization: FlareBlue Entertainment
Location: Always somewhere behind you...
Contact:

Re: I need help with animation

#21 Post by squark » Fri Aug 05, 2011 10:40 am

A menu command?

I'm quite tired but I'll think about this anyway.

So, you want a different image to be displayed depending on choices? Heh, we were all in the same boat once, so here's something that should work.

Below this line, define another image, like so:

Code: Select all

init:
    image Negi = "magic.png"
    image optA = "optA.png" #this is just for example, rename it to something meaningful
    image optB = "optB.png" # likewise
Then, do this where you want the menu called:

Code: Select all

    menu:
        "This is Option A" :
        show optA

        "This is Option B" :
        show optB
Alternatively, you can use jump labels if you want a bunch of stuff to happen afterwards:

Code: Select all

    menu:
        "This is Option A" :
        jump optA

        "This is Option B" :
        jump optB

# some other stuff

label optA :
    show optA
#some other stuff

label optB :
    show optB
#some other stuff
The jump system may seem like it's more work, but really it's quite handy. Just remember, jump always jumps to a label, and label has be named the exact same thing, see above. It can even share the same name as an image, but as the image is defined as an image, it's all good. This should be good enough. I'm quite tired and frazzled.

Hope this helps ^^
Without communication, nothing is possible.
"All we see or seem
Is but a dream within a dream.

I stand amid the roar
Of a surf-tormented shore"
-- Edgar Allen Poe, "A Dream Within A Dream"
Current Projects:
Universal Hope Stalled
Raven Hollow (on hold for now)
Peace and Love,
Squark

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Discostar, Google [Bot]