Help setting up a loop
gpeddino
Member Posts: 51
I'm building a puzzle in which I need to target all instances of a placeable with the same tag ("LightMechanism"). There are about eight of them in my area, and I want the system to keep on working in case I add more of them. So I'm trying to cycle between them with a loop but it's not working. It's even crashing the game because the loop keeps on going endlessly. Can someone help?
FYI, I've created the ChangeShaftColor function and it's working properly.
FYI, I've created the ChangeShaftColor function and it's working properly.
int nMech = 1; object oMechanism = GetNearestObjectByTag("LightMechanism", OBJECT_SELF, nMech); while (GetIsObjectValid(oMechanism) == TRUE) { object oShaft = GetNearestObjectByTag("GlassAltarShaft", oMechanism); ChangeShaftColor(oShaft, sColor); int nMech = nMech + 1; oMechanism = GetNearestObjectByTag("LightMechanism", OBJECT_SELF, nMech); }
0
Comments