Getting numeric input from user on screen

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
shylock
Regular
Posts: 35
Joined: Wed Oct 13, 2010 11:57 am
Projects: Isle of St. Marcus, `Silver Seas'
Location: Upstate NY
Contact:

Getting numeric input from user on screen

#1 Post by shylock »

Okay, hopefully I can make this clear.

I have a hero who trades goods. So I have a bunch of prices for different goods in different towns which move randomly and also in response to certain events in the story. That's easy. I want hero to be able to buy/sell in different towns. So I need to have a screen that pops up on demand and displays the relevant prices in question, allows hero to input desired quantities to sell/buy, and checks it against hero's money balance.

I really have no idea how to do anything visual. I've been reading a lot of the documentation for ui functions - ui.grid, ui.button, etc - but it just doesn't make any sense for me right now. Any advice is really appreciated.

lazuli
Newbie
Posts: 18
Joined: Tue Jan 11, 2011 6:24 am
Projects: TK(ten kara), Resent0
Contact:

Re: Getting numeric input from user on screen

#2 Post by lazuli »

Actually I would like to have that in my project as well, though it must be some sort of naming your pets/items/characters. I saw an example in the latest Ren'Py tutorial, but it did not reveal the tag it used to make such. :( Let's hope someone could help.
Warrior + Supporter = Junction

Let the sword breathe fire.
Let the fire sheathe the sword.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Getting numeric input from user on screen

#3 Post by Aleema »

ui.input takes input from the player. There's an example on the page there. You can look at the source code for the tutorial, too (hitting Shift+E should take you to the general area.)

lazuli
Newbie
Posts: 18
Joined: Tue Jan 11, 2011 6:24 am
Projects: TK(ten kara), Resent0
Contact:

Re: Getting numeric input from user on screen

#4 Post by lazuli »

Aleema wrote:ui.input takes input from the player. There's an example on the page there. You can look at the source code for the tutorial, too (hitting Shift+E should take you to the general area.)

Oh, yeah. The codes can't be shown if you open the files by itself, so it should be opened using the Ren'Py Launcher (Edit Script, then all the files used in the tutorial will be shown.). o.o Thanks.
Warrior + Supporter = Junction

Let the sword breathe fire.
Let the fire sheathe the sword.

Post Reply

Who is online

Users browsing this forum: No registered users