Solarus-Games English Forum

Solarus => Development => Topic started by: Eyth on October 15, 2018, 12:42:27 PM

Title: User properties (key, value) ??
Post by: Eyth on October 15, 2018, 12:42:27 PM
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 ;)
Title: Re: User properties (key, value) ??
Post by: alexgleason on October 15, 2018, 07:15:26 PM
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.
Title: Re: User properties (key, value) ??
Post by: Diarandor on October 15, 2018, 08:48:24 PM
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!
Title: Re: User properties (key, value) ??
Post by: Eyth on October 16, 2018, 09:29:08 AM
Nice  :) Looking forward to it, thanks.