Skip to content

[Mudlet System] Save the Universe

ATTENTION: This system is for system design reference and comes with minimal support! If you are looking for a fully-fledged system, I recommend one of the other choices in the Client Discussion and Coding category.


This is a snapshot of my work-in-progress system, Save the Universe. The purpose of sharing it is for coding reference - I write clean code, often with comments, that I have often been told makes it a useful learning tool. SU's features, in no particular order:
  • Windows for chat and map capture (does not currently support the hacking map).
  • A "readout" window that displays detailed, organized information about the things in your room.
  • A pretty good autobasher if you happen to be a BEAST with a wristblade. Type HUNT to turn it on and off. Type SH to enable auto-targetting.
  • An example of a clean and readable prompt.
  • Numerous cosmetic display replacements.
  • The "pulse" system model I popularized for Aetolia.
  • Useful libraries for throttling the rate at which actions are sent, sending commands in a large stack, batched actions, etc.
  • Movement hooks to handle regular movement, ship movement, etc.
  • Nearly complete GMCP implementation, with a strong example of how to locally store and rearrange GMCP info.
  • An emergency key if things are going south: F12 (currently only stops autobashing).
If you are a fledgeling Lua coder or new to Mudlet, this system should make a good source of reference material. I am by no means the best programmer, and you'll find several instances where I was a little lazy, but for the most part this can make a solid foundation for your own system.

You do not need to ask permission to use, alter, or distribute this system.

You can grab the system here: https://mercymyqueen.com/starmourn/save_the_universe.zip

To get started:
  • In General Preferences, set your "icon size toolbars" to 2, "show menu bar" to always, and "show main toolbar" to never. Make sure GMCP is enabled.
  • In Input Line Preferences, set the "command separator" to anything you like, so long as it's not a semi-colon (;) or pipe (|). I use a double semi-colon (;;) myself.
  • In Main Display, note that "Bottom border height" will always be 22 - this is set in system initialization. I strongly recommend enabling "Echo Lua errors to the main console". Take note of your "Wrap lines at" setting, you will need to modify a script to reflect whatever you have here.
  • In Scripts > Save the Universe > Load Tables: scroll to the bottom, where there is a comment header called "-- Low-level variables." Set su.fullname and su.shortname to your mindsim name, or whatever else you like. Set su.wrap_width to the wrap width you set in Preferences.
  • Finally, type CONFIG FIX. Notice: doing so will alter your CONFIG options substantially, including almost all of your game colors!

Support:

I work a lot. Like, a lot a lot. If you have any questions about this system, you can contact me here, or at Earthcrusher#9999 on Discord. I can't promise I'll be able to get to you immediately, or even on that day.

Comments

  • Could you also put it up on GitHub so we can link to specific places in the code?
  • edited January 2019
    Sure! Most recent .xml is here, at https://github.com/Earthcrusher/Save-the-Universe

    Most recent edits include adding an alias to open the profile directory, and changing some instances of "var = function ()" to "function var()" for consistency.
  • Do you mind taking a quick screenshot?
  • I'll hook you up as soon as I get home. 
  • My bad, I did not in fact hook you up when I got home. But now I'm hooking you up.


  • I can confirm this is a good system to learn from!
  • Vadi said:
    I can confirm this is a good system to learn from!
    Hm... knowing Vadi's credibility for years with his mm system back then, if he says its good, then it must be a good one then =)
  • edited January 2019
    How would I go about rearranging the width and position of the additional windows you have? I like what I see, but it doesn't fit my screen at all and everything is cutting off. 

    Edit: I guess to specify, if it helps... 

    I play on my cute 13 inch laptop. Not ideal for this sort of thing, but I don't like being tethered to a desk. I've managed to figure out how to shrink the chat window, but I'd like to do some tweaks to align the Room, players, and etc underneath of that to make room for squeezing the map in underneath of all of that. I don't really expect anyone to do this for me, but just learning how I can move the tables would be great since that would allow me to customize as necessary.

    Even pointing me in the direction of some kind of tutorial would be extremely helpful! 
  • Illidaen said:
    Vadi said:
    I can confirm this is a good system to learn from!
    Hm... knowing Vadi's credibility for years with his mm system back then, if he says its good, then it must be a good one then =)
    Ha :smile: I can't vouch for it's completeness as I don't play the game, but looking through the code, it's great to learn from!

    Try to the drag & drop framework for your ui though :)
  • edited January 2019
    Annesani said:
    How would I go about rearranging the width and position of the additional windows you have? I like what I see, but it doesn't fit my screen at all and everything is cutting off. 

    Edit: I guess to specify, if it helps... 

    I play on my cute 13 inch laptop. Not ideal for this sort of thing, but I don't like being tethered to a desk. I've managed to figure out how to shrink the chat window, but I'd like to do some tweaks to align the Room, players, and etc underneath of that to make room for squeezing the map in underneath of all of that. I don't really expect anyone to do this for me, but just learning how I can move the tables would be great since that would allow me to customize as necessary.

    Even pointing me in the direction of some kind of tutorial would be extremely helpful! 
    Given the reception of this system, I intend to make it more configurable in the future so that you don't have to worry about this sort of thing, but for now, resizing the room/player/etc. window (called the Readout Window) isn't too hard.

    In Scripts > Save the Universe > UI > Readout Window, at the very top you will see the following code block:

    local wrap_width = 100
    local char_width = 7local char_height = 13
    local name_width = 40local id_width = 6
    local col_width = name_width + id_width + 2local col_count = math.floor(wrap_width / col_width)
    local w = wrap_width * char_width

    All you have to do to resize this window is change the wrap_width variable - the rest should dynamically resize. My resize implementation isn't 100% complete, so if you see no change, try clicking on the UI Initialize script right below the Readout Window script to force it to update.

    Hope that helps!


    Edit: Seems the forum's code block formatting is a little broken, so the code above won't look quite like what you see in the system. But you get the idea.
  • That worked! But uhm… hmm. How can I move the map over to the right to compensate for the shrinkage of the other windows? I'll play with it a bit to see if I can figure it out, but I figured I would ask.
Sign In or Register to comment.