[SOLVED]Pop-Up Points on screen and later disapear.

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
johandark
Veteran
Posts: 346
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

[SOLVED]Pop-Up Points on screen and later disapear.

#1 Post by johandark » Sat Jul 16, 2016 3:31 pm

Code: Select all

    ne "¿Go up or not?.."
    
    p "Of course... I really want to see your flat."
    
    $ np += 2
    
    ne "Great! You´ll love it!"
So the thing is... after adding "$ np += 2" the "np" points will be increased in 2.

I manage to put them on screen with:

Code: Select all

init:
            ##DidacPoints.
        
    $ dp = 0
    
            ##NeusPoints.
        
    $ np = 0
    
    #Screen button where Points of life and other stuff is showed.
    
    screen button:
        hbox xalign 0.01:
            
            text "{size=15}Dídac Puntos: [dp]{/size}" outlines [(1, "000", 0, 1)]
            
            text "{size=15} Neus Puntos: [np]{/size}" outlines [(1, "000", 0, 1)]
Now my question is...

How can I show "+2 NEUS POINT!!" or "+3 NEUS POINTS" When the player arrives to that point...

To show it on the right part of the screen apearing off screen and later get back off screen for 2 seconds.

Even if the player has already 132 points... I just want the player knwos 2 Points were increased.


It´s very similar as the game "Simbro" = https://www.patreon.com/simbro is doing, I don´t know if you know that game.

Thanks!
Last edited by johandark on Mon Jul 18, 2016 12:35 pm, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Pop-Up Points on screen and later disapear offscreen.

#2 Post by trooper6 » Sat Jul 16, 2016 4:02 pm

A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
TaoistFruitbat
Newbie
Posts: 20
Joined: Wed Jun 29, 2016 12:46 am
Projects: Soulshine
Contact:

Re: Pop-Up Points on screen and later disapear offscreen.

#3 Post by TaoistFruitbat » Sat Jul 16, 2016 4:06 pm

The notify function does this.

If you want to be extra fancy you can create a function to automatically add the points and notify.

Code: Select all


init python:

    # This class keeps all the points,
    # allowing the variables to be acessed 
    # in functions.
    class PointKeeper(object):

        def __init__(self):

            self.np = 0

    # Make instance of class
    pk = PointKeeper()

    # Adds num points to np and notifys
    # the player
    def add_np(num):
        pk.np += num
        renpy.notify(str(num) + " NEUS POINT!!")
Here add_np(100) would add 100 np points and notify the player. Likewise, pk.np stores the number of np points.

User avatar
johandark
Veteran
Posts: 346
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

Re: Pop-Up Points on screen and later disapear offscreen.

#4 Post by johandark » Sun Jul 17, 2016 4:43 am

Thanks, I didn´t know renpy.notification exists.

The only problem I saw with the solution of "TaoistFruitbat", is that if you roll back and then you repeat that scene, the "Neus Points" increase in number every time you get back and go forward...

Is there a way to solve that problem?

Thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]