Anyways, I've been reading the DM guide, and decided to fiddle around a bit, and have tried making a portal system. The purpose, which I have already sloppily coded, is that when you click the portal it asks you where to go. The thing I am asking for help with is if there is a section in the DM guide that would help me to remove a certain option depending upon the user's location, like if he was on a z level 3, and clicked the portal on z level 3, the option to travel to the z level 3 location doesn't show up.
proc
Outside()
usr.loc = locate(12,14,3)
sleep(50)
usr.loc = locate(1,1,2)
proc
Dungeon()
usr.loc = locate(12,14,3)
sleep(50)
usr.loc = locate(25,15,1)
obj/portal
Click()
set src in view(1)
var/where = input("Where do you want to go?") in list("Outside","Dungeon","Cancel")
if(where == "Outside")Outside()
else if(where == "Dungeon")Dungeon()
else if(where == "Cancel")usr << "Okay then."
Also, if someone would be kind enough to point out where I can learn to make the process go through when the user steps on the portal, instead of clicking it, that would be very much appreciated.
ID:154835
Dec 4 2011, 11:52 am
|
|
Dec 4 2011, 12:07 pm
|
|
If they are on a certain level,just prompt them with a different set of questions.
|
In response to Flare SilverBend
|
|
I was kind of trying to reduce the amount of recoding I would have to do, by having a master list of locations, and a proc or something to eliminate the one they are currently in.
|
In response to Craptastic500
|
|
Consider I am a newb myself, anyway I'd go for something like this
obj/portal |
This is how I would do it. I'm a little rusty at the moment so this might be a longer way to do it. If anyone has a shorter way then please correct me. Unless you are going to have thousands of locations, this will be simple enough. It's just a copy/paste method.
mob |
In response to Saladon
|
|
Saladon wrote:
This is how I would do it. I'm a little rusty at the moment so this might be a longer way to do it. If anyone has a shorter way then please correct me. Unless you are going to have thousands of locations, this will be simple enough. It's just a copy/paste method. > mob Guess the repetition isn't needed. mob |
In response to Kccmt
|
|
Kccmt wrote:
Guess the repetition isn't needed. > mob But I think he wanted to take his current location out of the list |
In response to Saladon
|
|
The logic is still there.
|
In response to Saladon
|
|
Saladon wrote:
Kccmt wrote: > > mob But I think he wanted to take his current location out of the list Which I did :-) Portaldestinations -= usr.CurrentDestination The location is still tested in the switch, but since you cannot select it this is not a problem. |
Craptastic500 wrote:
if someone would be kind enough to point out where I can learn to make the process go through when the user steps on the portal, instead of clicking it, that would be very much appreciated. Use Enter() - the portal needs to be a turf though. |
In response to Tensa Soul
|
|
Actually, Enter() is not the correct event for stepping on turfs. Enter() is what decides whether or not you can even move onto the turf in the first place, while Entered() is called after you've stepped on the turf. By default, Entered() does not work for just stepping on objs, so you'd either have to create a separate set of events to handle that, or change your portals to turfs.
|
In response to Kccmt
|
|
Wow, I wasn't expecting such a large response, thank you everyone who has helped.
|