Animated Number Displayable?

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
belphe
Newbie
Posts: 9
Joined: Fri Sep 30, 2016 8:05 pm
Contact:

Animated Number Displayable?

#1 Post by belphe »

Hi all,

I apologize in advance if there's a solution posted for this somewhere. I've tried fooling with Ren'py's timer displayable from the tutorial, searched the forum, and checked the cookbook directory and couldn't find exactly what I'm looking for.

There is a scene in the project I'm currently working on where the player enters into a parody Yu-Gi-Oh-style duel. What I am attempting to do is implement a lifepoint screen that begins at 4000, and ends at 0. At appropriate points in the story, I'd like to be able to enter a command that subtracts/adds a certain number of points to the player's total, while the numbers animate rolling down or up accordingly over a period of a few seconds.

Any help or a nudge in the right direction to where I might find a solution would be most appreciated. Thanks, in advance, for your time ^^

Apa
Regular
Posts: 103
Joined: Fri Dec 23, 2016 2:26 am
Location: NYC
Contact:

Re: Animated Number Displayable?

#2 Post by Apa »

IMO, ATL is the way to go.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
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: Animated Number Displayable?

#3 Post by Remix »

bar with AnimatedValue...

Code: Select all

default hp = 4000
screen ani_bar():
    fixed:
        bar value AnimatedValue(value=hp, range=4000, delay=1.0, old_value=None)

label start:
    show screen ani_bar
    "start"
    $ hp-=100
    "owww"
    $ hp += 100
    "yay"
    $ hp-=3800
    "ouchies, almost dead."
Frameworks & Scriptlets:

belphe
Newbie
Posts: 9
Joined: Fri Sep 30, 2016 8:05 pm
Contact:

Re: Animated Number Displayable?

#4 Post by belphe »

Remix wrote: Thu Dec 21, 2017 5:23 pm bar with AnimatedValue...

Code: Select all

default hp = 4000
screen ani_bar():
    fixed:
        bar value AnimatedValue(value=hp, range=4000, delay=1.0, old_value=None)

label start:
    show screen ani_bar
    "start"
    $ hp-=100
    "owww"
    $ hp += 100
    "yay"
    $ hp-=3800
    "ouchies, almost dead."
Ah, thank you! This is almost what I need, though instead of a lifebar what I need are the point digits, if that makes sense

Like this: https://www.youtube.com/watch?v=9rr7kXXcM5M

I know something similar to this is possible since the functionality exists in trooper6's digital clock recipe in the cookbook, though I wasn't able to figure out how to piece it away from the clock format.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot]