Search found 77 matches

by span4ev
Thu Oct 27, 2022 9:40 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why does 'background' in the condition disable 'hover_background'?
Replies: 2
Views: 100

Re: Why does 'background' in the condition disable 'hover_background'?

I understand that I can explicitly specify hover_background. But I want to understand the principle of this problem and, if possible, put all the styles in style blocks instead of specifying them in the loop body Setting the background property sets the idle_background and hover_background properti...
by span4ev
Thu Oct 27, 2022 3:03 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why does 'background' in the condition disable 'hover_background'?
Replies: 2
Views: 100

[SOLVED] Why does 'background' in the condition disable 'hover_background'?

I have a layout with non-standard sized buttons that I create in the loop, so I have to set my own background for a particular button. vbox: for i in range(len(btns)): hbox: for k in range(len(btns[i])) textbutton btns[i][k]: background If(i == 0 or k == 3, btn_opers_bg, btn_nums_bg) And because of ...
by span4ev
Tue Oct 25, 2022 4:07 pm
Forum: Ren'Py Questions and Announcements
Topic: Why doesn't the game save state and return to the main screen?
Replies: 6
Views: 201

Re: Why doesn't the game save state and return to the main screen?

But in practice for my master file I could not apply it. There are classes, dictionaries, lists, functions, styles. If you managed to write all the necessary logic for the game using python, I don't think it will be hard for you to write it using Renpy label flow. Maybe look at some Renpy minigame ...
by span4ev
Tue Oct 25, 2022 4:25 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why doesn't "drag_raise" work when using a loop?
Replies: 2
Views: 84

Re: Why doesn't "drag_raise" work when using a loop?

In your firs piece of code you are creating a unique draggroup for each drag. drag_raise only works for entities in the same draggroup. My goodness... You're right... I missed that. I had already started trying to find a list of instances of the class (whose names I don't know), and it turned out t...
by span4ev
Tue Oct 25, 2022 3:51 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why doesn't "drag_raise" work when using a loop?
Replies: 2
Views: 84

[SOLVED] Why doesn't "drag_raise" work when using a loop?

I draw objects through a loop. "circles" is a list with the objects of the class. Each object has 2 attributes: picture and position, so in "i.img pos i.pos " I just specify which picture to take and where to place it. for i in circles: draggroup: drag: image i.img pos i.pos drag_name i drag_raise T...
by span4ev
Mon Oct 24, 2022 12:19 am
Forum: Ren'Py Questions and Announcements
Topic: Why doesn't the game save state and return to the main screen?
Replies: 6
Views: 201

Re: Why doesn't the game save state and return to the main screen?

. Thank you very much for your detailed response. Your changes really work. But in practice for my master file I could not apply it. I am too stupid for that. I can't take any more of your time, you have given me enough information already. Maybe in the future I can figure it out and apply your app...
by span4ev
Sun Oct 23, 2022 5:45 pm
Forum: Ren'Py Questions and Announcements
Topic: Why doesn't the game save state and return to the main screen?
Replies: 6
Views: 201

Re: Why doesn't the game save state and return to the main screen?

Alex wrote:
Sun Oct 23, 2022 4:42 am
You could try 2 options:
- create a game loop inside a label, so every turn/move will run some statement.
Hi. Thanks for the reply. I tried using a loop inside the label and changing the variable with each step (tried 3 options), but it doesn't work. I added this example code to my question.
by span4ev
Sat Oct 22, 2022 10:44 pm
Forum: Ren'Py Questions and Announcements
Topic: Why doesn't the game save state and return to the main screen?
Replies: 6
Views: 201

Why doesn't the game save state and return to the main screen?

Since I'm trying to do poker (for practice), I don't have a 'label' with dialogs. I use a lot of 'screens' that call up the following screens. I don't need labels, I just need screens. I only use label start, since it is fundamental. But I have a problem: the game doesn't save its state. Every time ...
by span4ev
Sun Oct 16, 2022 5:40 pm
Forum: Ren'Py Questions and Announcements
Topic: Is it possible to make a variable passed to a function global inside the function?
Replies: 1
Views: 168

Is it possible to make a variable passed to a function global inside the function?

I want to pass variables inside a function, but they won't change because they need to be made global. Before this, I used a simple way: 1. setVariable() 2. def my_func(): global money, ...(other variables) But it's more convenient to do it like this: def my_func(x): global x x += 1 my_func(money) B...
by span4ev
Sat Oct 15, 2022 4:55 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Please show me an example of 'input' to call inside the 'screen'
Replies: 4
Views: 212

Re: Please show me an example of 'input' to call inside the 'screen'

An example of barebones input screen: default character_name = "John Doe" screen name_input(): modal True frame: align (0.5, 0.5) padding (25, 25) input value VariableInputValue("character_name", returnable=True) screen some_screen(): textbutton "Change Name" action [SetVariable("character_name", "...
by span4ev
Fri Oct 14, 2022 5:37 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Please show me an example of 'input' to call inside the 'screen'
Replies: 4
Views: 212

Re: Please show me an example of 'input' to call inside the 'screen'

I am not sure what exactly do you want. If you want an input field within screen, there is an input screen statement and multitude of InputValues to update different kinds of variables. If you need something else, tell exactly what do you want. I want to call a separate 'screen' with an 'input' fro...
by span4ev
Fri Oct 14, 2022 3:49 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Please show me an example of 'input' to call inside the 'screen'
Replies: 4
Views: 212

[SOLVED] Please show me an example of 'input' to call inside the 'screen'

I've been trying to find a working example for days, I've tried so many options and nothing works. Most of the examples are for use inside the 'label'. But I need inside 'screen'. screen: some button ... action Show('get_name') screen get_name: $ name = renpy.input ... I am in deep, deep despair...
by span4ev
Sun Sep 25, 2022 12:37 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why can't I change a variable in a list?
Replies: 4
Views: 284

Re: Why can't I change a variable in a list?

enaielei wrote:
Sun Sep 25, 2022 5:47 am
If you want to set an item in a dict/list use SetDict.

Code: Select all

action SetDict("nums", 0, "something")
Thank You!
Only the variable name must be without quotes

Code: Select all

action SetDict(nums, 0, "something")
Thank You!
by span4ev
Sun Sep 25, 2022 12:37 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why can't I change a variable in a list?
Replies: 4
Views: 284

Re: Why can't I change a variable in a list?

This is to be expected: there is no variable nums[0] . There is variable nums which can be indexed to acccess another object, but does not make nums[0] a valid variable name. Even in Python anything accessing variables by name will break on trying to access object at list index. Just use Function w...
by span4ev
Sun Sep 25, 2022 12:53 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Why can't I change a variable in a list?
Replies: 4
Views: 284

[SOLVED] Why can't I change a variable in a list?

Here I have a list: init: $ nums = ['one', 'two', 'three'] $ num = 'one' The list is a mutable object. For python it would be perfectly fine to do something like this: nums[0] = 'something' nums[-1] = 'something' But it doesn't work for SetVariable Here it works: action SetVariable('num', 'something...