VN Ren'Py One little question, please...

iOtero

Active Member
Aug 4, 2020
924
1,458
(I don't know if this is the right place to ask this, if not, I apologize and have a moderator please move it to the right place)

I have seen this used in the code of some games:

Code:
style choice_button_text is default:
    properties gui.button_text_properties("choice_button")

screen quick_menu():
And in other cases this:

Code:
init -1 style choice_button_text is default:
    properties gui.button_text_properties("choice_button")

init -501 screen quick_menu():
Why this change is made?

Thanks for your help.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,141
14,825
Why this change is made?
It isn't made. It's a side effect of the use of unrpyc.py and the presence of an init offset = -1 in the screen.rpy file.

When reverting the code, unrpyc.py replace the global definition init offset = -1 by a leading init -1 for each statement that is intended to follow this offset. It's just a cosmetic change, nothing more.
 
  • Like
Reactions: iOtero

iOtero

Active Member
Aug 4, 2020
924
1,458
It isn't made. It's a side effect of the use of unrpyc.py and the presence of an init offset = -1 in the screen.rpy file.

When reverting the code, unrpyc.py replace the global definition init offset = -1 by a leading init -1 for each statement that is intended to follow this offset. It's just a cosmetic change, nothing more.
So, if you remove all those init -xx and recover the offset init nothing happens, right?
Thanks, friend.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,141
14,825
So, if you remove all those init -xx and recover the offset init nothing happens, right?
Right, it will then works in the exact same way.

Just be sure that the "init -xx" all have the same "xx" value, just in case, but normally it shouldn't happen.
Yet, if it happen, keep the ones that have a different value for "xx", and it will once again works exactly as expected.
 
  • Like
Reactions: iOtero