Which parser?

This is a very helpful upgrade, and also an entertainingly confusing sentence out of context!

6 Likes

Yeah, reflex from writing complex anatomical assemblies!

a nose is a kind of thing.
one nose is part of every man. 
one nose is part of every woman.
your nose is a nose. your nose is part of the player.
understand "my nose" as your nose.
6 Likes

you cannot get nose or take nose but you can pick nose

(Sorry, I couldn’t resist. Quite clearly, my Inform 7 coding skills are zilch.)

9 Likes

I’d be lying if I said I wasn’t very curious to see how it should be done in TADS… Maybe I just got horribly lost in the weeds but I hit a wall when I was trying to work on an inMouth precond… But don’t stress yourself! It’s not so much that I need ‘spit’ to make the game work (although I do want it), but I do need to play around with verbs and ‘spit’ just happened to be the one I landed on with a novel precondition.

Also I am now seeing another advantage of Inform: it’s much funnier out of context. Your mouth is part of the player. Your mouth is transparent. Understand that your mouth is my mouth. I didn’t know there’d be so much body horror…

4 Likes

I spent several miserable hours over multiple days futzing around with plural, first-person pronouns for a protagonist.

The two main problems, so far as I can tell, were that 1) I had no idea what I was doing and 2) I wasn’t sure what I wanted to say! The readability of I7 was good for some laughs, at least. So far as readability goes, there was an Inform 7 poetry account on Twitter… still might be, I’m not there anymore. I thought it was a great idea in any case.

3 Likes

@MiloM See? The Inform Action Squad will help with coding issues in minutes. It’s the best selling point for Inform.

6 Likes

And you’re right about old forum resources (although I found quite a few things for TADS as well, still working after 10 years). Used topics by both you and @kamineko while trying to get it working yesterday (although neither fully solved either problem: my ‘release along with interpreter’ for my test game produces a file that just gives me the parchment loading symbol forever (running the gblorb through iplayif.com works, but not exactly what I wanted); and I’m disappointed by the lack of image scaling/scroll bars in several interpreters for large images (not a problem I was finding with the TADS interpreter)).

2 Likes

This was the simplest way to give every player and NPC a body part and make sure the parser named them all correctly, which is one of the good things about I7 - if you work with it, it works with you!

3 Likes

If you’re willing to use I7 version 6M62 (which is probably still used by the majority of people), you can include Emily Short’s “Simple Graphical Window” extension to get scaled images.

2 Likes

It does make sense!

But now I’ve found a new problem. I’m finding the Inform documentation really hard to navigate, so I’m sure all the information is in there but I just can’t find it.

At the moment when I swallow something (i.e. ‘the art’) it returns:

(first taking the art)
You put the art into your mouth.

But I want it to say something else. I want to write something like:

When inserting the art into the mouth, say "Something new!" instead of "You put the art into your mouth."

But of course that’s not working. I’ve found how to completely change the behaviour of ‘insert into’, but I don’t want to do that, I just want to change the descriptor text for what happens when I do it with a particular noun.

(I’ve found how to add my “Something new!” description as well as “You put [the noun] into your mouth.” but I can’t find out to do it instead of it.)

I found you saying this on a thread I found yesterday :slight_smile: What would I be losing if I used v.6M62 instead? (I know I’m currently using v.10.something…)

After inserting a sweet thing into your mouth: say "Mm! Delicious!".
Report eating the gooey caramel: say "Now your hands are sticky.".

After overrides all report messages; Report will add that message to other standard reporting.

4 Likes

I’m also a fan of completely defining new behavior with:

Instead of inserting a sweet thing into your mouth:
    say "How delectable.";
    now the noun is nowhere;

(You have to include the second line because ‘instead’ completely gets rid of usual behavior’. Or you could do ‘now the noun is in your mouth’).

Sometimes Inform has weird rules printing things or blocking things, so you can ninja your way even earlier into the action with ‘before’:

Before inserting a sweet thing into your mouth:
   say "Hmmm, scrumptious.";
   now the noun is in your mouth instead;

If you don’t type ‘instead’, it just prints the hmm scrumptious line and keeps going. Adding ‘instead’ completely stops everything else.

In general, you use ‘Before, instead, after’ to change what happens before you do something, during it, or after; when making your own actions, you type Check, Carry out, and Report, which do the same things but are ‘weaker’, and can be overriden later in special cases by before, instead, and after.

3 Likes

Easiest way to do that is with a new report rule, and then telling Inform not to run any others by stopping the action:


report inserting something into your mouth:
	say "You lick [the noun] to give it a good coating of saliva, then wriggle it past your lips.";
	stop the action.

The docs are long and not really worth reading in full before diving in IMO, but the bits about rules and rule books are worth an early read through.

Another helpful tip is that you can type RULES when testing your game, which will show you which rules are firing and outputting text. Doing that, you’d see that it’s the “standard report inserting rule” that you don’t want, so you could knock it out like so if you didn’t want to use the “stop the action” approach:

the standard report inserting rule does nothing when the second noun is the mouth.

EDIT: lots of good ideas from others! On reflection I think the After approach is better than doing a report and stop the action; I’m just leery of after rules since I often forget they preempt the report rules so it’s easier for me to do things manually!

2 Likes

Maybe not “weaker” but “subject to standard parsing and being overridden and affected by other important rules as you’d expect” - if you’re using INSTEAD, parser goes hands-off and lets the author drive the world model for a moment.

INSTEAD is like an executive order from the author. You want to use it when you’re not interested in anything else that could possibly happen.

Instead of doing anything to the nuclear reactor: say "You know better. You've seen all those movies."

Most new authors try to use INSTEAD as a monkey-wrench for everything and get in trouble:

Instead of taking the shiny rock:
    say "Wow it's pretty!";
    increase the score by 1;
    now the player carries the rock.

Cool and works, but since you’ve veto’d all other rules in the game, the player can take the rock even if it starts inside a locked transparent container, and can take it multiple times because the parser isn’t allowed to run all the accessibility and “does the player already have this thing?” rules.

4 Likes

Oh god dammit, I tried ‘before’ and ‘while’ (is while even a rule? I don’t think it’s even a rule…) and a few things with insteads, but just assumed ‘after’ wouldn’t work (you know, because it comes after the other stuff). Thanks!

I think fiddling with TADS yesterday scared me a little because there was so much going on under the hood that the idea of completely rewriting a rule was very intimidating. I had assumed that there was more going on with ‘insert into’ than “now the noun is in your mouth” so I hadn’t wanted to touch it.

Oh that’s a very useful way of thinking about it. I hadn’t mentally connected before with check, instead with carry out and after with report. I guess it comes back to not reallising that I could change reports with ‘after’, because I hadn’t got that order of operations in my head (thought ‘after’ would be too late to change a ‘report’, but makes sense now that I think about the natural language meaning of the words).

Okay that’s incredibly useful, both the reading advice and the RULES tip.

Yeah, I’ve already found it’s power. A little too much power methinks…

It seems you are pre-empting me faster than I can write! I think this kind of thing is also why I’m afraid of defining new behaviour.

2 Likes

It’s better to learn and use CHECK/CARRY OUT/REPORT for new actions like all actions do, so they’ll play nicely with each other. It takes a bit to grok.

My initial stumbling block with Inform 7 was “how does it know what order to run all the rules in?” - me not understanding that the compile process sorts all your rules into rulebooks regardless of source-text order and the parser knows to run rulebooks in the correct order.

2 Likes

The new version was mainly about big internal changes, rewriting and restructuring lots of the code-base, but it did not lead to many changes for game authors, regarding new syntax or big new features or functionality. One could say the changes are laying the groundwork for new functionality in the future.

There have been quite a lot of bugfixes, but then again, many many games have been produced in 6M62 without running into those bugs.

So, if it’s for a short project now, and you’d like to have the scaled graphics, I think I’d recommend using the older version for the moment. When you switch to the new version later, you’ll be able to transfer practically all of your knowledge and code seamlessly. (Except for some extensions which might have stopped working and haven’t been updated.)

But other people might have other perspectives; I haven’t delved as deeply into the new version as @Zed has, for example.

1 Like

Oh, Lordy. Because I didn’t read and grok the rule books stuff until I was a reasonable way into building my first game, the only thing I really understood was that if there are multiples of the same kind of rule that apply, the one with more conditions wins - which makes sense, you’d want to go from the specific to the general. But then when I had a bunch of Every Turn rules where the order mattered, I started stacking nonsense conditions that would always be true (“if the player is in the location / the horse is in the stable”) just to manipulate the order!

This was, uh, not my finest hour.

2 Likes

I also ran into trouble with the fact that “Every Turn” rules kind of all need to be in one rule because they only have one chance to run, and if you write multiple “Every Turn” rules they’ll override each other since only the first one runs (or the most specific one runs,) first being the last one in source text order since the compiler reads your text and throws everything onto a stack of them and then it’ll still pick one that’s more specific to use as THE Every Turn rule.

(Don’t let this put you off Inform 7, it all does make sense in context!)

2 Likes