Group Variables - Structures

I’m having trouble with the new Group Variables picking up Structure variables. Not sure if this is a bug, or something I’m doing wrong. Here’s the setup…

I have two sprite objects (SpriteA, SpriteB). SpriteA and SpriteB both have a standard number variable (ID) and a Structure variable (Data). Both Data Structures inculde the name/value pairs (ex. posX, posY), but SpriteB has additional variables (skillType=text, Inputs=structure, wood=child of Inputs, stone=child of Input),etc.

When I view these variables in the Group Variables, I only see: ID, {Data}, but Data has no children. I think Data should show the common children (posX, posY), but not the variables unique to each sprite (SpriteB.skillType, SpriteB.Inputs.wood, SpriteB.Inputs.Stone). Why aren’t the common children (Data.posX and Data.posY) showing up?

I just tried it with 2 objects and it worked for me. I’m using the PC version 5.4.207

image

Thanks for your reply!

When I open the Group Variables tab, I see the structure variable “Data” with “mixed values” as children. There is no ability to drop down a view of the common children in Data. Again, SpriteA has some different Data children than SpriteB, but also some in common. I would like to see the children they have in common listed in the Group Variables tab within the Data structure, but do not expect to see the children that are different. I can’t tell if you are building your objects the same way (with different structure children) from your example. Maybe this isn’t possible with structure variables once you alter the children to be somewhat different, but that’s what I’m curious about.

Ah, I see what you mean now. It only shows children when all of the children match. I added a structure with the same children and it shows them but after adding just 1 different child, the previously showing common children names disappeared from the group variable list. The same thing happens with arrays. It seems to be an all or nothing approach.

What’s even worse than not showing is if you try to add a group child to a structure that’s not showing the children it deletes all of the previous children of the structure whether they matched or not. It seems to overwrite it. This is when added through the group variable list.

1 Like

Yes, I had something similar happen. When I tried to work with the Group variables and alter things there, it zapped many of the variables I didn’t want altered in the individual objects. I had to rebuild each. I’m now very leary about working with the Group variables since I use a lot of object structure and array variables.

My approach is to build the structure variables in each object, then create a Group of similar objects as required. But if I need to add a child to a structure variable, I do so in each object (copy and pasting as necessary) rather than attempting to alter the Group variables themselves. This of course seems to defeat the purpose of Group variables, but maybe they are not well suited to structures and arrays.

1 Like

That seems like a plan. Either use separate groups or make sure each object has identical children. Structures and arrays can get pretty complex depending on how many levels you have. Unless, each object has the same structure, entire child structures could fail to be displayed. Not just the children but possibly any children of the children.