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.
ID:169925
Apr 12 2005, 5:41 am (Edited on Apr 12 2005, 6:56 am)
|
|
In response to DeathAwaitsU
|
|
Thanks, I'll try it out.
|
In response to Chwgt
|
|
Ok, I've got that, but there occured to me another problem, I want it were if the obj/Gate is in(oview(1)) the verb PSay() works, if not it doesn't work, but I don't know if that would still be just a in(oview(1)) or done a diffrent way. Could someone please explain.
|
In response to DeathAwaitsU
|
|
DeathAwaitsU wrote:
> if(place=="City1") //if then that place was City1 This is very inflexible - if you ever change the map (and you will), suddenly you'll have to redo all of the locations in the code. Not very fun! Instead, use tags. In the map editor, edit the tag variable of the turf (or area) you want to be the first city and make its value "City1". Same for City2 and the rest of them. Then your teleport code is simply: usr.loc = locate(place) See http://bwicki.byond.com/ByondBwicki.dmb?TeleportingMobs for a more complete explanation of this technique. |
In response to Mike H
|
|
Or, an even quicker way would be:
mob/verb/teleport(T as text) I think something like that would work. =/ (Put the areas on the map) |
In response to Chwgt
|
|
Ok, when you use the verb, it wont locate you were it should can someone help?
mob |
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).