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
"Switch" loops not working as it should
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#1
"Switch" loops not working as it should

hey guys. i want the monster to loop 5 nodes all and all over again.

with the use of a switch loop i want the monster to wait 1 sec when it reaches the first path node only at the first loop. so as i understood it i would need a case that says "when i = 1 (because of the first node) set x= 1 (the waiting time). and a default that sets all other cases to x=0.001"

so this would look like this for me:
void reloop_1(string &in asParent, string &in asChild, int alState)
{
    for(int i = 1; i <=5; i++)
    {
    int x;
    switch( i )
    {
    case 1:
        x= 1;
    break;
    default:
        x=0.001;
    }
    AddEnemyPatrolNode("grunt_1", "PathNodeLoop_"+i, x, "");
    }
}

but it waits 1 ec at every node in every loop

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-18-2013, 06:33 PM
Find


Messages In This Thread
"Switch" loops not working as it should - by tonitoni1998 - 02-18-2013, 06:33 PM



Users browsing this thread: 1 Guest(s)