"Late binding" of understand ... can't phrase it any better

Hi again,

If an understand rule follows a definition things are easy:

Sylke is a woman.
Understand “girl” as Sylke.

Now - I have a bit of a random “population” and when the game starts only one out of a number of possible girls is actually being put into the room. So I need to create the synonym “girl” for that particular person since she’s the one happening to be around. It’s what a programmer would probably call “late binding”.

If I put that “Understand” in the “when play begins” section once the proper girl has been selected the “Understand” rule causes a compiler error. Is there a way to create and change synonyms on the fly?

(Not quite responsive to your question, but this is what you want.)

Something to consider for other cases - I made a note of it. Quite clever, actually but it’s not what I am looking for in this case … the problem when trying to be brief.

Let us assume you can have multiple women in a room - so “girl” would become unspecific which is a minor problem.

Let us assume in addition that I want to offer the player some kind of typing comfort - there are roles that develop over time and are assigned randomly. After a certain point in the investigation the player understands someone might have done a crime - that lady shall from that time on also be addressable as “suspect” - another lady might be discovered to be a witness and shall be made possible to be referred to as “witness”. That’s why I was asking about late bindings.

Now I could still use your example and prod for women’s properties and if I have a known suspect I could then use “try talking to THE CONCRETE LADY instead” which should trigger the correct dialog for the suspect or witness but I’d rather avoid it if

 (a) there is another and better way than to nest that into multiple checks within a "being asked about something" action and 
 (b) as my previous post shows I am still unable to access generic parts or properties to change them

You could always make it a value.

A suspect status is a kind of value. The suspect statuses are non-suspect and suspect.

A person has a suspect status.

Understand the suspect status property as describing a person.

Then you can declare “now The Concrete Lady is the suspect”, and by typing “x suspect” you will examine The Concrete Lady.

You have a few options here.

You can attach conditions to Understand rules.

Understand "suspect" as a person when the item described is carrying the bloody knife.

(“Item described” is a somewhat poorly documented value that more or less means “whatever this rule is currently being applied to.”)

You can also define a new adjective and refer to the adjective in your Understand rule.

[code]Definition: a person is suspicious if it is carrying the bloody knife.

Understand “suspect” as a suspicious person.[/code]

You can also create a value or an either/or property, and reference that in your Understand rule, as itsgallus pointed out.

[code]A person can be suspicious or beyond reproach. A person is usually suspicious.

Understand “suspect” as a suspicious person.[/code]

In all of these cases, you are not really “late binding” anything. An understand rule does not “bind” synonyms to things in the way I think you are trying to describe here – it just describes a condition under which the synonym will successfully refer to an object. The standard syntax, Understand “girl” as Sylke, implies the condition, “all the time”.

That’s also the reason why you can’t put an Understand rule into the “when play begins” rulebook – an Understand rule is not a statement that executes during runtime.

Yay - thanks for the help. Sometimes it helps to stop writing and read - in this case I went trough Jim Aikins Handbook and discovered a conditional understand that would be predefined but evealuated and changed at runtime - not quite as I wanted to do it “ad hoc” but “as things progress this rule now applies”.

Your suggestions go farther than what I managed to get from Jim’s book and I’m quite happy for the flexibility your suggestions offer.


That’s why I tried to cheat with “Now” - epic fail ^^

From a programmatic perspective, an “understand” line is fundamentally a function, not a value. And I7 doesn’t allow functions to be altered at run-time. (I6 does, to the same extent as e.g. C: you can have function pointer variables, and point them to different functions, but the functions themselves are constants. I7 kind of also does this, since you can have rule variables, but they’re not as often useful as one might expect.)

In particular, understand lines turn into what I6 calls “parse_name”, a method on an object that’s called to determine whether a certain substring of the player’s input applies to that object or not. A line like “Understand ‘red’ as the tomato when the item described is ripe” puts a line in the parse_name method like (pseudocode) “if(substr == ‘red’ && self.ripe) return true;”. In other words, the condition is part of the understand line, and is compiled into it.

If you really want late binding, you can give the object a text property, and “Understand the whatever property as describing a woman”. This puts a line into the parse_name like “if(substr == self.whatever) return true;”. Now you can assign that property, and whatever you put in there will be understood.