|
beta_boss Newbie
Joined: 02 May 2005 Posts: 4 Location: Canada
|
Posted: Wed May 04, 2005 3:59 pm
non-standard exits... revisited |
I know I'm not the first to bother this forum with help on non-standard exits, but I'm going about them my own way and haven't been able to find what I'm looking for in previous posts. Keep in mind, I just recently began learning zMud script so it's probably something obvious that's causing the problem, just not obvious to a noob like me.
Anyway, I was using the following code (happily enough) to create certain special rooms on the mapper:
#CLASS {System|Automapper}
#ONINPUT {^in$} {#MAKEROOM "in|other|out"} "" {notrig}
#ONINPUT {^out$} {#MAKEROOM "out|other|in"} "" {notrig}
#CLASS 0
The only problem was non-standard exits wouldn't be drawn in a room when I first entered it until I typed "in" or "out" on the command line and had the above triggers fire. So I decided to use the 'onroomcreate' Alias to draw in a non-standard exit like "in" if it was contained in that room's exit information. (Note: the sentence containing the exit information is being captured and stored in a variable successfully, I checked.) So I had something like this:
#CLASS {System} {enable}
#ALIAS onroomcreate {#IF %pos( "in", @exitParagraph) {#NOOP %roomportal( , "in", -2)}}
#CLASS 0
The special exit was left unlinked for exploration later (hence the -2). So that worked, I thought... However, when I'm in a room that has an unlinked exit "in" created using %roomportal, the #ONINPUT triggers don't work like they used to. Typing "in" at the command line, for example, will create another room, but it won't link it back like it would before I added the 'onroomcreate' Alias.
I'm guessing there's some sort of conflict trying to #MAKEROOM "in|other|out" when the room already has an 'other' exit marked "in", I just can't figure out a workaround. Any suggestions? |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed May 04, 2005 4:08 pm |
Hmm interesting.
I profess that in this area I know little to nothing. I think I will "steal" a couple of code snips from your post for my own use =)
Something like this might be nice. My mud has too many unstandard exits and ive seen in/out, in/exit, in/(regular direction) so ill have to think about this some more.
I think I will play around with these though. Just so you know I usually do it the standard >(custom exit)>(room direction) method in the command bar so I can add in rooms as im going. Ive never looked into automating things to any degree but its given me some ideas... |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed May 04, 2005 4:14 pm |
Just a quick question which you might be able to try... when manually relinking rooms I have noticed that if I create a new exit and manually give it a room to link it shows the destination as -1. Is there a specific reason you are using -2? zMud might not see -2 as an undefined link so that *may* be the issue...
|
|
|
|
beta_boss Newbie
Joined: 02 May 2005 Posts: 4 Location: Canada
|
Posted: Wed May 04, 2005 5:40 pm |
I admit the -2 is -- sort of -- a stab in the dark since it is not mentioned in the %roomportal reference. It does however appear to create a 'null' link in the traditional sense. Fyi, I'm using -2 on account of %roomlink (http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=582).
I'm assuming you're getting -1 as a result of running the %portal function, which is supposed to return -1 if a portal with the specified name doesn't exist. However, I'm interpreting a distinction between the name of a portal and the command used to enter it. Then again, I could be really, really wrong.
P.S. I've played around with this problem some more and I am almost certain it is a conflict issue as I suggested earlier. If there is already an 'other' exit with a command like "in" (whether you create it manually or using triggers), functions run into problems overwriting it. I'm considering simply deleting previous undefined exits upon attempting to create new, linked ones, but this seems wasteful and sloppy. *Sigh* |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed May 04, 2005 6:36 pm |
Naa, im getting the -1 from the mapper itself.
If your in the map, right click on a room for the room properties.
Choose the exits tab.
See those little buttons in the upper right corner? The '#' is the room link button. Normally this will show you the room number of the room that the exit links to. But if you create a new link (say north) and hit the button it will prompt you for the room number you want it to go to. If you *just* created the link the number will be -1 (unlinked brand new).
Your using -2 but I dont know if this will make a difference or not. I have not had the time to test any of this out...
I actually use that button all the time to manually reset my links if they get goobered up for whatever reason... |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|