demian Posted August 7, 2017 Share 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 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted August 7, 2017 Share Posted August 7, 2017 I guess the reason is nbrs member is an array type. Submit your scene as a bug. Quote Link to comment Share on other sites More sharing options...
demian Posted August 8, 2017 Author Share Posted August 8, 2017 Thank you I will do it. It's a shame that it's not working though Quote Link to comment Share on other sites More sharing options...
ikrima Posted May 1, 2019 Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.