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 statements
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: switch statements

I like to use fEventSpeed to set the time between each case, but this switch thing can be done in various ways (copied this style from frictional)...
void RandomFunction()  //this thing here shows that you can start this thing from anything
{AddTimer("tostarthetimer" , 0.0f , "Timer");}

void Timer(string &in asTimer) //must be timer in this
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 1.0f;
    switch(GetLocalVarInt("Stage"))
    {    case 1:
            //dostuff
            break;
        case 2:
            //Do More Stuff
            break;
        case 3:
            //Do Other Stuff
            break;
        case 4:
            //Do Funky Stuff
            break;
        }
if(GetLocalVarInt("Stage") < 5)   AddTimer("loopiething", fEventSpeed, "Timer");
}

Another way of using switch (I dont really like this way ^^)
http://wiki.frictionalgames.com/hpl2/tut...ncedtimers

Oh now I get what you actually meant... Mybad this was completely offtopic!
(This post was last modified: 07-20-2011, 08:30 PM by Khyrpa.)
07-20-2011, 08:24 PM
Find


Messages In This Thread
switch statements - by DRedshot - 07-20-2011, 08:00 PM
RE: switch statements - by Khyrpa - 07-20-2011, 08:24 PM
RE: switch statements - by Kyle - 07-20-2011, 08:31 PM
RE: switch statements - by Khyrpa - 07-20-2011, 08:38 PM
RE: switch statements - by DRedshot - 07-20-2011, 08:42 PM
RE: switch statements - by palistov - 07-20-2011, 08:46 PM
RE: switch statements - by DRedshot - 07-20-2011, 08:49 PM
RE: switch statements - by palistov - 07-22-2011, 10:34 AM



Users browsing this thread: 1 Guest(s)