Search found 2251 matches

by Alex
Fri Aug 16, 2019 5:48 pm
Forum: Ren'Py Cookbook
Topic: Simple minigames (Screen Language only).
Replies: 79
Views: 36061

Re: Simple minigames (Screen Language only).

...I have tried several things but I can't figure out how to disable the buttons after time is up. Hi, Matalla! All game tiles are buttons, so you can use a variable to set their 'sensitive' property to True/False. https://www.renpy.org/doc/html/screens.html#button Here's an example of this - https...
by Alex
Thu Aug 15, 2019 3:55 pm
Forum: Ren'Py Questions and Announcements
Topic: Select Menu
Replies: 6
Views: 172

Re: Select Menu

Some tips: - $-sign is used only at the very beginning of code line to show that it's a single line of python code. if cheelai_points >= 4: - indentation do matters. The first line of code block ends with colon, and other lines of that block have an extra indentation (otherwise you'll get an error)....
by Alex
Tue Aug 13, 2019 7:00 pm
Forum: Ren'Py Questions and Announcements
Topic: Appending list items and displaying them live on a screen
Replies: 11
Views: 93

Re: Appending list items and displaying them live on a screen

That's how it works. The variable do changes, but you need to refresh screen to see it. This works for me (info updatse right when you click on button first time) default my_list = [] default newitem = "" default input_active = False init python: def input_item(newstring): store.newitem = newstring ...
by Alex
Tue Aug 13, 2019 6:27 pm
Forum: Ren'Py Questions and Announcements
Topic: Appending list items and displaying them live on a screen
Replies: 11
Views: 93

Re: Appending list items and displaying them live on a screen

Well, you see - it actually updates. But changes doesn't show up untill screen is refreshed/reshown (it happens when you click on button next time, or if you click to progress through the game). So try to force screen refreshening - add renpy.restart_interaction() function to your 'input_item' funct...
by Alex
Tue Aug 13, 2019 5:20 pm
Forum: Ren'Py Questions and Announcements
Topic: Appending list items and displaying them live on a screen
Replies: 11
Views: 93

Re: Appending list items and displaying them live on a screen

Code in an init block run on every game run, so your vars willl be reset. If you need to properly store them use 'default' statement - https://www.renpy.org/doc/html/python.html#define-statement If you want to use custom function in a screen use Function action, like action [Function(add_item, newit...
by Alex
Tue Aug 13, 2019 5:03 pm
Forum: Ren'Py Questions and Announcements
Topic: variable and save files
Replies: 2
Views: 63

Re: variable and save files

The issue is that you create your 'message1' variable in an init block, so it recreated every time you run the game. Same thing with styles. Try to define 'message1' as default message1 = Message(text="hello world") (outside of any block). Also, you souldn't change styles mid-game. You can create se...
by Alex
Sun Aug 11, 2019 1:30 pm
Forum: Ren'Py Questions and Announcements
Topic: Call fonction in a general screen
Replies: 8
Views: 633

Re: Call fonction in a general screen

Well, I'm not good at it, but... If you have a class init python: class Player: def __init__(self, hp, mp, atk, defense, mdef,level=1): self.hp = hp self.mp = mp self.max_hp = hp self.max_mp = mp self.atk = atk self.defense =defense self.mdef =mdef self.level = level self.weapon = None self.armor = ...
by Alex
Sun Aug 11, 2019 1:08 pm
Forum: Ren'Py Questions and Announcements
Topic: Menu question
Replies: 1
Views: 72

Re: Menu question

You can have as many choices as you wish... but this requires the choice screen customization to show all of them to player...))

Check this thread (should help) - viewtopic.php?f=8&t=52172
by Alex
Sun Aug 11, 2019 12:57 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How do grids work?
Replies: 14
Views: 383

Re: How do grids work?

Try to add another variable... # game screen screen game_field(): default my_var = 0 if my_var == 0: timer 0.01 action [SetScreenVariable("my_var", 1)] # need some time to hide next timer and show it again if my_var == 1: timer 2.0 action [SetVariable("avatar", 5), SetScreenVariable("my_var", 2)] el...
by Alex
Sun Aug 11, 2019 3:29 am
Forum: Ren'Py Questions and Announcements
Topic: Loaded game event
Replies: 2
Views: 101

Re: Loaded game event

Try it like

Code: Select all

label after_load:
    m "Oh! So you are really back for me?"
    return
https://www.renpy.org/doc/html/label.ht ... -statement
by Alex
Sat Aug 10, 2019 12:43 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How do grids work?
Replies: 14
Views: 383

Re: How do grids work?

Try to add an 'offset' when showing player's token, like if py == y and px == x: add "token" offset(20, -20) # that is 20 pxls to the right and 20 pxls up How to tell the game that there is an offset - it's up to you...)) For example, you can set such a tile as 2 in your 'gf', and later check the ti...
by Alex
Fri Aug 09, 2019 1:12 pm
Forum: Ren'Py Questions and Announcements
Topic: Call fonction in a general screen
Replies: 8
Views: 633

Re: Call fonction in a general screen

Well, if 'container_found.items' is a list and you want to make it empty on showing the screen, then try to set it to en empty list when screen is shown (but test if saving/loading/rollback works fine). screen lalala(): on "show" action SetField(container_found, 'items', []) https://www.renpy.org/do...
by Alex
Tue Aug 06, 2019 7:14 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How do grids work?
Replies: 14
Views: 383

Re: How do grids work?

... # if not yet - let him/her move the token else: key "focus_left" action SetVariable("x", max(x-1, 0)) key "focus_right" action SetVariable("x", min(x+1, 9)) key "focus_up" action SetVariable("y", max(y-1, 0)) key "focus_down" action SetVariable("y", min(y+1, 6)) This part sets the actions for k...
by Alex
Mon Aug 05, 2019 12:41 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]How do grids work?
Replies: 14
Views: 383

Re: How do grids work?

bonnie_641 wrote:
Fri Aug 02, 2019 10:01 pm
...
There's a kind of sample - viewtopic.php?f=8&t=55947&p=514658#p514658