Making an inventory..?

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
RauniKai
Newbie
Posts: 3
Joined: Wed Mar 09, 2011 11:26 pm
Contact:

Making an inventory..?

#1 Post by RauniKai » Wed Mar 09, 2011 11:33 pm

I've recently started using Ren'Py, but I have a problem in that I've never scripted ANYTHING with python prior to downloading this program. Hopefully I'm not trying to take on something too complicated, but...

How would one go about making an inventory?

-how to create a separate screen for inventory
-making a button to link to the inventory screen
-making 'items' to go into the inventory

I hope I'm not asking too much...
I just really have no idea where to start. I've tried looking at other threads, but I have trouble understanding how Python works >.>

Any help is appreciated.

Friendbot2000
Regular
Posts: 161
Joined: Tue Feb 15, 2011 8:00 pm
Projects: Mutagen : Journey to Haven's Landing
Contact:

Re: Making an inventory..?

#2 Post by Friendbot2000 » Tue Mar 15, 2011 11:06 am

My suggestion would be to keep your total game idea on hold for the moment. Pick a scene for the game and experiment with python. Once you get the basics down you can expand onto bigger things. Always remember that when you start programming pick a small spot on your main program and build out. This keeps you from being overwhelmed by the enormity of your task. There are a couple of really good python tutorials that I have on file. I could PM you the files if you like. The tutorial was created by my Intro to Programming teacher. They are absolutely wonderful and very helpful. There is also the option of looking for tutorials online. <a href="http://www.tutorialspoint.com/python/index.htm">Here</a> is a decent one.
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games

User avatar
KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Making an inventory..?

#3 Post by KimiYoriBaka » Tue Mar 15, 2011 6:45 pm

well, it is good to know python when working with renpy, but actually, the whole inventory thing is best done with screen language, which can be found in the documentation. you'll still need python for the variables that contain the inventory itself, but the screen to show the inventory should be done using renpy itself.

User avatar
RauniKai
Newbie
Posts: 3
Joined: Wed Mar 09, 2011 11:26 pm
Contact:

Help adding items to inventory?

#4 Post by RauniKai » Sun Apr 03, 2011 3:25 pm

Thanks for the help guys :D
I've been playing around with Renpy and various tutorials and managed to make a button linking to a separate screen for inventory.

My only problem now is being able to pick up items and have them show up in the inventory screen.

Suggestions?

This is what the code for the actual inventory looks like right now, if it helps :wink:

Code: Select all

# show button for inventory
screen inventory_screen:
    tag None
    zorder 1
    modal False
    
    vbox xalign 0.01 yalign 0.01:
        textbutton "Inventory" action ui.callsinnewcontext("inventory_screen")

#this makes the inventory screen itself
label inventory_screen:
    python:
        while True:
            ui.frame (background=Frame(("Fractal.bmp"),12, 12))
            with ui.fixed():
                ui.at(Position(xalign = 0.5, yalign = 1.0))
                
                #return button
                ui.textbutton("Resume", clicked=ui.returns("return"))
            
            result = ui.interact()
            if result == "return": break
    return
You can use what's yours, except when you can't

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]