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
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: Mon Jan 18, 2010 1:29 pm   

Converting already mapped room names to proper case.
 
Exactly what the topic says.. Ive got 100's if not 1000's of rooms mapped which have ended up completely lowercase in the mapper even though the mud text is proper case and its causing issues with the mapper not recognising where ive been. Now I can go through each individual room and change it but I thought id find out if there was an easier way to do this.. say a script that'll run through the map database and capitalise the first letter of every room name?
_________________
What do you mean, Fatal Error!
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Tue Jan 19, 2010 12:23 am   
 
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="fixmap" copy="yes">
    <value>#loop %numrooms {
  $vnum = %mapvnum(%i)
  $roomname = %subregex(%roomname($vnum),"^(.)","%upper(\1)")
  #call %roomname($vnum,$roomname)
}</value>
  </alias>
</cmud>


I put this into an alias so I could use local variables to make it cleaner. I have not tested this, back up your map first. By the way, "proper case" means Every First Letter Capitalized Like This, on the other hand you talk about capitalizing just the first letter of the room name (A sentence like this.), which is what this will do.
Reply with quote
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: Tue Jan 19, 2010 5:33 am   
 
Thanks, I'll give that a go and let you know if it works.
sorry, about the proper case confusion, I didnt know what other term to use
_________________
What do you mean, Fatal Error!
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