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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
acusick007
Newbie


Joined: 09 Jan 2009
Posts: 5

PostPosted: Mon Sep 26, 2011 6:46 pm   

cMud v. 3.34 map goofup.
 
Backstory: I have made a script to walk through some rooms on my mud. I have all these rooms mapped with cMud, however when I started this script I had accidentally had the map mode set to "Map". Somehow during this script room exits on the cmud map started to get goofed up (exits that aren't in the mud got added to the cmud map).

Needed: I need a way to automate replacing exits that don't exits on the mud with the exits that are on the cmud map.

Progress:
Code:
// ROOM FIXING SCRIPT START
sewerclass/tempexits = @sewerclass/outs
sewerclass/tempexits = %replace(@sewerclass/tempexits,",","|")
sewerclass/tempexits = %list(@sewerclass/tempexits)
sewerclass/tempexits = %sort(@sewerclass/tempexits)
#IF (%sort(%roomexit) != @sewerclass/tempexits)
{
  #ECHO %dups(%roomexit)
  #CALL %roomexit(%roomnum,@sewerclass/tempexits)
  #ECHO CHANGED EXITS!!
  #ECHO CHANGED EXITS!!
  #ECHO CHANGED EXITS!!
  #ECHO CHANGED EXITS!!
  #ECHO CHANGED EXITS!!
  #ECHO CHANGED EXITS!!
  #ECHO %roomexit
  #ECHO @sewerclass/tempexits
  #ECHO @sewerclass/outs
}
// ROOM FIXING END!!


As you can see from the code here, the problem i'm having is that %roomexit sets exits even if they are already in the list of exits. I've tried to use this fucnction as well:
Code:
#CALL %roomexit(%roomnum,%dups(%roomexit))

However I've not had any luck...

Any help would be greatly appreciated.
Thank you!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Sep 26, 2011 8:16 pm   
 
If you are talking about correcting the number and direction of exits in each room, the easiest way is simply to turn the mapper to mapping mode and use #LOOK.
Reply with quote
acusick007
Newbie


Joined: 09 Jan 2009
Posts: 5

PostPosted: Mon Sep 26, 2011 8:32 pm   
 
I agree, but we are talking about perhaps 50-100 rooms that have had exits that don't exist added to the map. I cannot think of a way to semi-automate so all I have to do is walk through the room to fix the map. Perhaps a simple #LOOK on room entry? (using a trigger)

EDIT: Also this will not fix rooms that have been linked together that shouldn't be linked.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Sep 27, 2011 8:11 pm   
 
There isn't any way to fix room links that shouldn't have been linked, unless you already know what the links should be. Your code doesn't do that either. (But if you do know what the links should be, then it would actually be possible to run a set of %roomlink() functions, without even moving through all the rooms.)

It looks to me like your code is simply doing the same thing as a #LOOK command. Can you explain how it is supposed to be different?

As for how to automate executing #LOOK, I wonder how you expected to run your own script in each room? Executing is actually quite easy. Just create an Event of type OnRoomEnter, and have it execute #LOOK (or your own code, if you prefer).

For your own code, I don't see any obvious reason why your #IF is firing if the exit lists are the same. I see you print out the values of both %roomexit and @sewerclass/outs. I take it that the values appear to match?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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