Enhanced extended descriptions

For builders to discuss and ask building questions.
Post Reply
Nylo
Sword Grand Master
Sword Grand Master
Posts: 447
Joined: Tue Jul 26, 2011 7:15 pm
Location: Ohio, USA

Enhanced extended descriptions

Post by Nylo » Sat Oct 12, 2013 2:26 am

In the area I'm working on, we're making use of extended descriptions. The question arose, is it possible to use if statements/mpcommands in extended descriptions, as the following?

Code: Select all

#QQ00
Room~
{80}This is a room. You see an {10}object {80}here.
~
0 ROOM_INDOORS SECT_INSIDE 0 0 0
DDIR_EAST
~
door~
EX_ISDOOR|EX_CLOSED|EX_LOCKED QQ00 QQ00 0
E
object~
if isaffected($) == read_magic
mpechoat $n The object says something.
else
mpechoat $n The object has obscure markings on it.
endif
~
S
I assume it's not possible as written, but is there a way to make this work, or a way to duplicate this functionality?
Nylo, Fighter of Tempus
Anver, Transmuter of Garl
Malic, Cleric of Tyr
Luthir, Druid of Mielikki
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Enhanced extended descriptions

Post by Harroghty » Sat Oct 12, 2013 3:27 am

An intercept prog on the room is one way. Another would be to place an actual object in the room with an EXA_PROG. The latter is probably the cleanest option.

Example for option one:

Code: Select all

#QQ00
Room~
{80}This is a room. You see an {10}object {80}here.
~
0 ROOM_INDOORS SECT_INSIDE 0 0 0
DDIR_EAST
~
door~
EX_ISDOOR|EX_CLOSED|EX_LOCKED QQ00 QQ00 0
>intercept_prog look~
if stringprefix($1) == object
  if isaffected2($) == read_magic
    mpechoat $n The object says something.
  else
    mpechoat $n The object has obscure markings on it.
  endif
else
  mpunintercept
endif
~
|
S
Example for option two:

Code: Select all

>exa_prog 100~
if isaffected2($) == read_magic
  mpechoat $n The object says something.
else
  mpechoat $n The object has obscure markings on it.
endif
~
|
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Nylo
Sword Grand Master
Sword Grand Master
Posts: 447
Joined: Tue Jul 26, 2011 7:15 pm
Location: Ohio, USA

Re: Enhanced extended descriptions

Post by Nylo » Sat Oct 12, 2013 4:04 am

I should have mentioned, we'd like to use it with multiple descriptions/objects per room. That's why I ruled out intercept_progs, but if we can intercept by keyword then that may be the best solution. Some of the items can be easily made as room objects, others not so much. Is it possible to trigger an exa_prog by examining the given keyword, if the object is invisible?
Nylo, Fighter of Tempus
Anver, Transmuter of Garl
Malic, Cleric of Tyr
Luthir, Druid of Mielikki
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Enhanced extended descriptions

Post by Harroghty » Sat Oct 12, 2013 10:14 am

First, I would caution you against making one room so full of detail and recommend instead that the things be spread out over a few rooms, but I say that freely admitting that I am ignorant of your idea.

Secondly, you escape people guessing the keywords of invisible objects by adding another layer to the intercept_prog. You might add the program to an invisible mob instead of the room, thereby adding the option of QBITs on that mobile saying if the option is visible or not, or you might just add another clause of the program under the stringprefix check establishing if the player should see it or not: a check for true sight, a skillcheck for search, etc. If they fail the skillcheck or are otherwise unable to detect the "object" then just mpunintercept so that they will get the message "You do not see that here." from the hard code.

At any rate, this is not the kind of thing to get all spun around the axle over during an area's rough draft. It's the kind of thing best tinkered with when an area has made it to the test port and you can employ some trial and error.
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Nylo
Sword Grand Master
Sword Grand Master
Posts: 447
Joined: Tue Jul 26, 2011 7:15 pm
Location: Ohio, USA

Re: Enhanced extended descriptions

Post by Nylo » Sat Oct 12, 2013 1:51 pm

Alright, that sounds good. Thanks!
Nylo, Fighter of Tempus
Anver, Transmuter of Garl
Malic, Cleric of Tyr
Luthir, Druid of Mielikki
Post Reply