I’m having trouble doing something that I thought would be pretty straightforward. I’m creating a point and click type game where there are a number of rooms, each is a collection with an atlas. There will ultimately be a lot of these and I am trying to streamline adding and editing these rooms. Creating the collection and the atlas and setting up the collection with all the base objects in it was relatively simple. The last thing I’m trying to do is add the new collection to the collection proxy in the main game collection. I can “get” the collection and I can see its children but I can’t seem to edit them in any way.
local gameCollection = editor.get("/main/game/game.collection", "children")
pprint(gameCollection)
for i = 1, #gameCollection do
print(editor.get(gameCollection[i], "path"))
end
When I run that code, the results are:
{ --[[0x58b3d80b]]
1517,
1519
}
nil
nil
I have looked through the forums, Discord and documentation but none of the examples show getting a collection and then editing something that already exists within it. The fairly advanced editor scripts from pawell and jerakins seem to be reading and writing the files directly, not using the fairly new “get” and transactions. I have tried a fair number of things at this point and seem unable to crack this nut. Is there no way to do this or is my syntax off?