Tripwire Interactive Forums

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
i'm having difficulty comprehending the "i" in:
Code:
function bool GetNearestShop()
{
	local KFGameType KFGT;
	local int i,l;
	local float Dist,BDist;
	local ShopVolume Sp;

	KFGT = KFGameType(Level.Game);
	if( KFGT==None )
		return false;
	l = KFGT.ShopList.Length;
	for( i=0; i<l; i++ )[COLOR="Lime"]// this part mainly... what does it mean?[/COLOR]
	{
		if( !KFGT.ShopList[i].bCurrentlyOpen || KFGT.ShopList[i].BotPoint==None )
			continue;
		Dist = VSize(KFGT.ShopList[i].Location-Pawn.Location);
		if( Dist<BDist || Sp==None )
		{
			Sp = KFGT.ShopList[i];
			BDist = Dist;
		}
	}
	if( Sp==None )
		return false;
	ShoppingPath = Sp.BotPoint;
	return true;
}

... and i was wondering if someone could clear this up for me?? thankyou ahead of time :)

edit:
infact what is "for" could you point my to a tut about it or tell me what role it plays so i can look it up myslef?

from what i can gather with educated guessing is that "for" is like saying "as long as blah blah then proceede" however problem with that theory is that i could just use "if"

another theory i thought up is that "for" is like a macro so it's saying that i=0...check...i is less then I....check......add to i.... well thats my guess