Leakoo
__ess__ from patreon
__ess__ patreon

New inventory script released! Inventory with context menu.

🕑 Added 2023-02-27 14:33:37 +0000 UTC

Comments

Sara

Hey BladeGrip! Yeah if the call stack is bothersome, you can add two "pop_call" function calls inside the "invalid_combination" label and also use a return statement instead of the call statement as it's actually not needed there. I tested the code below and it will avoid repeatedly adding the call statement and the dialogue inside the label to the stack. I'll update the script with it as well I think. Here's what I did: label claire_invalid_combination(item): show screen expression current_scene show screen combine_items(item) $renpy.pop_call() c "Hmm, that doesn't seem to work." $renpy.pop_call() call screen expression current_scene return # Return instead of calling. To see what happens in the call stack when you're testing this, you can print to the console: $print(renpy.get_return_stack()). I put it as the first line in the label when i tested this. So like this: label claire_invalid_combination(item): $print(renpy.get_return_stack()) ...

BladeGrip

First of all, I apologize in advance if it turns out I have missed something or brought this upon myself by modifying the codes in my project and forgetting about it. I just recently noticed that in "items_combined(item_1, item_2)" label, the invalid combination part uses 'call' command. ("call invalid_combination(item_1)"). I understand that this is necessary to make it able to carry the item_1 variable, but it doesn't seem to have a corresponding 'return', therefore if a player makes multiple invalid combinations while experimenting or such, I worry that it may end up creating a deep call stack, which in turn may bring up performance issues or problems with other 'return' commands in the project.

Sara

Hello! Yes, this is something I have missed to update. I will do this sometime next week, but for now you can change the 'align' properties to 'pos' instead and leave the values as they are. Thanks for reporting the issue!

Chloe N

There are errors from this code with the current version of Ren'Py. From a google search it seems this was in the changelog: "Ren'Py will now produce errors when a screen sets two conflicting properties, like align, and xalign. Previously, the behavior of this was undefined." File "game/inventory.rpy", line 170: keyword argument 'align' is incompatible with 'anchor'. align(0.4, 0.9) ^ File "game/inventory.rpy", line 190: keyword argument 'anchor' is incompatible with 'align'. anchor(0.0, 0.0) ^ File "game/inventory.rpy", line 197: keyword argument 'anchor' is incompatible with 'align'. anchor(0.0, 0.0) ^ Ren'Py Version: Ren'Py 8.3.2.24090902


More Creators