Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hello!

There's possibly a bug with global properties (or booleans). For example, I'm checking this at the beginning of a dialogue: global.property["chest2_empty"] == false to launch a dialogue node, and the dialogue never starts. But if I use global.property["chest2_empty"] != true, it works fine. Is it normal?

I think I know what is going on here. If a property has never been set to anything before, it's going to have a default value of "null" as opposed to false, so the comparison evaluates to false. That would explain why the inverse does work (null != true). That could definitely be confusing, so I may change it to work like some other languages where basically anything besides a true value (null, non-boolean value) is considered false by default if used in a conditional expression.

In a dialogue, is the default condition self.property["visited"] == "yes" meant to launch the following node if the dialogue has never been started before? I didn't manage to make it work (that's why I ended up using global properties).

This is kind of misleading as well. It wouldn't launch the following node unless the "visited" property had been previously set to "yes" elsewhere. It was just an arbitrary condition I defaulted it to way back when I first started working on dialogue, so I will change this to something that would make more sense.

There are booleans and strings, but don't see a way to use integers. Do you plan to add this in the future? I'd probably need something like a way to increment / decrement some global properties to keep track of characters relationships and similar things.
Yes, I will be adding integers (and arithmetic expressions for adding, subtracting, etc.) at some point - probably sooner rather than later since they will be useful to have. First step will probably be getting to where you can do something like this:
set_global_property("test", global.property["test"] + 1)
Also, something useful would be some kind of log or debugger to track properties during the game. Or is there a way to do that with the developer console? Or to print / watch properties in the Godot window?
There is currently one way you can do this using the placeholder expression functionality thatI recently added along with the Display Message function. If you put the code below into the developer console it will pop up a message and ${global.property[\"test_message\"]} will be replaced with whatever value is in the "test_message" property.
display_message("The value of the test property is: ${global.property[\"test_message\"]}")

Note that you need to escape the double quotes with a backslash before each since they are inside of a string. Hopefully that helps some! The placeholder expression can reference both global properties and entity properties (and more eventually).

Thanks for the questions!