[Given up] ATL Loop

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
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

[Given up] ATL Loop

#1 Post by Gear »

I've got an image I want to loop a scrolling ATL code with.

That made no sense, even to me. Let me try again.

I have a semi-transparent image (steam, specifically) that I want to rise from the bottom of the screen to the top, but the image has to start at the top of the screen first, and then loop infinitely as long as that scene is active. I have two problems:
1) It won't loop. It just stops, and I thought a repeat code would fix it, but it doesn't seem to.
2) It slows down the whole game. It might just be my computer, but my failed attempts to make the steam move seems to make my computer run ridiculously slow, like it's overtaxing the machine.

Anyway, does anyone have any snippets of code they can share? I'm stumped.

EDIT: My most recent failed attempt:

Code: Select all

    scene bg shower
    show jin
    show steam
    show steamroll:
        linear 10.0 yalign 0.0 yanchor 3.0
        repeat
Last edited by Gear on Sun Sep 11, 2011 5:24 pm, edited 1 time in total.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: ATL Loop

#2 Post by Anima »

The problem is most likely that the image still has the same properties when you loop. You'll need to reset the position of your image.
Using yalign and yanchor at the same time is also a bad idea, since yalign sets the anchor value on it's own.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: ATL Loop

#3 Post by Gear »

I was trying to set the image at the top of the screen, and bring the bottom of the image to the top using the linear tag. Am I using the wrong code for this?
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

bink
Regular
Posts: 49
Joined: Sat Jul 09, 2011 4:34 pm
Contact:

Re: ATL Loop

#4 Post by bink »

You will have to set the properties within the repeat before moving it.
Right now, it just repeats a linear, 10 seconds movement to yalign 0.0 yanchor 3.0. After the first time, it will be there already and just stay there for 10 seconds.
Do something like this:

Code: Select all

show steamroll:
    xanchor 0.5 yanchor 0.5
    xpos 0.5 ypos 2.0 # place it off screen
    linear 1.0 ypos -2.0 # move it upwards through the screen
    repeat
It will repeat all of the position setting as well, so when the linear movement is done, it will jump back to the bottom of the screen and loop around.
Experiment with the values for xpos and ypos a bit to figure out what looks best in your scene.

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: ATL Loop

#5 Post by Gear »

That's a definite start, but it's not there yet.

I pasted it directly, then made alterations. I changed the length after linear to 10.0 to slow it down, then changed the ypos to 1.0 so the steam would start at the top of the screen and scroll. The only issue I have now is that the image will repeat the animation, but once it reaches the end of the graphic (or the bottom) it doesn't loop it immediately, causing the end of the graphic to scroll to the top of the screen completely before repeating the fog effect again. Is there any way I can loop it continuously so there's no break in the steam?
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

bink
Regular
Posts: 49
Joined: Sat Jul 09, 2011 4:34 pm
Contact:

Re: ATL Loop

#6 Post by bink »

I don't understand what kind of effect you're going for here... could you elaborate?
Maybe it would help if you put up a picture of what you want it to look like?

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: ATL Loop

#7 Post by Gear »

Hard to put up a picture, but let's see.

My game is 800x600. Therefore, I've created an image of white steam that is 800x1800. I want the steam to rise in the scene continuously. As it stands, when Ren'Py hits x1800, the steam ends abruptly and rises, then it starts again at X0. I want it to be continuous, however, and have the circulation restart immediately when it reaches the end of the cycle.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

bink
Regular
Posts: 49
Joined: Sat Jul 09, 2011 4:34 pm
Contact:

Re: ATL Loop

#8 Post by bink »

To do that, you probably need two images on the screen at the same time. Or is the image you are using made up of three identical 800x600 images? If that is the case, it's all about figuring out the right numbers. If it isn't, you'll have to use two images and move them with the proper distance in between. That might turn out to be very, very slow though. High resolution images with semi-transparent parts tend to slow down everything quite a bit.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Ocelot