Following up on this with a question, to make sure that I’m not sending you on any unnecessary detours…
Are you able to use accusative and dative to refer to the same object in your source code? Since you don’t mention any problems with this, I’m assuming that there is no problem with this aspect. If you are able to refer to a single object using both dative and accusative forms, then it suggests to me that you are correctly using Preform to tell the compiler how to interpret your source code.
I am 100% positive (OK, 99.99%) that nothing you do in Preform would be able to make a game parser automatically understand the accusative and dative forms. The parsing algorithm gets what it needs to match user input to game objects from a combination of a .name
property and/or a .parse_name()
method for each object. This is why I’m saying that the only way Preform could affect parsing would be if it’s affecting automatic plural name generation – the compiler does append plural versions of words to the .name
property of the relevant objects, and it seems reasonable (though I don’t know for sure) that Preform governs the translation from singular to plural.
(I guess there might be a feature to automatically apply additional forms to the .name
property, but if so I’ve never heard of it. Might be worth a feature request, if it doesn’t exist.)
Part of the problem is that the game parser sees words at an atomic level; it doesn’t understand word pieces like suffixes or individual letters. (Though it can be told to compare a text property to a command word letter-by-letter.) The good news is that none of that really matters if all you want is for the game to understand the accusative form – you just need to tell it which words apply to which object. The bad news is that it’s a completely separate project using a totally different set of knowledge to modify the kit code, language definition and Standard Rules so that the game being generated can be played in Greek.
I don’t know Greek, and English doesn’t do noun cases that way, but I’ll try to explain as best as I can. Suppose your source code includes an object declaration:
A thingX is a thing. [supposed to be equivalent to your "Ο όλμος"]
Unless I’m misunderstanding, the “Ο” is an indefinite article and “όλμος” is the nominative case for the noun.
When the game is generated, an I6 object declaration similar to the following is created (this was generated by 9.3/6M62, but the same ideas apply to 10+):
Object I136_thingx ""
class K2_thing
with name 'thingx' 'things//p' ! the .name property: note that only the object name and a plural for the kind are included
...
;
Where it says 'thingx'
, that’s not a string, that’s a dictionary word, an atomic piece of text for parsing commands. (You’ll have to read about the Z-machine and Glulx virtual machines to understand more about this.)
If you add to your source the following:
Understand "thingX-a" as thingX. [simulating an accusative form with -a suffix]
then the I6 declaration will change:
Object I136_thingx ""
class K2_thing
with name 'thingx' 'things//p' 'thingx-a' ! the accusative form has been added to the .name property of the object
with parse_name Parse_Name_GV96 ! a .parse_name() method has been attached, but it doesn't do anything of interest
...
;
The parser will now allow either the accusative or nominative word to apply to the object:
>GET THINGX-A
Taken.
>DROP THINGX
Dropped.
>GET THINGX
Taken.
>PUT THINGX-A IN BUCKET
You put the thingX into the bucket.
The last command shows a potential problem. If I’m understanding correctly, you would ideally want the equivalent of You put the thingX-a into the bucket.
as output. This is possible, but it would take new code written by you in your source. I don’t think you can leverage Preform at all, though obviously that would be powerful, and it certainly seems like something that could be implemented within the compiler in theory.
In the short run, if you’re interested in writing a game in which the language of play (as opposed to the language of source) is Greek, you can probably set up a system along the lines of:
pretending English is more like Greek
A thing has some text called accusative form.
A thing has some text called dative form.
[These are handy but make your game slower. They make the compiler generate a complicated I6 .parse_name() method that does letter-by-letter comparison.]
Understand the accusative form property as describing a thing.
Understand the dative form property as describing a thing.
A grammatical case is dative. [The grammatical case kind of value is already defined in English with two values: nominative and accusative.]
Current noun case is initially nominative.
Printing a noun case is an activity.
After printing a noun case:
now current noun case is nominative.
To say (T - thing) in (C - grammatical case) :
now current noun case is C;
begin the printing a noun case activity;
say T;
end the printing a noun case activity.
To say the (T - thing) in (C - grammatical case) :
now current noun case is C;
begin the printing a noun case activity;
say the T;
end the printing a noun case activity.
To say a (T - thing) in (C - grammatical case) :
now current noun case is C;
begin the printing a noun case activity;
say a T;
end the printing a noun case activity.
For printing the name of something (called T) when current noun case is accusative:
if T provides the property accusative form:
unless the accusative form of T is empty:
say accusative form of T;
stop;
say printed name of T.
For printing the name of something (called T) when current noun case is dative:
if T provides the property dative form:
unless the dative form of T is empty:
say dative form of T;
stop;
say printed name of T.
[minimal demonstration scenario follows]
Place is a room.
[Declarations like this will allow X, X-a and X-d to refer to an object; the game parser won't care about correct usage.]
A tray is a supporter with accusative form "tray-a" and dative form "tray-d". It is here.
A bucket is a container with accusative form "bucket-a" and dative form "bucket-d". It is here.
A thingX is a thing with accusative form "thingX-a" and dative form "thingX-d". It is in the bucket.
[the default object name corresponds to the nominative case; does that work for you?]
When play begins:
say "Nom: [thingX in nominative].";
say "Acc: [thingX in accusative].";
say "Dat: [thingX in dative].";
[You'll be translating all of these, anyway.]
The standard report inserting rule response (A) is "[The actor] [put] [the noun in accusative] into [the second noun in dative]."
The standard report putting rule response (A) is "[The actor] [put] [the noun in accusative] onto [the second noun in dative]."
Sample output:
Place
You can see a tray and a bucket (in which is a thingX) here.
>GET BUCKET-A [parser understands accusative form in command but is not actually checking for proper grammar]
Taken.
>PUT IT ON TRAY
You put the bucket-a onto the tray-d. [note accusative form for bucket in output]
>GET THINGX
Taken.
>PUT IT ON TRAY [parser doesn't care that player says TRAY instead of TRAY-D]
You put the thingX-a onto the tray-d. [... but does use the correct form in the response]
>PUT IT IN BUCKET
(first taking the thingX) [maybe this should be accusative? there are other responses to modify]
You put the thingX-a into the bucket-d. [note dative form for bucket]