View Single Post
Old
Pawn Nub
Junior Member
 
Status: Offline
Posts: 2
Join Date: Feb 2016
Default 02-29-2016, 03:02 PM

RavenOfCode,

I wanted the game to move the triangle to where your location on the minimap would be after you click a door. I don't want it to finish the "For" loop, but rather I wanted to immediately stop checking every increment on the "For" loop and wait for further instructions once a certain condition has been achieved.

So "For" loops work by looping a certain amount of times right? Such as "For all numbers 1-10" then it will go over every number to loop a total of 10 times.

But say I wanted the loop to stop at 6 because a certain command is at that number instead of going through all 10, how would I do that? I can't make it so that it stops looping once I hit a certain variable in the "For" loop.

So basically, I made an array of every location possible for the minimap, and once a door is clicked, then the "Minimap controls" method will then use the statement "If (variable) 'where you are' = (item from array) 'item_from_Where you could be" to skip every increment of the "For" loop until the 'item_from_Where you could be" matches your actual location which is recorded in the variable 'where you are'.

Then it supposedly should move the triangle to the corresponding square from 'item_from_Where you could be'

But the "For" loop will keep running. So lets say that I do hit condition 6 out of 10 on my example previously, what my problem is is that it will continue to check condition 7, 8, 9, and 10.

I just want to stop the "For" loop once the triangle moves once basically.

I'm sorry that this is a wall of text... but I'm kinda new at trying to explain this.
   
Reply With Quote