Stats System (just like persona 5's social stats) [YouTube] - Free source code on itch.io

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Stats System (just like persona 5's social stats) [YouTube] - Free source code on itch.io

#1 Post by mavyxdawn »

I created a project in itch.io that contains the code for a Stats System I created.
https://zeillearnings.itch.io/stats-system

Image
So far, this contains code for a simple stats system + displaying the stats.
I will create a new project in the future with an improved version of this.

End goal:
  • Create a weekly scheduling system for a stats-increasing game
I intentionally decided to make separate projects for each "improvement/feature" so that the code is easier to grasp, even for non-programmers.
I will continue posting on this thread for future updates!
Last edited by mavyxdawn on Mon Jun 21, 2021 6:39 pm, edited 3 times in total.
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Stats System - Free source code in itch.io

#2 Post by mavyxdawn »

I've uploaded Version 2!

Changes:
  • I separated the stats UI from the game screen.
  • I added a background and a return button in the Stats UI.
Of course, answering the teacher correctly would still increase your knowledge!

Game Scene
Image

StatsUI
Image
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

RenGames69
Newbie
Posts: 17
Joined: Sat Sep 12, 2020 12:59 pm
Contact:

Re: Stats System - Free source code on itch.io

#3 Post by RenGames69 »

Hello, I tried to use it but it's not showing on the screen. I have no idea what's wrong. Can you show me exactly where to put this code in the script?

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Stats System - Free source code on itch.io

#4 Post by mavyxdawn »

Hi! Yes, first you'll need to download the zip file, Stats - Version 2.zip.
1. Extract it and you'll find an images folder and a script.rpy.
2. Create a new project in Ren'Py Launcher.
3. Copy-paste(/replace) the files and folders from the zip into the game folder.
Then you can play the game. Please let me know if that worked for you!
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Stats System - Free source code on itch.io

#5 Post by mavyxdawn »

RenGames69 wrote: Sun May 30, 2021 4:30 am Hello, I tried to use it but it's not showing on the screen. I have no idea what's wrong. Can you show me exactly where to put this code in the script?
I'm also on the latest version of Ren'py and I've created a video tutorial just in case.
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

RenGames69
Newbie
Posts: 17
Joined: Sat Sep 12, 2020 12:59 pm
Contact:

Re: Stats System - Free source code on itch.io

#6 Post by RenGames69 »

Ok but I don't want to start a new game I want to past it to my existing game. I tried like this just to see stats screen

scene bg bedroom
with fade

screen gameUI:
imagebutton:
xalign 1.0
yalign 0.0
xoffset -30
yoffset 30
auto "UI/stats_%s.png"
action ShowMenu("StatsUI")

## Stats UI
screen StatsUI:
add "UI/bg peach.png"
frame:
xalign 0.5
yalign 0.5
xpadding 30
ypadding 30

hbox:
spacing 40
# Text Column
vbox:
spacing 10
text "Knowledge" size 40
text "Charm" size 40
text "Guts" size 40
text "Kindness" size 40
text "Proficiency" size 40

# Values Column
vbox:
spacing 10
text str(knowledge) size 40
text str(charm) size 40
text str(guts) size 40
text str(kindness) size 40
text str(proficiency) size 40

## Show a Return button
imagebutton:
xalign 1.0
yalign 0.0
xoffset -30
yoffset 30
auto "UI/return_%s.png"
action Return()


show alicepajama at center

a "Hi, my name is Alice."

a "I just moved to Los Angeles to make my American dream come true."

a "I always wanted to become a movie star, and I knew I need to move to California if I want to progress with my career."

It's like pyton not seeing this.

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Stats System - Free source code on itch.io

#7 Post by mavyxdawn »

Oh! if that's the complete code it's probably because there's no "label start:" and you don't have "show screen gameUI".

Code: Select all

label start:
    show screen gameUI
    scene bg bedroom
    with fade
    

    show alicepajama at center

    a "Hi, my name is Alice."

    a "I just moved to Los Angeles to make my American dream come true."

    a "I always wanted to become a movie star, and I knew I need to move to California if I want to progress with my career."

    It's like pyton not seeing this.
    return
    
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Stats System (just like persona 5's social stats) - Free source code on itch.io

#8 Post by mavyxdawn »

Finally! I finished my YouTube tutorial for this~


Stats UI
This is focused on navigation using imagebutton and ShowMenu().




Stats System
This is focused on:
  • using a flag call with return.
  • choices with required stat points (using jump)
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

Post Reply

Who is online

Users browsing this forum: No registered users