demian 0 Posted August 7, 2017 Hello, I'm a newbie with vex and I'm trying to create an array of structs. In my wrangle node I defined the struct in the outer code section as suggested here my struct looks like this: struct node { int pt; int nbrs[ ]; } In my code I later declare node nd; node array[ ]; I manage to initialise the nd variable normally. Then I tried the following int pt = nd.pt; //works fine int nbrs[] = nd.nbrs; //works fine array[0] = nd; //seems to work fine pt = array[0].pt; //nope nd = array[0]; //nope By doesn't work I mean that the node turns red saying the following Error The sub-network output operator failed to cook: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1Warning: Errors or warnings encountered during VEX compile:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Errors or warnings encountered during VEX compile:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Error: Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1) Failed to resolve VEX code op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1Unable to load shader 'op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1'. Warning Errors or warnings encountered during VEX compile:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Warning Errors or warnings encountered during VEX compile:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Warning Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1) Failed to resolve VEX code op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1Unable to load shader 'op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1' Any ideas? Thank you Marta Share this post Link to post Share on other sites
f1480187 797 Posted August 7, 2017 I guess the reason is nbrs member is an array type. Submit your scene as a bug. Share this post Link to post Share on other sites
demian 0 Posted August 8, 2017 Thank you I will do it. It's a shame that it's not working though Share this post Link to post Share on other sites
ikrima 0 Posted May 1, 2019 This was frustrating but found the issue. Posting it here since it looks like the vex compiler bug hasnt been fixed: looks like a vex compiler bug traced it down to you have to make your custom structs be defined before the first call to len() although it probably holds for any array functions so ended up having to move all base custom structs into a base header file with no references to any array functions Share this post Link to post Share on other sites