MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Colorful exits?

    MU Code
    penn ansi exit color pennmush
    5
    9
    3398
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kls last edited by kls

      Short and quick: say you want to differentiate between private gridspace exits (let's call them gray) and normal gridspaces (let's assume the exits are uncolored already).

      Joe's House <JH>
      Bob's House <BH>
      Restaurant <R>
      Supermarket <S>

      Without touching exit parents, and using JUST a builder bit, is there a way to color JUST the exits for Joe and Bob's houses gray, so they can be differentiated as private residences, but not change the exits for the restaurant or the supermarket? PennMUSH 1.8.5. @exitformat does not appear to be what I'm looking for, and simply plugging in ANSI doesn't work. Thank you!

      1 Reply Last reply Reply Quote 0
      • Thenomain
        Thenomain last edited by Thenomain

        Exitformat is what you're looking for. While I don't know Penn, I will give you a Mux answer:

        iter( %0, ansi( if( strmatch( <something about loc( %i0 )>, <is private> ), xh, n ), name( %i0 )), , %r )

        However, again in Mux, rooms may not have permission to see if a room is or isn't on the main grid, so you may be forced to create your own "privileged" user-defined function.

        &ufunc.room_on_grid: cand( hastype( %0, ROOM ), <however you determine this> )

        Then your room parent's @exitformat can:
        iter( %0, ansi( if( room_on_grid( loc( %i0 )), n, xh ), name( %i0 )), , %r )

        n.b., most of this is from memory and may need tweaked.

        (The possible secret: For exits, loc( <exit> ) returns the dbref of the room at the other end. For the room at this end, which is sometimes needed, it's home( <exit> ).)

        “If you wish to make an apple pie from scratch, you must first invent the universe.”
        ― Carl Sagan, Cosmos

        1 Reply Last reply Reply Quote 1
        • K
          kls last edited by

          Thank you! I'll see what I can poke at with the buildbit, though it may be a job for actual staff.

          1 Reply Last reply Reply Quote 0
          • Thenomain
            Thenomain last edited by Thenomain

            @kls,

            Oh yes, this is not a builderbit job. It could be that there's something in Penn that's stopping you from setting ansi on exits. Have you tried the following?

            @fo me=@name <exit>=ansi( xh, Exit Name );alias;alias;alias

            That might be in your purview.

            “If you wish to make an apple pie from scratch, you must first invent the universe.”
            ― Carl Sagan, Cosmos

            1 Reply Last reply Reply Quote 0
            • K
              kls last edited by

              @Thenomain said:

              @fo me=@name <exit>=ansi( xh, Exit Name );alias;alias;alias

              Already tried that. @Forcing doesn't work. Exits are set no_command visual prefixmatch.

              1 Reply Last reply Reply Quote 0
              • 3543thrh67
                3543thrh67 last edited by

                Does the builder have all the appropriate flags enabled?

                1 Reply Last reply Reply Quote 0
                • K
                  kls last edited by kls

                  I am not sure, and will leave that to staff, because it's not really my purview to discuss: @Alzie, @Groth , @Shavalyoth ? (But thanks! I'm just a volunteer player, though, not staff, and don't want to overstep my bounds.)

                  1 Reply Last reply Reply Quote 0
                  • G
                    Groth last edited by Groth

                    Names can't contain ansi code because they are names and having code in them would be terrible.

                    @exitformat here=Exits: %r[iter(%0, name(%i0) <[ansi(default(%i0/COLOR,d),alias(%i0))]> - [name(loc(%i0))]%r,,)]

                    and
                    &color <exitref>=<whatever color>

                    Is the way to do it, replace exitformat with whatever you feel like.

                    You could also instead of color have some sort of type attribute and use a switch in the exitformat to pull out the predetermined colors. Worthwhile types to consider for this game could be Open, Closed, Controlled, Rack, Safe Place, Elysium etc

                    What is obvious to you may not be obvious to me and vice versa.

                    1 Reply Last reply Reply Quote 1
                    • Mercutio
                      Mercutio Creator last edited by Mercutio

                      Not seeking to resurrect this topic. But for those who come one day later, a new feature now exists in PennMUSH which allows this behavior more easily: help monikers

                      You can lean on the moniker() function, or fall back on the default exit format, for this functionality.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post