MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard
    1. Home
    2. Chime
    3. Posts
    • Profile
    • Following 7
    • Followers 10
    • Topics 16
    • Posts 263
    • Best 126
    • Controversial 0
    • Groups 2

    Posts made by Chime

    • RE: request: Example of a dice roller

      @SG said:

      Does anyone have anything basic laying around? Some features I'm looking for to see how they work:

      Sort of.

      A command to roll different types of dice, 1d4, 1d6 3d8 etc.

      As you note below, the die(n,sides) function is what you want.

      I've tried farting around with the dice(x, x) command built in, but I get a lot of huh? messages coming back to me, so I think I'm missing something fundamental here.

      It's a function, not a command; functions are evaluated within leading buffer context (which you don't need to worry about yet, it won't be on the test). Put it in a command.

      For testing, to yourself:

      think dice(3,6)
      

      For outputting to a room, perhaps:

      @remit %L=<dice> %N rolled 3d6 for [dice(3,6)].
      

      And putting that into a command on an object:

      @create dice code object (dco)
      &cmd_dice dco=$+dice *d*:@remit %L=<dice> %N rolled %1d%2 for [dice(%1,%2)].
      

      A command to roll those as explody dice. If a 1d4 gets a 4, then add 1d4.

      Mush doesn't have while-loop style iteration unless you restructure things into a @trigger loop. You don't want to do that, generally. Instead, most nwod dice and other explodey types use recursion-- that is, a function that calls itself, but only for exploding values.

      Modifiers to the dice. 1d4-2

      For arbitrary syntax, this becomes a problem of lexing and parsing the tokens, which is something that mush is fairly bad at. It can be done, but is more complicated than I can type up right now.

      For simple syntax matching what you have there, something like:

      &cmd_dice dco=$^\+dice ([0-9]+)d([0-9]+)\+?(-?[0-9]+)?$:@remit %L=<+dice> %N rolled %1d%2[if(strlen(%3),if(gte(%3, 1),+,-)%3,)] for [add(dice(%1,%2),%3)].
      @set dco/cmd_dice=regexp
      

      Rolling against a stat on a character

      You can read attributes with get(dbref/attr) or the like, but stats should usually be hidden and/or read-only. You may need to set up api functions for accessing them in a global function of some sort.

      Parsing dice with stats, especially for multiplayer rolls, e.g.

      +roll strength+brawl+item(katar) resisted by PLAYERNAME:defense
      

      And then showing the results but not the number of dice rolled, etc, is... tricky.

      Note: just typed this up. Code above not tested, may have stupid typos.

      edit: fixing codeblock boundaries in post

      posted in MU Code
      Chime
      Chime
    • RE: Any players of Eclipse Phase out there?

      I've only played it in a quasi table-topish environment.

      You can be an octopus though! 🐙 That's pretty keen.

      posted in Tastes Less Game'y
      Chime
      Chime
    • RE: Steam Summer 2015 sale, beware!

      posted in Tastes Less Game'y
      Chime
      Chime
    • RE: Mechanipus downtime

      @Derp Sigh. Try now.

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      @Derp That's likely a function of which games are correctly configured to autostart. Yell at @thenomain, maybe...

      He'll probably ask me to fix it tho.

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      We're back up and it looks stable.

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      @Sponge said:

      I'm going to go out on a limb and guess the host didn't have the benefit of independent power supplies.

      Do you need host in the meantime? I got much capacity.

      I suspect you're right, and I cannot imagine why. Multiply-redundant power generation facilities and regular testing/maintenance are a pretty critical part of the industry now.

      That said, this particular datacenter has a long history of trouble (lightning strike, truck crashed into the building, etc).

      I'll likely be moving both KUU and KURAMORI out to Texas. bleh.

      For my day-job, we're in a local datacenter that has a much better track-record, and yes-- redundant power generation and supply all the way to each physical machine.

      Linode is a hosting provider though, so the idea is they should ensure those things are taken care of. It's looking like HE.net is just a bad place to go.

      As for hosting... well. Thank you for the offer! I suspect that as I gradually transition out of mush-hosting, lots of people will want to take you up on that.

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      Update: HE-Fremont lost utility power; PG&E reports 500-4999 properties affected in Fremont.

      Like most modern datacenters, HE has diesel generators that come on line right away to prevent this. One of them suffered some sort of mechanical failure. Guess which one we were on!

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      Update! Part (maybe a large part) of Fremont lost power.

      Been a few years now since HE-FREMONT was having these problems, but it's somewhat infamous for having bad luck with electrical issues. (Getting struck by lightning and frying servers, etc.) Fun times. 😫

      Still no ETA. I'll keep watching and let everyone know once it's back in my hands.

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      Incidently, this probably means other large MUs hosted in that datacenter (not by me!) are down also. (Tapestries, et al...)

      posted in MU Code
      Chime
      Chime
    • RE: Mechanipus downtime

      See http://status.linode.com/incidents/2rm9ty3q8h3x for the most up-to-date info.

      posted in MU Code
      Chime
      Chime
    • Mechanipus downtime

      Still trying to identify details, but both Mechanipus-Fremont servers are unreachable at this point. Suspected routing problem within HE-Fremont. Games affected:

      crossover medieval nocturne statuvariabilis tgg whrofh goetia belleauwood oldandnew thedrift fnt masseffect julesletters muffinmu magicplays dystopia cofab cmuffin wildcard nolabigeasy chaoticcosmos clockwork hermworld battlemux pony rifts spellbound suicidechilde cotl hpb dcfallen eldritch reno arrakis darkspires darkwater stromm nevermore uumux republic thereach reach2 spacething

      No ETA available at this time.

      posted in MU Code
      Chime
      Chime
    • RE: Parent Room Problems

      @Bobotron said:

      Not sure if it works on MUX but you can also make an attribute visual, which means anyone and anything can see it with ex or get() as well.

      That's what was done on TheReach.

      Setting attributes visual is persistent in the DB and global across all objects.

      posted in MU Code
      Chime
      Chime
    • RE: Request: Halp!

      @Melpomene said:

      @Chime If you ever get around to doing that, gimme. 😄

      @Thenomain tells me I need to give him a hardcode @whence command first. (tells you where the command you specify is defined, which is rather unexpectedly useful for taking a quick look at whatever bug people are complaining about today...)

      Have you got that vtables function documented anywhere? I would've used it if I'd known you didn't have to specify column widths, but the code I found didn't include documentation and taking apart someone else's code is always a PITA. I just want to know what format it expects things in.

      I had it beautifully expanded and documented on WORA. sigh.

      Really, what you see is what you get.

      vtable( LIST ) is expected to work for simple cases; the 0-default column count will decide on its own what a sensible column count for the data and screen is.

      I found myself (mostly out of sheer "I CAN code so I WILL code!") making the equivalent of vtables in a different way: it expects a string formatted with two delimiters like so: a|b|c|d~e|f|g~h|i|j|k|l~m|n|o~p|q|r|s|t~u|v|w~x|y|z - and the two delimiters, and it outputs the whole set as a list of columns, fitting them to whatever width is available.

      One of the MUSH codebases had a hardcode format function (of some name) that looked much like that. Probably Penn or RHOST.

      Gimme if you've got it, reinventing the wheel is fun but I'm not sure I'm doing the world any good. 😉

      If you can use it from what I've explained already, you're welcome to it. If not, well, it's broken and you get to keep both pieces.

      @Arkandel said:

      Sometimes you have a problem. You figure you'll use a regex to fix it. Now you have two problems.

      (says someone who uses regexes every day. 🙂 )

      They are quick and effective, but for anything of significant complexity, I prefer language that allow easy expression of more complex parsing algorithms. Yes, C/C++ has flex/bison (or lex/yacc if you are truly desperate and your time machine is stuck in the 70s or something). Java has ANTLR, or whatever. Those are effective if you're trying to write a compiler, but tend to be a bit clunky and I've found there is a very large functionality gap between "I'm writing a compiler with multi-file contextual grammar." and "heyyy a few regexes will do fine."

      The sweet-spot seems to be language that can readily express simpler recursive-descent or similar parsers without having to break into a whole new language (like bison does). Haskell's Parsec and AttoParsec modules do a fantastic job of fitting exactly into that niche-- especially when combined with the applicative functors module. Being able to add recursive grammar for handling string escapes and other important details make for a huge functionality improvement over more primitive systems like regexs.

      posted in MU Code
      Chime
      Chime
    • RE: [Ethnicity Thread] Who Do You Think You Are?

      @Cirno:

      Sweetie, you really need to get laid.

      posted in Tastes Less Game'y
      Chime
      Chime
    • RE: Request: Halp!

      @Melpomene But I liiiiike perl and regexes and things!

      But yes, perl can be horrendous too.

      The only other language I know that treats strings even vaguely like MUSH does would be M4-- the macroprocessor used for sendmail configs and GNU Autoconf and friends. It's a mess.

      vtable() is not a good example of anything, but did what I needed it to at the time. tl;dr it formats a list into some number of columns for the apparent width() of the screen. If the specified columncount is 0 or not present, it looks at the data and uses the most columns it can without truncating elements. The cell borders, padding, and contents are all specifiable and color-safe. iirc, args are ( list, columncount, input delimiter, output separator, padding ).

      Perhaps more interesting are the exposed helper functions; ncol and widthcol. ncol takes ( maxwidth of an element, number of elements); widthcol takes (count), where count is a number of columns. ncol gives you how many columns vtable would use, and widthcol tells you how large the columns will be (which with padding is larger than the input list, maybe).

      Things like the +who I made for the reach use this to dynamically construct internal columns in a vtable with individual width/alignment details that change dynamically depending on screen width.

      ...if I were doing this over, I'd just write a few hardcode functions to format html/css tables for a text screen. They are almost simpler, really.

      posted in MU Code
      Chime
      Chime
    • RE: Request: Halp!

      @Cobaltasaurus said:

      He will pretty much chat code even when you don't want! Or are unsuspecting of the code!

      Can confirm! ...but it's actually rather nice. I can't always help, but often the sudden popup of zomg random code exuberance really helps make the day better.

      posted in MU Code
      Chime
      Chime
    • RE: My Adventures in Explaining the Stress of Staffing (To a non-Geek)

      @Thenomain said:

      I actually checked, you ass.

      I wonder how many of us did, without even reading the rest of the thread.

      Really says something.

      Also, yay ass.

      posted in Mildly Constructive
      Chime
      Chime
    • RE: My Adventures in Explaining the Stress of Staffing (To a non-Geek)

      @Huzuruth said:

      It's on Steam.

      Wait what? I thought all the servers and everything got shut down?

      Yeah. Went on steam in 2009 or something, then in shut down in 2012.

      There's an interesting kickstarter that ended but seems to be still active in producing some sort of spiritual successor.

      I do rather miss my little mastermind.

      "Why aren't you fighting?" the party leader screamed, dodging another small missile.
      "Fighting?" The Red Rasper sniffed. "Do be serious. I have people for that." Her wrists flicked vaguely toward the onrushing robotic horde. Suddenly, ninjas-- ninjas everywhere.

      posted in Mildly Constructive
      Chime
      Chime
    • RE: [Ethnicity Thread] Who Do You Think You Are?

      @DamnitJim said:

      In general, there should be a lot more Coalitions for Promoting More Hookups. That's my main message 😉

      Ho yez.

      posted in Tastes Less Game'y
      Chime
      Chime
    • 1
    • 2
    • 6
    • 7
    • 8
    • 9
    • 10
    • 13
    • 14
    • 8 / 14