Hello, I am using an If statement to compare the stringValue of a NSTextField to another string to determine what to do next. It does what's inside of the If statement regardless of whether it's true or not. So, if the stringValue of loc is equal to Lab (or anything, really) it executes both pieces of the code. Here's the code I'm using: if([loc stringValue] == @"Lab") { [loc setStringValue:@"Ground Floor"]; [act setStringValue:@"You decide to enter the simulator and do his Adventure.\nSCIENTIST: Very well, step inside and I'll get you in there. The old way of succeeding won't work anymore, so you've got to find the new way out. Instead of the Finish portal, there is a Quit portal. The Finish portal is in a completely different place.\nYou then are put into the Tutorial Tower and see the same sign from before. You skip reading it and press the right button. Two doors open, however.\nYou now have a choice. You can either go through door number 1 or door number 2.\nOption 1 - Door Number 1\nOption 2 - Door Number 2"]; } if([loc stringValue] == @"Welcome Screen") { [loc setStringValue:@"Lab"]; [act setStringValue:@"You walk into a lab.\nSCIENTIST: Hello, hello, hello! Welcome to my lab! I've set up a new Tutorial Tower... Do you want to go in?\nOption 1 - Enter\nOption 2 - Don't Enter"]; }
Thanks, Connor |