The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For loop help
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#1
For loop help

Hello guys,
Id like some help on the for loops because it was a bit hard to understand for me at the wiki (im not english and dont have any experiences in c++) so in case you have some time i'd be nice if you could answer my questions.

for(int i= 1; i <6; i++)
{
    AddEnemyPatrolNode("grunt_1", "PathNodeArea_"+i, 0, "");
}

What i (think i) understand:
- i is, what is added to the function each time it is called
- i </>x: as long as it lower than 6, it returns true. That means everything will restart, when it returns false
-"PathNodeArea_" +i says, that "i" will be added to the function esch time it is called.

What i dont understand:
- what is i++ for?
-what if i want the loop to start at node 16 and not 1? Id it "PathNodeArea_16"+i then?

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-17-2013, 11:07 PM
Find


Messages In This Thread
For loop help - by tonitoni1998 - 02-17-2013, 11:07 PM
RE: For loop help - by NaxEla - 02-17-2013, 11:19 PM
RE: For loop help - by darksky - 02-17-2013, 11:23 PM
RE: For loop help - by tonitoni1998 - 02-17-2013, 11:25 PM
RE: For loop help - by TheGreatCthulhu - 02-17-2013, 11:51 PM
RE: For loop help - by tonitoni1998 - 02-18-2013, 01:45 AM



Users browsing this thread: 1 Guest(s)