Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Sun Sep 12, 2010 11:11 am   

Speedwalking in Mapper to Portals
 
Hello,

in my mud I need to walk to one of the portals first to teleport to another. How can this be achieved? With CMUD Pro 3.26, doubleclicking on the map assumes that it's possible to teleport from everywhere to a portal, which is not possible in my mud...

I've already searched around in this forum but didn't find any hint yet. .. please help :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Sep 12, 2010 4:42 pm   
 
double-clicking makes it possible to WALK to other rooms. It doesn't teleport you, nor does it try to change your location based on user vnum like was done in version 3.24.
_________________
EDIT: I didn't like my old signature
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Mon Sep 13, 2010 4:39 pm   
 
Each portal has a name. If portals are enabled and I doubleclick on a room far away, but near a portal, then the name of the portal is sent to the mud and afterwards the remaining steps to the room. This works really good, if I'm already standing in a room with a portal, but it does not work in other rooms. I would need a command like "walk to the nearest portal" executed before that... Is that possible?
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Mon Sep 13, 2010 9:05 pm   
 
based on this thread I was able to write a script that walks me to the closest portal. But if portals are enabled, then %walk and #walk always assume they can use the portals without walking to them, resulting in an infinite loop...

I would need either:

- disable and enable all portals by script
- call %walk and #walk with a parameter to not use portals
- a new hardcoded feature for portals "walk to nearest portal before using" :-)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Sep 13, 2010 10:40 pm   
 
Provided you can handle any necessary logic to determine which room a portal is in, you could use %portalenable() in a room script. By definition, portals in the mapper are roomless so there's no way to determine which room the portal is in.
_________________
EDIT: I didn't like my old signature
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Tue Sep 14, 2010 12:25 pm   
 
yes, with CMUD 3.26, it seems using %portalenable() is the only option I have to solve this, means disabling all portals before walking to the nearest portal, then reenable all portals again and walk to the final target room (actually using the portal). There is a checkbox in the portals UI window to enable/disable all portals, I have found no way to change this checkbox by script. The only alternative is to enable/disable all portals separately in a loop. Currently I maintain a variable with the portal room numbers, I believe the portals are also somewhere in the DB but I can't find it. Where is it? Or how can I find out myself? :-)

I'm not convinced that using room scripts is the right thing for my case, I prefer to have only one script in an alias, not separate scripts in each portal room. Do you agree with that?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2307

PostPosted: Tue Sep 14, 2010 1:19 pm   
 
Perhaps I'm misunderstanding, but if this portal is always in a specific room, and goes to a specific other room, why don't you just use a named exit?
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Tue Sep 14, 2010 2:39 pm   
 
it's a kind of portal network. I can teleport from one portal to any other portal.

Example:

Code:

[ 1P]-[ 2 ]-[ 3 ]-[ 4 ]-[ 5P]
   |          |
[ 6 ]       [ 8 ]-[ 9 ]-[10 ]
                          |
            [11 ]-[12P]-[13 ]


portal name: "sp 1" room number: 1
portal name: "sp 2" room number: 5
portal name: "sp 3" room number: 12

Walking from room 6 to room 13 should walk like that: n;sp 3;e
Walking from room 11 to room 4 should walk like that: e;sp 2;w


BUT: what happens in CMUD PRO 3.26 is the following:

Walking from room 6 to room 13: sp 3;e
Walking from room 11 to room 4: sp 2;w

So I place my script in an alias called "sp"
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Tue Sep 14, 2010 4:57 pm   
 
Rahab is right. You need to be using customized room exits, not the portal function in the mapper. Basically what you want to do is create exits in room 1 with for each possible portal destination, and link the exit to the destination room.

For example, in room 1 create an exit with a direction of se (could be any direction you want even other), and link the exit to room 12. then in the other commands field in the Exits tab of the Room Properties window type "sp 3." Whenever you go se from room 1 the command "sp 3" will be sent to the mud instead portaling you to room 12, and the mapper will know where you are trying to go.
_________________
Erasmus
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2307

PostPosted: Tue Sep 14, 2010 5:39 pm   
 
Try an exit of type "other" with a name of "sp 2", an exit of type "other" named "sp 3", etc. You can have as many "other" exits as you need. The one problem is that I'm not positive whether an exit name can contain spaces, but I think it can. If you do it this way, Cmud can even figure out a path for you if you double-click or use %pathfrom(). I don't think Cmud can do that with any possible implentation of portals that would work for you.
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Tue Sep 14, 2010 8:39 pm   
 
Pathfinding works fine with the portal function of the mapper as far as I have tested.

There are 40 portals, connecting them the way you described will result in 39 additional exits for each portal, altogether 1560... and adding a new portal requires me to be very careful to not mixup anything... Maintaining a single list of portals would be much more conveniant. However, I have tried it with two portals as exits, it works fine in FAST Speedwalking and in SLOW, but not in SAFE mode - the correct commands are sent to the mud, but the current position in the mud is not updated.

anyway, thanks for your help
Reply with quote
nuhp
Beginner


Joined: 10 Sep 2010
Posts: 10
Location: Germany

PostPosted: Tue Sep 14, 2010 10:25 pm   
 
easier to maintain is a virtual room as a hub, having only one exit to it from each real portal (exit name #NOOP) and in the hub exit To 12 Name "sp 3" and all the other exits
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net