Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Point'n'Click Plug-In for Ren'Py

Framework for adding interactable point'n'click elements into Ren'Py games · By Devil Spiδεr

_return label bug?

A topic by fxcelessdraws created 5 days ago Views: 23 Replies: 2
Viewing posts 1 to 2

Hi, I want to start off by saying this plugin is one of the best ones I've used for Ren'Py thus far, and it's making my pnc visual novel so much easier/smoother to make, but I ran into a small issue when it came to implementing a drag/drop inventory system with combinable items into the game. I'm using the exact same code as the example game in the plugin's zip download and the drag and drop inventory example from this YouTube tutorial (lines 221+, linked here: inventoryexamples/inventory.rpy at main · VimislikArt/inventoryexamples · GitHub), and they work together perfectly until you collect one of the inventory items by interacting with one of the plugin buttons via $ inventory.append(item). After that, the game runs into the error "ScriptError: could not find label 'True'" on the pnc_loop's jump expression _return statement where I think it mistakes the combine_check's return True statement for a label that doesn't exist and crashes.

Any ideas on why it's doing this? o3o

Developer

The point and click screen works on jumping to whatever string the screen returns. Since the inventory code also returns some values, the loop label interprets True from lines 301 and 308 with the same weight as if that return came from the point and click button. You could add a condition in the pnc_loop label that check if the returned value is True and jump back to the loop, or you could modify the combine_check function from the inventory system to return label names.

Got it to work via adding the condition like you suggested! Thank you. If others are having a similar issue and came to the forum for help like I did, try adding an if statement for your inventory return values at the end of your pnc_loop. In my case, the code ended up looking like this:

if inventory_return == True and current_room == "the_current_room":

       jump current_room_label

else:

      jump expression _return

Might not be the best workaround since you'd have to make an if/elif statement for each room, but hey, if it works, it works!