but i can’t seem to figure out what to put after the ‘look’. i’ve tried every combo of i.e. ‘look up’ ‘look upDir’ ‘look upDirection’. but instead the parser redirects to “look us” and describes the player.
if i instead try this with north, south, etc. instead of ‘up’ i simply get a “you see no north/south here”.
Hum. I had thought LookDir was included in Lite, but maybe not. You’ll probably have to create a new Action/verb… if you’re making a whole game you may as well get used to the idea! I’m assuming you’ve covered creating Actions in the learning docs?
yes, i’ve created new actions but didn’t think i’d need to in this case since the parser clearly responds to “look direction”, according to the manual i should be able to ‘modify’ this,
typically in I6 or dialogue i would go poke around in the grammar and see how the library handles a given verb/action then hook into there. the manual explicitly mentions doing this as well but where does TADS put this? i can pull up the reference manual and click on an action, but this doesn’t give me any useful information re: how the grammer is defined.
some things are defined in tads3/lib/adv3/actions.t and in the same place under adv3lite. but most aren’t here and most of what is here here seems to just be stubs.
The grammars for the actions are found in grammar.t. However, I didn’t notice a grammar for responding to e.g. ‘look south’. I’m not the Adv3Lite guru around here In adv3 it would be defined as 'look' singleDir, which I use in my game (although only to let players know it’s not needed).
Are you sure it responds to all directions and not just ‘look up’ (which refers to consulting a reference)?
Edit: I just tried ‘look south’ in a skeletal Lite game project, and the parser didn’t recognize it. I think you need to define your own verb? It appears that Lite uses singleDir as well.
VerbRule(LookDir)
('look' | 'l') singleDir
: VerbProduction
action = LookDir
verbPhrase = 'look/looking (where)'
;
LookDir:Action
baseActionClass = LookDir
execAction(cmd)
{
direction = cmd.verbProd.dirMatch.dir;
"{I} look{s/ed} <<direction.name>> ";
/* You'd need to add your own code here to do something
more interesting. */
}
direction = nil
;
well, there’s an actual, albeit unpublished, working code (with heavy spoilers cut out):
There’s a balcony with a panorama on three sides, and the wall on the fourth, and our player can admire the panorama and the sky above:
PadSky: Distant 'sky; alien strange; up u sky firmament' @pad
"SPOILER on Raileian sky ;)"
;
[cut out the details of the sky; anyway, isn't many as a certain portrait...]
padN: Distant 'north;; north n northward' @pad
"[Spoilers for the N sight]"
[cut out the definitions of the details of the N panorama]
;
and so on; the simple trick is actually a nice adv3Lite feature, namely that a distant can have as parser name a direction, and there the disambiguations correctly prioritize an item than a direction when parsing the various N/S/E etc.
HTH and
Best regards from Italy,
dott. Piergiorgio.
The good thing about this solution is that it isn’t as kludgey as the prior one, making it easier to change the response if you’re not in the mood to create a hundred doers or Before/AfterAction methods just to cover something rather simple like >Look [direction].