Up to Main Index                           Up to Journal for January, 2019

                    JOURNAL FOR SUNDAY 20TH JANUARY, 2019
______________________________________________________________________________

SUBJECT: Which witch is which?
   DATE: Sun 20 Jan 19:59:59 GMT 2019

It seems that my last entry about enhancing the parser has caused quite a bit
of excitement. People are eager to get their hands on the code and have a
play. So I’ve just pushed a new WHICH command out to the public dev branch.

The new WHICH command uses the new item search and matching to identify items
either being carried or at the current location. I’ve also added some more
ball variations for testing out the WHICH command.

In addition, yes there’s more!, the item search and matching can limit the
search to N items or a specific item such as 1st, 2nd, 3rd etc.

You want an example? Okay, happy to oblige :) Assuming we have:


  Fireplace
  You are in the corner of the common room in the dragon's breath tavern. A
  fire burns merrily in an ornate fireplace, giving comfort to weary
  travellers. The fire causes shadows to flicker and dance around the room,
  changing darkness to light and back again. To the south the common room
  continues and east the common room leads to the tavern entrance.

  You see a large red ball here.
  You see a small green ball here.
  You see a large green ball here.
  You see a small bag here.
  You see a small red ball here.
  You see a small sack here.
  You see a curious brass lattice here.
  You see an iron bound chest here.

  You can see exits east, southeast and south.
  >


Then we can do:


  >WHICH BALL
  You look around.
  You see a small red ball here.
  You see a large green ball here.
  You see a small green ball here.
  You see a large red ball here.
  >WHICH 2 BALL
  You look around.
  You see a small red ball here.
  You see a large green ball here.
  >WHICH 2 RED BALL
  You look around.
  You see a small red ball here.
  You see a large red ball here.
  >WHICH 1 GREEN BALL 1 RED BALL
  You look around.
  You see a large green ball here.
  You see a small red ball here.
  >WHICH 2ND GREEN BALL 2ND RED BALL
  You look around.
  You see a small green ball here.
  You see a large red ball here.
  >WHICH 5TH BALL
  You look around.
  >


I’m not sure if ‘WHICH BALL’ should be finding all balls or just the first
one? At the moment it finds all balls, which would mean that an updated ‘GET
BALL’ would get all balls. Currently the GET command would just get the first
one found. I could default to the first instance and add processing for a
qualifier of ‘ALL’? Then we would have:


  >WHICH BALL
  You look around.
  You see a small red ball here.
  >WHICH ALL BALL
  You look around.
  You see a small red ball here.
  You see a large green ball here.
  You see a small green ball here.
  You see a large red ball here.


Would people prefer this? More importantly what would make more sense to
players? I’m also wondering if I should also allow for ranges to be specified.
For example:


  >WHICH 2-3 BALL
  You look around.
  You see a large green ball here.
  You see a small green ball here.


Still early days for the new searching and matching. It seems to work quite
well. At the moment I’m not planning on adding exclusions like 'WHICH ALL BALL
EXCEPT 2ND' or 'WHICH ALL BALL EXCEPT RED'. If you have any comments,
suggestions or manage to break the new WHICH command then please drop me an
email: diddymus@wolfmud.org

So go play, have fun and if you break it let me know!

--
Diddymus


  Up to Main Index                           Up to Journal for January, 2019