That's indeed a clean solution. Storing the top root handle in the EntityName of every child. Although you still need to extract the handle from a string it may be the fastest way.
Probably you need to use an individual part for every entityname, not sure if you can name them with the same name, and I would not recommend to do so. But you may name it something like this:
(handle)+"_"+oldname$
So the value of the handle can be converted to int simply by automatic type casting, eg:
value%=entityname$(picked_child)
Probably you need to use an individual part for every entityname, not sure if you can name them with the same name, and I would not recommend to do so. But you may name it something like this:
(handle)+"_"+oldname$
So the value of the handle can be converted to int simply by automatic type casting, eg:
value%=entityname$(picked_child)