Note: I am noob to the use of the powdertoy's Lua APIs.
I recently started with creating my own elements in Lua. I try to understand them through studying mods, and I discovered element properties can be given with elements.property(). Untill I stumbled at this little piece of code:
local Element4 = elements.allocate("MOD", "GOLD")
elements.element(elements.MOD_PT_GOLD, elements.element(elements.DEFAULT_PT_METL))
elements.property(elements.MOD_PT_GOLD, "Name", "GOLD")
elements.property(elements.MOD_PT_GOLD, "Description", "Gold.")
elements.property(elements.MOD_PT_GOLD, "Colour", 0xFFFE9E19)
elements.property(elements.MOD_PT_GOLD, "MenuSection", 9)
elements.property(elements.MOD_PT_GOLD, "Properties", 0x4024)
What exacly does "Properties", 0x4024 do? And are there more strings I can use instead? And where can I find a list of all editable properties with elements.property? And how to use the list of properties on the wiki?
Thank you! this is really helpfull. I bookmarked the pages (as you adviced) so I can investigate them later.
edit: Can you combine property values that are on the same place? like PROP_DEADLY (0x00400) and PROP_HOT_GLOW (0x00800)?
Can you give me an example of assigning the prop IDs from the wiki? so far it only worked with hex for me.
edit: It did not work for me, only the value from the script I found did, but I wanted to ajust that.
It did! I used quotes at the prop (stupid I know...) but it works now. Thank you very much!
didn't know that this works too, but it's much longer than using HEX values. however, it's advantageous that you can directly see what properties you're currently using.
if you want i could explain you some things.
Instead of assigning the element an id and using GROUP_PT_ELEMENT, you can use the variable that you assigned, which in your case is Element4
Also, Instead of using elem.property for every property line, you can use an array, as shown below:
elem.element(elementName, {
Name = "ELEM",
Description = "Custom Element",
etc...