User properties (key, value) ??

Started by Eyth, October 15, 2018, 12:42:27 PM

Previous topic - Next topic
October 15, 2018, 12:42:27 PM Last Edit: October 15, 2018, 12:44:19 PM by Eyth
Hello again ^^

So lately, I was wondering about a section in the editor-windows of map entities. By double clicking, the edit window opens and at the bottom there is a point "user properties". By going on "+" I can enter a key and a value.

I didn't use this till now, so I dont know what this is for? And I didn't find it either.
Can someone explain, what benefits this holds? Maybe I'm missing a helpful tool all this time ^^

Thanks in advance ;)

Looks like a new feature in Solarus 1.6: http://www.solarus-games.org/doc/1.6/lua_api_entity.html#lua_api_entity_get_property
Quote
User-defined properties are arbitrary key-value pairs that you can set to any entity. The engine does nothing special with them, but you can use them in your scripts to store extra information.
RIP Aaron Swartz

Exactly, it is new stuff, and very useful.

This allows you to initialize as many variables as you want from the Editor (or from the scripts), and get or modify their values in your scripts with the corresponding getter/setter functions, all in a very clean way. Customization is the future!
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Nice  :) Looking forward to it, thanks.