[Request] Places Desc'ing

  • I'm working on a building project on TR. I've been in a build there where when you joined a place, the desc of the room itself changed from the one you would see of it when not at a place. For example, a courtyard that in the description showed that there was a house, garage and stables. The garage and stables were places and when you joined the garage place, you would get a view of the courtyard as seen from the viewpoint of the garage, plus the inside of the garage itself which wouldn't be seen if not standing in that place. There's no tutorial in the building files for TR that I can see, and have googled the hell out of it trying to find information on how to set this.

    I'm starting to wonder if I actually had too much to drink one night and just imagined this, so any pointing towards a tutorial for this or information would be hugely appreciated!

    Chewing nails in anticipation!

  • Pitcrew

    @Pondscum, the only thing I can think of that isn't actually some specific code for this (which I can't know because I can't code for shit) is that whoever set that up those places changed the "you sit at table #" message for an entire @desc.

  • I'm not certain that that was it, you could hit 'look' and see the room desc like you would normally, only it was changed to a viewpoint from the place you were joined at..

    I might have to give up on the idea though - I just thought it was terribly clever and a way of not having to bloat the database by digging extra rooms that weren't strictly need. I can't code to save my life, so I'll probably have to give up on this! :(

  • I am not sure if this can be done with the style of place code that exists on TR; I tried, because there was absolutely a means of doing so on Shang. I used the heck out of it.

    For a Shang room, once you had places set up, it went like so:

    @desc here=[u(me/desc_place[match(u(me/placenums),%#,|)])]

    &DESC_PLACE0 here=Normal desc you see in the room when not at a place.
    &DESC_PLACE1 here=Desc you would see in the room when at place 1.
    &DESC_PLACE2 here=Desc you would see in the room when at place 2.

    This does NOT work on TR. (I tried back when I was there, no joy.) I don't know enough about code to tell you why it doesn't -- but perhaps someone with the proper code savvy can take a look at it and figure out a way to make the necessary adjustments to do so.

  • That's exactly what I was looking for. I can confirm it doesn't work though. Oddly, it does add in the room description for place 0, the room itself, but not for the places.


  • I'd honestly love to see that translated, especially if the place code being used at TR is part of the more recent core/code distributions going around these days. (Or just versions of it that work on other sites with custom place code, as people find solutions.)

    It is an amazingly useful trick to keep down room count, while allowing builders a fair bit of freedom to really elaborate on the space.

    On TR, I resorted to using extensive place descs people could look at. Not the same by a mile, but at least those spaces had some kind of detailed data that could be referenced. I'm not talking about places for things like 'table 1' or 'table 2', but for guest rooms, kitchens, and other 'it would be there, and if there is something unique about it that should remain consistent, having it referenced in a desc is important, but it's not a space that would be used often enough that a room would ever be necessary'.

  • Exactly. I have places for a bedroom, kitchen and bathroom off the main living room which you enter into. I didn't want to request 4 rooms as places suit it fine, but the ability to give different descs when in those places would be fabulous. If not, I'll have to settle for what you did and just detail out the place descs that can be looked at.

  • Tutorialist

    I know how to do this on standard places, will need to see how @Thenomain's recode stores place descs. It is really simple.

    ETA: Reading the entire thread helps. I can investigate how Theno'sno's thing stores place descs. I know it is different.

  • @Cobaltasaurus that would be great if there is a way that this can be used on TR, though if not I can live with it. Have to really! :)

  • Tutorialist

    So this is how Theno's rebuild of places stores things:

    &place.<num>.details ###=<name of place>|<spaces>|<description>.

    This is how it stores who is in a place:

    &place.<num>.occupancy ###=<who is there> -- I'm not positive how that is stored, but I'm going to guess it is a list of #dbrefs, question is whether or not it is stored as #123 #124 #125 or #123|#124|#125. I'm going to go with the latter from above. So to do this you will need to:

    I was going to put something here about how to do this, but I really need to install Theno's places on Wildcard, and see how it works first. Because I'm not positive what I think will work, will work -- or if I can do it in a slightly less clunky manner. So that will need to wait for a couple of more hours until my lunch time and I can be on my laptop.

    However, aside from TR possibly having it shut off so rooms can't pull their own attributes, this should also work on TR.

    @surreality, you should drop that into a tutorial thread! : P

  • Coder

    Use the 'places()' function on the @desc. At game night, so I can't explain further.

  • @Cobaltasaurus said:

    @surreality, you should drop that into a tutorial thread! : P

    Once we figure out how to work it with the Thenocode places, definitely; we can pop up a thread and have the various working versions and label 'em with where they're known to work. I'd love that as a resource!

  • Coder

    A little talking out loud here:

    think places( whichplace, %L, %# )

    So, for the room's desc:

    @desc here=udefault( placedesc.[places( whichplace, %!, %# )], placedesc.none )
    &placedesc.none here=this is the default description for the room
    &placedesc.1 here=this is how the room looks like from place 1
    &placedesc.2 here=this is how the room looks like from place 2

    Good luck.

  • That is amazingly wonderful, I'll try that out later today.

    Thank you.

    Edit: Just tried it and it works. Hurrah! Someone should do that tutorial thing that was mentioned earlier because for something so simple to apply, its bloody brilliant.

  • @Pondscum
    Do you know if this will work with the general SGP Places code (which is the only post-year 2000 version I can find out there)?

  • You guys remind me that I need to steal Theno's places code.

  • @Bobotron - I'm a code virgin. The only thing I'm capable of is copy-pasting the info that Thenomain posted here. Someone else might know though :)

  • Coder

    @Bobotron @Thenomain puts almost all his code on github: theno code

  • Coder

    @Bobotron said:

    Do you know if this will work with the general SGP Places code (which is the only post-year 2000 version I can find out there)?

    @surreality mentioned how to do it with the older places code. I may fold this trick into the base code that @Glitch mentioned.

  • @Thenomain
    Cool, Theno. You are a saint. I'll give Surreality's method a try with the SGP copy that I've downloaded to futz with.

Log in to reply

Looks like your connection to MU Soapbox was lost, please wait while we try to reconnect.