For the first one, it gets the position of the cube and sets the position it has to go relatively. For the next positions it gets the last position to calculate the new one. Everything should be fine, but somehow "level.finalCubeTrip[2]" doesn't work. Just that. ??? If I print the four positions, all are printed but that. And if I print that vector, coord by coord, only x coord works.
2. This is for knowing if a player is in the cube I'm about to move:
Code Snippet
Plaintext
pl = get_players(); for( i = 0; i < pl.size; i++) { if( pl[i].isInCube == cube ) // isInCube = the cube where the player is; cube = the cube I'm moving touching[i] = pl[i]; }
No matter which cube I'm moving or where the player is, because the condition is always true (I tried to print pl[0].isInCube and cube separately and they aren't equal (0 and 15, for example)). I fixed it doing it other way but I prefer using this one.
3. Another similar: it is supposed to get the structs in one cube.
Code Snippet
Plaintext
risers = getStructArray( "principal_zone_spawners_rise","targetname" ); // get all the risers in map for( i = 0; i < risers.size; i++ ) { if( risers[i] isTouching( vol ) ) // vol = a volume, different in every cube structs[ structs.size ] = risers[i]; }
And, again, somehow the condition is always true, so I move all risers in map.
Does anyone have any idea?
Last Edit: October 25, 2015, 11:36:33 pm by Soy-Yo
More specifically, the "level.finalCube" part and the different array. Maybe that is defined elsewhere, maybe it was a typo, I don't know. I assume it is meant to be that way, but I just figured I mention it.
Have you printed before and after it adds the vectors, in the addNewPos function?
Last Edit: October 27, 2015, 03:18:13 am by MakeCents
More specifically, the "level.finalCube" part and the different array. Maybe that is defined elsewhere, maybe it was a typo, I don't know. I assume it is meant to be that way, but I just figured I mention it.
That's ok. It gets the position of the final cube so I can set the next position to move relative to that.
Have you printed before and after it adds the vectors, in the addNewPos function?
I didn't try that yesterday. I've just tried it now and everything was perfect. But the funny thing is that today it prints the vectors properly. And I haven't changed anything, just added or deleted some prints.
But while writing this I think I realised what is happening (only for this part of the script; no idea why the rest aren't working). To make it be a circuit, when the cube moved, I deleted the first position and moved it to the end. And it seems that if a position was repeated, it was removed twice. Hope that change fixes it.