MU Soapbox

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

    MUX: Openly writeable attribute?

    MU Code
    8
    14
    3238
    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.
    • surreality
      surreality last edited by surreality

      This week's stupid needed thing: something that would allow someone to add a temporary desc to a room designated as 'off-grid' space, or redesc a rented room with some custom tweaks.

      I have seen rooms that will allow this (on shang, for instance, one can add a new desc with a special command to rented apartments) and I recall TR's temproom RP area allowing someone to set a custom desc on the room while it was in use (I may be misremembering this?), so that's essentially what I'm looking for guidance on.

      I know more or less nothing about code, so being pointed in a general direction re: where to begin would be a huge help. (If somebody has this handy and is willing to share it or is willing to tinker with some things to create something along these lines, hey, epic, you rule and I'll love you forever•, but not asking for that.)

      Super general like 'look at permissions' is unfortunately not going to help me much; I've beaten my head against those walls and it doesn't sink in very well even with very good teachers attempting to explain, but a general direction on this one would be hugely helpful.

      • Warning: this means I'll probably end up arguing with you more. Blame my crazy Italian relatives, they taught me this approach.

      Oh fucking well.

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

        @desc here=[ifelse(hasattr(%!,temp-desc),[u(temp-desc)],[u(perm-desc)])]

        &cmd`desc here=$+desc *:@pemit %#=You have set the temporary description.;&Temp-desc %L=%0

        &cmddescclear here=$+desc/clear:@pemit %#=You have cleared the temp desc.;&temp-desc %L

        Now this is a very basic code. But feel free.

        Pay no attention to me. I'm old, jaded and generally unfriendly. I am prone to fits of stupidity, but I am still unique, just like everyone else. ~~ Current President of the Anti-Faraday fan club.

        Ashen-Shugar 1 Reply Last reply Reply Quote 0
        • Roz
          Roz Banned last edited by

          Faraday's suite has this for PennMUSH for her TP Rooms that might be translatable.

          1 Reply Last reply Reply Quote 0
          • L
            lavit2099 last edited by

            Theno's temp rooms have this. Unsure if you could use it on more permanent rooms like hotel/motel/dorm/apartment sorta things.

            Bobotron 1 Reply Last reply Reply Quote 0
            • Bobotron
              Bobotron @lavit2099 last edited by

              @lavit2099

              The code above is generic and should work for MUX, though you'd want to set it on an object that can control the room in question so it can set the temp attribute since you can only set attrs on things you own/control.

              1 Reply Last reply Reply Quote 0
              • Ashen-Shugar
                Ashen-Shugar @ZekeTheG33k last edited by Ashen-Shugar

                @Seamus said in MUX: Openly writeable attribute?:

                @desc here=[ifelse(hasattr(%!,temp-desc),[u(temp-desc)],[u(perm-desc)])]

                &cmd`desc here=$+desc *:@pemit %#=You have set the temporary description.;&Temp-desc %L=%0

                &cmddescclear here=$+desc/clear:@pemit %#=You have cleared the temp desc.;&temp-desc %L

                Now this is a very basic code. But feel free.

                I'd put in protection since not every codebase sets new attributes NO_COMMAND.

                So like:

                @desc here=[default(me/temp-desc,v(perm-desc))]
                &CMD_DESC here=$+desc*:@pemit %#=You have [ifelse(gt(strlen(%0),0),set description '%0',cleared the description)];&TEMP-DESC me=%0;@set me/temp-desc=no_command

                skew 1 Reply Last reply Reply Quote 1
                • ZekeTheG33k
                  ZekeTheG33k last edited by

                  I did say it was... basic 😛 But yeah, speaking to the permissions issue, the room can always set attributes on itself, so as long as the room is !NO_COMMAND the room will run the command. But like Ashen said, probably smart to put some protections in place. I just threw that together on the fly.

                  Pay no attention to me. I'm old, jaded and generally unfriendly. I am prone to fits of stupidity, but I am still unique, just like everyone else. ~~ Current President of the Anti-Faraday fan club.

                  Bobotron 1 Reply Last reply Reply Quote 0
                  • Bobotron
                    Bobotron @ZekeTheG33k last edited by

                    @Seamus
                    Cool. And yeah, protection is always good. I don't generally code for MUX so I wasn't sure about control of rooms and such. Thanks for the clarificaiton.

                    1 Reply Last reply Reply Quote 0
                    • skew
                      skew @Ashen-Shugar last edited by

                      @Ashen-Shugar Can you explain this? I'm not sure I understand.

                      If the new command only works "here", and checks that "here" is flagged as a temproom, what would the code you added... add?

                      Bobotron 1 Reply Last reply Reply Quote 0
                      • Bobotron
                        Bobotron @skew last edited by Bobotron

                        @skew
                        Not AS, but... It's meant to be set on an individual room, regardless of whether or not it's a temproom or a normal room, rather than be used globally. You set it 'here' to set it on the room, where it's only usable when you're in that room.

                        temp-desc is the attribute that the command would set. IF there is a temp-desc, the 'look' command displays the tempdesc (IE: a room that had a bomb go off, could have a tempdesc describing it) instead of the normal desc.

                        If it needs to be global and accessible from only certain rooms, it's tweakable.

                        skew 1 Reply Last reply Reply Quote 0
                        • G
                          gasket @surreality last edited by

                          @surreality

                          If you can get your hands on Theno's +temproom code, it's about perfect. I wish it was on every game. It might take some twiddling if you wanted to use it for permanent rooms rather than temporary RP locations, but it still has everything you're looking for.

                          1 Reply Last reply Reply Quote 0
                          • skew
                            skew @Bobotron last edited by

                            @Bobotron Got it. Yeah, I guess I'd just write a global command to work on rooms I had flagged as "temp".

                            @gasket We had a real, real hard time getting it working correctly on Fallen World MUX... and that required Thenomain himself to do it. And it's still not working 100% correctly. Note that I didn't install it from the get-go, so who knows what happened along the way, but it's definitely not easy peasy.

                            G 1 Reply Last reply Reply Quote 0
                            • G
                              gasket @skew last edited by

                              @skew said in MUX: Openly writeable attribute?:

                              @gasket We had a real, real hard time getting it working correctly on Fallen World MUX... and that required Thenomain himself to do it. And it's still not working 100% correctly. Note that I didn't install it from the get-go, so who knows what happened along the way, but it's definitely not easy peasy.

                              Damn. That's really too bad. From a player POV, it was ideal. Obviously the new solution is for Theno to find another six hours in every day and make it work cross-platform out of the box.

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

                                I know it's been forever since I asked about this, but I finally got this all set up and working and wanted to pass along a thank you to @Seamus and @Ashen-Shugar for their help.

                                I was able to tweak it just a teensy bit and work a title change for the room in to adjust how it displays on +where and in the room list, too, which I'm hoping will also be helpful.

                                Thank you again, this was enormously helpful.

                                Oh fucking well.

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