Here is an experiment to allow faster access to objects, arrays and instance variable without having to pick them.
As a simple example say you have the uid of a sprite you want to get the x value of. You'd have to do:
sprite: pick by uid 33
sprite: x=200
--- do something
you could do
system compare function: call("", 33, ".x") = 200
--- do something
Or maybe you have something more complex. like an array with uids of sprites, and each sprite has a hat object whose uid is stored in a hat variable. How do you compare the hat color of the sprite in array index 1 with the one in array index 5? and if they are different colors, make both 50 pixel tall?
The solution probably involves a family or local variables to pick things one by one. It can be fairly complex and the readability of events is reduced.
Anyways instead of doing that picking the normal way here's how you could do it with the utility function i came up with.
System: compare function.call("", array.uid, "@", 1, ".hat", ".color") = function.call("", array.uid, "@", 5, ".hat", ".color")
--- function.call("", array.uid, "@", 1, ".hat", ".height", "=", 50)
--- function.call("", array.uid, "@", 5, ".hat", ".height", "=", 50)
Or it even works well for something like arrays of arrays. Say you create it like this:
global number rootArray=0
start of layout
--- set array size to (10,1,1)
--- set rootArray to array.uid
--- repeat 10 times
------ create array
------ function: call("", rootArray, "@", loopindex, "=", array.uid)
It is a benefit to be able to avoid picking rules. Then you can access the 3rd element of the 2nd array with
function: call("", rootArray, "@", 2, "@", 3)
It's basically shorthand picking to get and set variables or values in an array.
*Currently it doesn't work with text variables.
*Error checking is minimal.
* you need to add events to the function for every object type and property you want to support.
here: the bare initial version.
https://www.dropbox.com/s/igu4kum3t67nx ... .capx?dl=1
Could be useful for complex data structures.