List of IDs in a script property. Is it possible? (SOLVED)

Hi guys, can you please help me to accomplish my task.
I am trying to create module that will receive a list of gui node ids and crate Buttons from them.
I would like to be able, specify this id’s in script propertiy saparated with commas for example, parse them and send to gui script.
So I am creating an go propertiy this way : go.property(“btn_list”, hash(“none”))
end when I am trying to write more then one ID (btn1, btn2, bt3 …) in the list I am getting this: hash: [6468112592384734432 (unknown)]
The goal is to provide a simple way for designer to create Buttons functionality withaut touching lua code.
Thanks!

There is an another way for parsing: gui.clone_tree.
1 in editor: create a node with buttons as children,
2 in parsing code: clone this node and get ids list,
3. delete an original node.
4. enjoy

local mybuttons=gui.get_node("mybuttons")
local tree=gui.clone_tree(mybuttons)
gui.delete_node(mybuttons)

for k,v in pairs(tree) do
....
end

p.s. note: make sure that numbers of nodes < max nodes constant (512-1024). When you clone nodes their quantity doubles in this frame.

What you’re trying to do won’t work because the hash() function is one-way, there is no way to get the string back from it.

If all of your buttons are under a common parent node you could try what @Dragosha suggested and only pass the id of said parent node, then get all the ids you need by looping through the children.

A bit of a more counter-intuitive solution to pass a string to your script would be to create an invisible Text node somewhere in the gui and write the comma-separated id list in there. Then you can retrieve it with gui.get_text().


Of course, the intended way of doing this is through messages, which would require code. A great explanation on why it was designed this way you can find here:

1 Like

Thank you guys for the fast response.
I think cloning will work for me!