mistahmikey
Active Member
I would like to create a list of specific Actors. I tried to do this as follows:
variable index:actor Members
Members.Insert[Me.ToActor]
The above returns "1" and Members.Used returns "1".
But ${Members[1].Name} returns NULL.
I have scoured the Lavishscript wiki, and it appears that the Insert member and method both create a new subtype in the container initialized by the provided parameters. I figured since Lavishscript didn't complain about the use of Me.ToActor as the initialization parameter, it would have least created a copy of it in the index. But apparently not.
I really want to add a reference to an existing actor into my index if possible, but I have been unsuccessful discovering how to do this. I realize I could create an int index and instead store the Actor IDs, but I was hoping to avoid having to indirectly access my actors through the Actor TLO.
So this really all boils down to the following. Is it possible store a reference to an existing object in a variable? Or are objects only accessible via the variable used to create them?
variable index:actor Members
Members.Insert[Me.ToActor]
The above returns "1" and Members.Used returns "1".
But ${Members[1].Name} returns NULL.
I have scoured the Lavishscript wiki, and it appears that the Insert member and method both create a new subtype in the container initialized by the provided parameters. I figured since Lavishscript didn't complain about the use of Me.ToActor as the initialization parameter, it would have least created a copy of it in the index. But apparently not.
I really want to add a reference to an existing actor into my index if possible, but I have been unsuccessful discovering how to do this. I realize I could create an int index and instead store the Actor IDs, but I was hoping to avoid having to indirectly access my actors through the Actor TLO.
So this really all boils down to the following. Is it possible store a reference to an existing object in a variable? Or are objects only accessible via the variable used to create them?