|
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: 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! |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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. |
|
|
|
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: 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! |
|
|
|
|
|