Using ATL and choices to create a scanning like 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.
Post Reply
Message
Author
Elebouffant
Newbie
Posts: 2
Joined: Mon Jul 06, 2015 10:38 am
Contact:

Using ATL and choices to create a scanning like animation

#1 Post by Elebouffant » Sun Aug 02, 2015 7:23 pm

Hey there! I'm trying to code an animation with ATL that takes an image and gives it the impression of being scanned, like when you're scanning a map for a town name or something like that.

I have something that works, but I want the idea of constantly scanning the map, and the code I have at the moment creates awkward pauses, as I have it interpolating from it's current alignment to another one. Here's the code.

Code: Select all

image map_scanning:
    "placeholder.jpg"
    zoom 2.0
    block:
        choice:
            linear 5.0 align (0.0, 0.0)
        choice:
            linear 5.0 align (1.0, 0.0)
        choice:
            linear 5.0 align (0.0, 1.0)
        choice:
            linear 5.0 align (1.0, 1.0)
        1.0
        repeat
(I'm using a large placeholder image with zoom, but I will change this for a larger image when I acquire art assets for my project, and I will inclue more "directions" if I decide to use choice later on, like mid right, mid left etc)

So, as you can see, each choice has the same chance of happening, but there's a 1/4 chance of the image just not moving, and this rather spoils the illusion of constantly scanning the map. Is there a way I can make it so that, after a repeat the same choice is never made twice? Should I be using choice in the first place or is there a better solution?

Thanks in advance <3

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Using ATL and choices to create a scanning like animatio

#2 Post by octacon100 » Fri Aug 14, 2015 4:58 pm

Hey, not sure if you're still looking for answers, but I had a couple of ideas.

1. Have a variable that tracks which choice was used - Not sure that would actually work.

2. Extend each choice to have more than one linear movement, so

Code: Select all

choice:
            linear 5.0 align (0.0, 0.0)
becomes

Code: Select all

choice:
            linear 5.0 align (0.0, 0.0)
            linear 5.0 align (0.5, 0.5)
All choices would meet in the middle and then go out, so you'll always get movement.

3. Use xoffset and yoffset instead, so that you will always get movement. You might get the image scrolled off the screen, but at least you won't get any stillness.

I think I'd probably go with 2, as long as you can place the 2nd line somewhere different for each choice.

Hope that helps!
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

Post Reply

Who is online

Users browsing this forum: zyric