ID:263913
 
Code:
var/mode

mob
proc
Mode()
switch(input("Which mode to play?") in list ("Singeplayer", "1 vs. 1"))
if("Singleplayer")
mode = "Single Player"
src.Game()

mob
proc
Game()
if(mode == "Single Player")
time = 300
src.Words()
else
world << "wtf? no single player?"


Problem description: For some reason I keep getting "wtf, no single player?" I have no idea why this isn't working, but it sure is frustrating me to be so simple.

In response to Pirata Inmortal
It really has no point in being a mob var and it didn't work for me as one either. The crazy part is that similar snippets work perfectly in other projects, just not this one for some odd reason.
In response to Mecha Destroyer JD
yes theres a point to be a mob/var >.>
In response to Pirata Inmortal
Pirata Inmortal wrote:
yes theres a point to be a mob/var >.>

No there isn't in this case.

Ignore that guy, and you're missing a l in the switch statement in your list, you have singeplayer :P
In response to Lord of light
Lord of light wrote:
Ignore that guy, and you're missing a l in the switch statement in your list, you have singeplayer :P

OH, thanks a lot..XD I make plenty typos
This is not a good use for text strings. If anything, you should be using predefs, or constants:

#define SINGLEPLAYER 1
#define MULTIPLAYER 2

blah blah blah
mode = SINGLEPLAYER

blah blah blah
if(mode == SINGLEPLAYER)
etc


Or you could use constants instead of the #defines:

var/const/SINGLEPLAYER = 1
var/const/MULTIPLAYER = 2