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 with string case values
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#3
RE: Switch statements with string case values

What you posted is a switch function with integer-type case values, which is the norm with Amnesia scripting. That structure is great for step-wise in-game events, like fainting in a hallway or a cave-in with lots of sounds and such.

However, I'm trying to find a way to execute a case based on a timer's name, which isn't simply an integer. I want the timer to be named according to what it does, so I and anyone else reading it can easily follow the flow of the script.

Also I'm not sure if that will work, since you're trying to convert a string to an integer in that code.

(This post was last modified: 07-22-2011, 11:07 AM by palistov.)
07-22-2011, 11:06 AM
Find


Messages In This Thread
RE: Switch statements with string case values - by palistov - 07-22-2011, 11:06 AM



Users browsing this thread: 2 Guest(s)