It seems like forever since I updated FMud so here is a new version with some new features that hopefully people will find useful. My versioning scheme went out the window some time ago so I’ve decided to call this 1.0 alpha as there are quite a few major new features and hopefully once they are all working properly it’ll be mostly feature complete.
A lot of the new functionality hasn’t had much testing so if you come across any problems please let me know and I will try to fix them ASAP. Bear in mind that MXP is only partially supported and life is probably too short for me to expand it much beyond what is in place now.
Skinning
There is now an images directory at the same level as the swf which contains png images for each of the buttons and one named ‘skin.png’ which can be used to overlay the entire client to provide a more custom graphical look. Simply replace the button images and skin file with your own graphics. I’ve included some plain buttons and a basic skin.png image you can use as a template. Unfortunately the buttons don’t support different states but this was the only way to do it and have the images loadable at run time.
You can also adjust the spacing of the output and command windows relative to the edge of the container in order to better accommodate your custom skin. This is done using flashvars in the embedding page, see the README for a list of the new parameters.
MSDP Support and External Interface
The client will negotiate MSDP and can accept basic MSDP_VAR and MSDP_VAL data which is then passed to the container in the receive_msdp function. Each line from the server is also passed to the container using the receive_text function:
function receive_msdp (msdp_var:String, msdp_val:String):void function receive_text (txt:String):void
In addition, FMud implements the following callbacks from the container for sending data back to the server:
function send_msdp (msdp_var:String, msdp_val:String):void function send_text (txt:String):void
In theory this should allow you to build a GUI in javascript on the embedding page around FMud and communicate back and forth.
This was requested by a couple of people but it’s not something I have much experience with and is basically untested so please let me know if it isn’t working as intended.
MXP Support
FMud now supports SEND, A, GAUGE, COLOR and IMAGE tags, as well as SUPPORTS and VERSION. Context menus using send are also supported. Querying of specific tags using SUPPORT is not available, instead the client will send the full list of supported tags regardless.
Only temp secure mode (4) is supported so you need to send ESC[4z before each MXP tag. There is no negotiation.
Simple !ELEMENT definitions are also supported with a single attribute only, for example you could define the element ‘x’:
<!el x '<send href="&text;|l &text;" hint="move &dir;|look &dir;">' att='dir'>
You could then send the following shorthand tag:
<x 'over the hill'>hill</x>
Which would be parsed as:
<send href="hill|l hill" hint="move over the hill|look over the hill">hill</send>
When clicked this link would open a context menu with two options, “move over the hill” and “look over the hill” which would send the commands “hill” and “l hill” respectively.
Support for up to four gauges is built in using the names gauge1, gauge2, gauge3 and gauge4. You need to specify caption and color attributes for each gauge and then send the data using the entities curr# and max#, for example:
<GAUGE gauge1 caption='Hit Points' color='red'> <GAUGE gauge2 caption='Mana' color='blue'> <GAUGE gauge3 caption='Move' color='yellow'> <!ENTITY max1 100> <!ENTITY max2 100> <!ENTITY max3 100> <!ENTITY curr1 56> <!ENTITY curr2 78> <!ENTITY curr3 24>
The gauges are shown above the input bar so you’ll need to adjust the position of the output window accordingly.
Tags are not case sensitive and !ELEMENT and !ENTITY tags can be shortened to !El and !En. You can use Hex or standard HTML color names with the COLOR tag. Embedding multiple tags within !ELEMENT definitions probably won’t work and embedding tags within tags probably won’t either.
Unicode Support
This is another feature that has been requested a few times now and I’ve implemented what I think is the correct algorithm to decode UTF-8 but I’ve had difficulty finding a live mud to test it on so if anyone uses this on their server please let me know how it works.
You can get the new version from the downloads page. Make sure you check the README for updated flashvars information as well as some more explanation on policy files as this seems to be what trips people up the most.
