Sunday, April 24, 2005


ANSI Colour in Lima Mudlib

As a way to ease myself in to starting to make changes to the mudlib itself, I have started to play with the default colour settings.

The Lima mudlb comes with a rather nifty administration tool for changing colours. It does take a bit of playing with however, as to change a default colour, you must first remove it from the tool, then add it again with the new colour. Existing players won't see this colour unless they change their own customised default settings with the command colours typename remove.

So I have now changed the default colour for the room_short description. Easily done, but hardly modifying the mudlib in any way.

Next step was to add a new default colour type to the mudlib. In this case it was decided that we should have some way of colouring people in room descriptions to help make them stand out.

After searching through the various files I found the code that is used to display objects (including players) in the room_desc.c file in the standard objects folder (/std/room/room_desc.c). This file uses some simple string additions to return a full string which is then printed to the screen at the end of the room description as a list of objects.

Before I modified the file, I first used the admtool again to create a new default colour type called room_person. Then, finding the section in the file while added a player description to the string, I modified it to

user_show += "%^ROOM_PERSON%^" + str + "%^RESET%^\n";

The colours didn't seem to activate straight away after updating the file, so I rebooted the mud and up they came.

The first "real" modifcation for Kelianon.

Labels: , ,

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?