Add counter on the screen?

Discussion in 'RGSS3 Script Requests' started by Koi, Jul 26, 2016.

    Tags:
  1. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    I have a shooting duck mini game where you shoot different ducks for different points (adding onto a "duck" variable), and I want to show a counter on the screen. Is there a way to do this?
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    you will need a script
     
    #2
  3. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    Should I make a thread in the script forum? Or can this be moved there?
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    just report it and ask a mod to move it.
     
    #4
  5. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    How do I do that?
     
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    On your first post (on all your posts actually), there is a Report post link at the very top of the post.
     
    #6
  7. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    Okay did that.
     
    #7
  8. Kes

    Kes Global Moderators Global Mod

    Messages:
    19,711
    Likes Received:
    10,084
    First Language:
    English
    Primarily Uses:
    RMVXA
    I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
     
    Last edited by a moderator: Jul 26, 2016
    #8
  9. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    Bump...?
     
    #9
  10. Andar

    Andar Veteran Veteran

    Messages:
    27,525
    Likes Received:
    6,150
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    you should look for a so-called HUD script on the master script list.


    HUD is a general description of adding data displays to the screen, and most of the HUD-scripts will add a lot more than you want, but there should be some that can be configured to add only a few variables on the screen.
     
    #10
  11. HexMozart88

    HexMozart88 The Master of Random Garbage Veteran

    Messages:
    1,597
    Likes Received:
    2,866
    Location:
    A small hut in the forest
    First Language:
    English
    Primarily Uses:
    RMVXA
    There are one or two scripts that allow you to show the value of any given variable. Or, depending on exactly how many ducks there are going to be, you can use pictures. 
     
    #11
  12. Koi

    Koi Veteran Veteran

    Messages:
    358
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Primarily Uses:
    RMVXA
    Well this is what it looks like.


    ducks.png


    Top duck scores 1 point, middle 2 points, and bottom 3 points. And I want a counter to appear in the corner showing the score. I was just looking at HUD scripts, and something that would display gold or an item could work because I'd just replace adding onto the variable with adding currency or an item each time. But, the only one I could find for gold requires a core script that could mess with the other scripts that I already have.
     
    Last edited by a moderator: Aug 6, 2016
    #12
  13. HexMozart88

    HexMozart88 The Master of Random Garbage Veteran

    Messages:
    1,597
    Likes Received:
    2,866
    Location:
    A small hut in the forest
    First Language:
    English
    Primarily Uses:
    RMVXA
    One: cool minigame! Two, I think you can use show picture for that.


    1. Split the variable into digits. The way to do that is by using multiple variable commands. Variable 1 is the hundreds place. Do the original variable / 100.


    Variable 2 is the tens place. The original variable % 100, then divide that by 10. Variable 3 is in the ones place. Original variable % 10. 


    2. Once you have that done, make your pictures. They should be named "1", "2" etc. 


    3. Make a series of conditional branches for each variable, example: if variable (such and such) is equal to 1, show picture 1, "1"


    4. For the tens and hundreds places, if the variable equals 0, make another conditional branch inside of that conditional branch to check if the original variable is greater than or equal to 10 for the tens place and 100 for the hundreds place. If not, erase that picture. That's to avoid having leading zeroes. 


    I find it looks ugly to see 001. I prefer just 1.  
     
    #13

Share This Page