Help for making 3 choices

sbangs
24 Nov 2010, 22:45
I have the player falling via parachute. He needs to enter the LAND command which will help him land.

If he enters "land" greater than 200 feet, he will land in one area.
If he enters "land" between 200 and 100 feet, he will land in the main area.
if he enters "land under 100 feet, then he will land in a 3rd location.

Now I was trying to use select case for this, but I couldn't figure out how to get the syntax to select the case based on the variable ALT (altitude) which is recorded every second during the landing phase.

I can do this with nested conditionals, but didn't want to go that rout if it could be done cleaner.

Thanks for any help.


Pertex
27 Nov 2010, 17:19
I would do it this way

sbangs
01 Dec 2010, 13:27
Hey, awesome! Thanks much.


sbangs
01 Dec 2010, 13:29
Whoops, one more question.

Is "Select Case" feature of the editor only built to select a certain case based on player input? Can we use select case to grab a variable used in the game and provide the corresponding output based on what that variable is = to?

Thanks,


Alex
04 Dec 2010, 16:34
You can put any variable in the select case.

sbangs
05 Dec 2010, 00:05
So then select case would be the best option for having a list of conditions. I cant seem to find the syntax or an example of how to do that. How to use select case to look at a variables value in the game to give it the appropriate response.

Thanks,

Scott

Alex
05 Dec 2010, 02:03
Just enter the variable in the "Select Case" box (you can click the [#] button at the top right to choose one), then add a case for each value - it's no different to processing a user input variable.

sbangs
05 Dec 2010, 02:34
Ok got it, will do. Thanks again for your time. I hate stopping you from releasing Q 5 :)