Copying a Structure Through Events

This seems like a simple question but I searched and couldn’t find an answer.

Is there a way to copy a Structure from one place to another through Events?

For example, let’s say you have a Global Variable that is a Structure and something happens in the game and you want to copy the Structure to a Scene Variable or to an Object? Is there an extension or command that will copy the full structure and all of its children over?

Thanks!

i wont lie, its not often i use an array or structure, but like, does…literally setting one to the other work, like how youd set a regular variable to another? just dont specify a child?

You need to jsonify the original structure into a string/text, and then parse that string into the new structure:

I’ll give this one a shot and see if it works. Thanks! I hadn’t thought of doing that.

Oh, the audacity of that statement :wink:

OK! It does work. Next question about this though if you’re able to go down this journey. What if I wanted to copy the Structure into another Structure.

Like Structure A gets turned into a JSON
Then I want to copy Structure A INTO Structure B alongside already established Structures in Structure B.

I think this method might overwrite everything and turn Structure B into Structure A. Perhaps there is a secondary step to make Structure A a child of Structure B.

This retains the existing children, and adds a new one named “NewNode” and plonks the data from SourceStructure into it.

By the time I actually need to do this, I’ll have completely forgotten that it’s a thing! and so what I’m going to do is screenshot it and print it on a t shirt, then take a selfie somewhere mildly exotic while wearing the t shirt. Then I’m going to print that photo onto a ceramic mug and place that mug on top of the tea towel with the image of me posing in Whitby while wearing a t shirt emblazoned with one of Keith’s responses to a pathfinding issue.

I don’t know how many Men you are, Mr, but all of them are phenomenal. It works perfectly. Thank you!