Angels with Scaly Wings

Angels with Scaly Wings

Welcome to the Angels with Scaly Wings Workshop!
Download user created mods, or create and upload some of your own!
Learn More
Soky 7 Mar, 2018 @ 6:58am
MultiPersistent variable fix
About this mod

This mod does have 2 main functions.

  • Fixing a bug in Ren'Py that makes MultiPersistent variables unusable and might potentially remove them. More info below.
  • Restoring all MultiPersistent variables that have been removed and have corresponding persistent variable. After restoring at least a single variable a text file is opened with list of all restored variables.


Download links

Version 1.0, Automatic [drive.google.com] - automatically restores MultiPersistent variables when starting the game.
Version 1.0, Manual [drive.google.com] - you need to press a button inside options menu to restore variables.


What does this bug break

File with MultiPersistent variables is saved, but not loaded, in binary mode. When you try to use mp variables without this then you'll get value of 'None', unless that variable was actually set before exiting the game.

Additionally, I believe this bug could cause new, completely empty MultiPersistent file to be create removing already existing variables. I'm not sure what are the exact conditions for it to happen, but it happened several times for me already. This is bad because some of those variables are blocked from unlocking again (blocked by persistent variables that aren't cleared). This by itself doesn't break anything in game because they aren't used at any point in the game, but this could cause issues with potential sequel, fan games, or mods trying to use them.

More info:

Bug report [lemmasoft.renai.us]

Fixed code on GitHub [github.com]

Fixing this bug is not hard (as you can see on GitHub), but it was a little tricky to fix this without modifying Ren'Py files. I ended up replacing original function with a slightly modified version (and by slightly I mean a single line was changed).


Things I restore

I restore all (unless I missed some) MultiPersistent variables that have corresponding persistent variable.

Several of them are normally only set once per game (like when starting or unlocking an achievement), so it's not possible to regain them without either using mods or deleting your save files and playing again.

The rest of them can be set more than once per game, but I decided it would be convenient to have as much of them restored as possible.


Things I don't restore

mp.type - set at the beginning of the game (when asked if you're responsible or adventurous), it's overwritten when Adine asks what role you take in relationship. There's no point in setting it again because it's going to be overwritten anyway.

mp.remyloss, mp.annaloss, mp.loremloss, mp.bryceloss, mp.adineloss - it's impossible to get after getting good ending of specific character, but there's no way to check which one you should have. (Also, why is mp.adineloss the only one that uses value of both True and "yes"? It's the only one doing this, others only use True.)

A lot of variables that don't have their corresponding persistent variables - just play the game again and get them yourself.
< >
Showing 1-5 of 5 comments
Blue  [developer] 6 9 Mar, 2018 @ 2:01pm 
Hi,
Whilst trying to verify this as a bug, my mp data appears to be fine?
`mp.name` and `mp.player_name` are intact, at least for my save game.
Or am I understanding this wrong and there'll only be an issue when the multipersistant data is actually used in a future game?
Soky 10 Mar, 2018 @ 4:35am 
Originally posted by BlueEyedBeast:
Hi,
Whilst trying to verify this as a bug, my mp data appears to be fine?
`mp.name` and `mp.player_name` are intact, at least for my save game.

The bug is that even when mp data is there it's inaccessible in the game. I removed all my mods (I left only the mod loader) and created a quick mod for testing with the following code:

label mp_test_data: if mp.name is None: "Test" "mp.name is not set, so its value is [mp.name]" else: "Test" "mp.name is set and its value is [mp.name]" if mp.player_name is None: "Test" "mp.player_name is not set, so its value is [mp.player_name]" else: "Test" "mp.player_name is set and its value is [mp.player_name]"

In both cases, the `is None` condition is true. I opened the file with mp data in hex editor and I can tell that it's incorrect, since both values are there and they are set.

Next, I installed my mod and tested this again - this time this code actually worked as intended.


The bug with mp data being removed is much less frequent and it's very inconsistent, for me it only happens after installing or updating mods (not always, only sometimes).


Originally posted by BlueEyedBeast:
Or am I understanding this wrong and there'll only be an issue when the multipersistant data is actually used in a future game?

Assuming that future game is going to use the most recent Ren'Py version with this bug fixed (currently this bug is fixed in the nightly version), and considering that this bug only affects reading mp data (so saving those values actually works as intended), it most likely won't be affected.

This bug won't affect most people playing this game either, since I believe that mp data is only saved here and never accessed.

This is only going to affect people who are using mods. First, if mod a is trying to check any of mp variables then they'll always get `None`. Second, if mp data is actually deleted (like in my case) this will cause issues in future game.
Blue  [developer] 6 10 Mar, 2018 @ 9:47am 
When using the debugging console ingame, when I type
mp.player_name
returns
u"my name"
which is kind of implying I'm not getting the bug. I'm on Windows but that's the only platform "rb" makes any difference right?

Nice to know it won't effect the current game at least. I have had some confirmations that this has been detected as an issue before though which is doubly interesting as to how I can't reproduce this
Last edited by Blue; 10 Mar, 2018 @ 9:48am
Soky 10 Mar, 2018 @ 11:33am 
I started testing a little bit, including doing a fresh install and removing all my saves. It seems that removing my mp data file completely fixes this issue (at least for now, it might come back). Then I decided to restore it and it stops working again.

It just seems like my mp data file doesn't work properly without using opening with "rb".
Blue  [developer] 6 10 Mar, 2018 @ 11:57am 
I have recently deleted all my save data which might be why I'm not getting it at all.
< >
Showing 1-5 of 5 comments
Per page: 1530 50