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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Mon Feb 13, 2006 2:51 am   

Automating Start/Recall Location
 
Is there a way to programmatically to set the start and recall locations via code? If so, how?

Issue:

The site has various temple towns on it. You can change your home town to the different temples at any time you want. The only restriction is that you can only set your home to a temple of your choice when you are in that temple.

To do this, I would like to setup an alias of:

~temple
#Set Recall Location
#Set Start Location

Note, I know the last 2 lines aren't actual programming codes, but it's psuedo for what does show under the Action menu on the mapper.

Sincerely,

Dodgester
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Feb 13, 2006 3:10 pm   
 
You want to use the #PORTAL command. Unless you specify a room number it assumes the current room.

For example.
Code:
#PORTAL "cast recall"
_________________
Asati di tempari!
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Tue Feb 14, 2006 4:00 am   
 
Nice idea, but this may only help for when actually recalling. However, there may be 1, or 2 problems with this as the help file on this isn't detailed enough. Maybe a couple of work arounds could be put into place to address this, but again, the help file needs to be more detailed as it doesn't really explain certain things like if it's global or not and no other help within the help file for version 7.21 on the subject matter as far as I can see. It doesn't even explain how it's used.

Issue 1: There are various rooms that leads the user to their respective temple home. Currently, I'm using the #RECALL command which is dependent on the recall location as set in the mapper.

Issue 2: When I log into the site, it starts me at the respective temple location that is set as my home, which is dependent on the start location within the mapper.


If there is no way to set the recall/start location programmatically, then I guess I would need to just use a global variable, have it set when I set my home, and then modify those room scripts to #TE to the room based on the Room's ID # of the current temple home, and the same thing with regards to logging into the site, which also would need to use the #TE command with the variable to put me into the proper location. I just thought it would be a lot cleaner and easier if it could be programmatically done to set the start/recall location on the mapper.

Sincerely,

Dodgester
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Feb 16, 2006 4:42 pm   
 
Check out the vbscript I wrote which changes your recall location. It is in the zMud maps and changing the recall point post. I couldn't actually get it to work inside zMUD but I didn't spend long on that really. It works perfectly when run from windows so I know it does what it needs to do.
_________________
Taz :)
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Fri Feb 17, 2006 5:00 am   
 
This looks similar to the VBA work that I have done, which I will have to look at this in closer details and see what I may need to do. Right now though, it's late and I need to get to bed as I have to get up in about 5.5 hours. Something for me to do on the weekend though. Thanks for the tip. Will post back my findings.

Sincerely,

Dodgester.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Feb 18, 2006 6:06 am   
 
The easiest way I can think to do this is with a short ID. Practically all mapper commands and functions can use it, so we would do a few things to cover the entire situation. First lets set a new recall alias, and make it easy to update.
#CLASS {Automapper|AutoMapperAll}
#ALIAS recall {#TELEPORT home}
#ALIAS SetHome {#IF (%1) {#CALL %maplocked(0) %roomid(home,"") %roomid(,"home") %maplocked(%1)} {SetHome %maplocked}}
#CLASS 0

Now that we have the correct recall system and a way to update it as well, we have to correct those rooms that are currently using #RECALL.
#VARIABLE VijilanteTemp {%maplocked}
#CALL %maplocked(0)
#FORALL %mapquery("Script LIKE '%#RECALL%'") {#CALL %roomcom(%i,%replace(%roomcom(%i),"#RECALL","recall"))}
#CALL %maplocked(@VijilanteTemp)
#UNVAR VijilanteTemp

Finally we make the teleportation automatic when connecting to the mud.
#CLASS System
#ALIAS atconnect {recall}
#CLASS 0

That should about cover it.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Thu Aug 10, 2006 4:56 am   
 
hmm what about adding a trigger to the tail end of your logon script to look to see what your room description is then us the #fin command to set the map to your location. This can also be used on your recall, just add
#wa 1500
#fin
to the end of your recall alias....
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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