Posted September 09, 2024 by Discover with Mia
#renpy #tutorial #visual novel #indie game #python
~Meowww, my dear code adventurers! πΆβ¨/α - Λ β’γππ ~Mia here, ready to help you make your inventory purr-fect!! Whether you've already explored the code of our Multipage Inventory System available here on my Itchio page Discover with Mia (link below) or you're eagerly awaiting the upcoming video (~coming soon this meoww month!), I've got a paw-some tip for you today!
Free Ren'Py & Python Source Code - Create Your Own Multipage Inventory System:
https://discover-with-mia.itch.io/free-source-code-renpy-python-multipage-invent...
Before we begin, ~thank you soooo much for all your supportive messages! ~Your encouragement keeps me motivated as I continue editing the upcoming video, which will be released this month. ~I promise I will try my best to make it meowww purrrfect! πΌπΎ(ΛΆα΅ α΅ α΅ΛΆ)ππβ¨
~Step 1: Adjust the Items Per Page~ πβ¨(=^ο½₯^=)π
First step: letβs decide how many items should be displayed per page. ~Itβs like organizing your magical stash of potions and legendary swords!
~Head to line 24 of your code (weβre using Visual Studio Code, ~our meoww mighty weapon!):
class Inventory(object):
def __init__(self, items_per_page=18):
Old value (6 columns x 3 rows = 18 items)
~Mia's Tip! If you're using a 3x2 grid (3 columns and 2 rows = 6 items), ~you should update the number of items to:
class Inventory(object):
def __init__(self, items_per_page=6):
New value (3 columns x 2 rows = 6 items)
And just like that, ~you now have a cozy little grid with 6 items per page! ~So easy, right?
~Step 2: Update the Grid Layout~ π»β¨(=^ο½₯^=)π
~Next, weβll rearrange the grid columns and rows to match the new cozy layout!
~Head over to line 177 in your code!
grid 6 3:
Old layout (6 columns and 3 rows)
~Change that to:
grid 3 2:
New layout (3 columns and 2 rows)
Now your inventory looks paw-some and perfectly organized! ~Smaller but so much more efficient! ~Meowww approves!
~Step 3: Adjust the Loop Logic~ π(=^ο½₯^=)π§©
Head to line 181 (this is where the magic happens!):
for i in range(18):
Old loop (for 18 items)
~Mia's Tip! For a 3x2 grid, we need to adjust this loop to display 6 items, like this:
for i in range(6):
New loop (for 6 items)
~And meowww boom boom boom boom boom (yeah...ok ok, I'm exaggerating that a bit...~haha sorry)! ~Your grid now displays exactly the right number of items, perfectly arranged for your next RPG adventure with a purr-fect inventory! ποΈπΈβ¨/α > Λ <γπ
~Quick Meoww Math Reminder!π
~The number of items displayed is based on the simple formula: columns β rows:
- 3 columns β 2 rows = 6 items.
- If you prefer a smaller grid, like a 2x2, it would be 2 β 2 = 4 items.
~Remember, you can tweak these numbers depending on your needs and game style! ~Iβm still editing the video to make sure everything is just right! ~Special thanks to Andi! ~Iβm putting all my heart into making it both kawaii and technically helpful!
I think it will be ready by the end of the month, ~soooo please, ~stay tuned. ~Thank you sooo much for your patience and all your sweet messages! ~If you need anything, donβt hesitate to reach me and I will be more than excited to help you during your journey!
~Have a blessed day and love you!
P-S: If you see this message... well...~I just want to say a big thank you for reading!! (Yaaay! Well...haha...sorry, I'm a little too excited to write this but it really means a lot to me!) ~Your support means a lot to me! ~Have a blessed day + ~I love you! πππΈ/α Λ΅> ο»<Λ΅γπ«π