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
Grahamjones
Newbie


Joined: 08 Feb 2002
Posts: 2

PostPosted: Fri Feb 08, 2002 5:00 pm   

Making rooms based on another session
 
how can i use #MAKEROOM with the current @roomname and @roomname from another session?
is it like this
#MAKEROOM {%1} {@sessionname.roomname} {@sessionname.roomdesc}
and how do i find out what the sessions names are?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sat Feb 09, 2002 4:35 am   
 
There is a predefined variable %names that contains all session window names. However I do not think you can directly access the data you want in another session. What can do is arrange an alias trigger combo to pass the data back and forth.

For the sake of this rough code we will assume the session with the map data is A and the one making the rooms is B.

In A we will make the alias:
#AL FetchRoom {#IF (%ismember("%1",%names)=0) {#SHOW Invalid return window name!;#BEEP} {:%1:#VAR RoomName {%roomname(%roomnum)};:%1:#VAR RoomDesc {%roomdesc(%roomnum)};:%1:RoomDataReady}}

Next in B we make a few aliases:
#AL MakeRoom {#IF ("%1"="") {#SHOW Direction required!} {RoomDir="%1";:A:FetchRoom %window}}
#AL RoomDataReady {#IF (@RoomDir="") {#SHOW Use MakeRoom first to set direction.} {#MAKEROOM {@RoomDir} {@RoomName} {@RoomDesc}}}

Hopefully I didn't forget too many }. Also you will have to change the :A: to match whatever is the correct name or if you only use 2 session windows you can get fancy %delitem(%window,%names) and have the whole thing automatic. There is more error checking you should be doing in there, but it is up to you to read the help files on everything in there and understand how to make it better.
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