Ok, has anyone played one of the BYOND .Hack games, if so you will know what I'm talking about.
Question: How would you make it to were, if you use the verb PSay, you say the name of a place you wish to go in the text bar, and if that place exists, you get teleported there?
Thanks in Advance.
~C
{Edit}I figure it would involve like a bunch of ifs I think, but, I could make it a input, but I'd much rather have it as a text thing.
|
||||||||||||||||||||||||
First create a list of the places you can go to:
Now we'll first save a variable in PSay() which holds the place we want to go to. Then check to see if our place exists in the list.
If you don't have a transportation code, use this simple one(which by the way sucks to be honest).
if(place=="City1") //if then that place was City1usr.loc = locate(1,5,1) //transport to City1
else if(place=="City2")
usr.loc = locate(2,10,1) //transport to City2