Redefining redefined/predefined commands

Hi,

I’m currently struggling with a problem, probably specific to the German by Team GerX extension but perhaps I’m doing something wrong in general. To run the code with the GerX extension you need Inform 7 6/G60 as German by Team GerX has not been ported to a more recent version of Inform (if you look at the amount of work those guys did … it’s understandable)

What I’m trying to do is to redefine two commands. The GerX extension defines those as well but with a different meaning:

“leg dich hin” = sleep
“steh auf” = exit

Since I am working with body positions (position height vs. object height when the player wants to take something) I need an alternative meaning:

“leg dich in” = assume the lieing position
“steh auf” = assume the standing poition

I have - with more recent forms of Inform and without the GerX extension - never had a problem to redefine a command or action. But if I try the following (written in English to make it easier to understand ^^):

"Command Override (again)" by HtF

Include German by Team Gerx. [Requires Inform 7 6G60]


Starting room is a room.

Every person can be standing or lieing. A person usually is standing.


LieDowning is an action applying to nothing.
Understand  the command "leg [dich] hin" as something new.
Understand "leg [dich] hin" as LieDowning.

StandUpping is an action applying to nothing.
Understand the command "steh auf" as something new.
Understand "steh auf" as StandUpping.

Carry out LieDowning:
	if the player is standing:
		Say "You lie down on the floor.";
		Now the player is lieing;
	otherwise:
		Say "You're already lieing on the floor, silly!";

Carry out StandUpping:
	if the player is standing:
		Say "You're already standing, mate!";
	otherwise:
		Say "You pick yourself up from the floor and get into a more dignified position.";
		Now the player is standing;

If you run this and try “steh auf” or “leg dich hin” you’ll notice that you get the GerX responses instead of the ones I wrote:

Command Override (again)
Ein Textadventure von HtF
Release 1 / Serial number 181013 / Inform 7 build 6G60 (I6/v6.32 lib 6/12N) SD

Starting room

>leg dich hin
Du fühlst dich nicht müde.

>steh auf
Aber du bist im Moment nirgendwo drin.

What am I missing to make sure my commands are executed and not the GerX one? The only solution I have found so far is to uncomment the definitions in the extension.

I believe that “understand… as something new” only works on a single word. So you would have to do this:

Understand the command "leg" as something new.

and then rewrite all the Understand lines for “leg” that you want to keep, as well as the new one you want.

This bit of source code (from a later version of Inform) shows the general idea–I needed to get rid of one understand line for “go,” so I understood it as something new, and then the next several Understand lines are the ones I wanted to keep from the standard rules.

Hope this is helpful!

Ah - thanks, that does help. Alas, it removes all the other commands from the German extensions regarding those commands as well. :frowning:

In that case messing with the extension is actually more beneficial if there really isn’t a way to just undo ONE of the defined command versions.

Yes, if you do that you have to copy all the Understand statements you want back from the standard extension. Replacing the relevant section or editing the extension may be no more effort.

Yeah - I decided to comment out the two “offending” command versions in the extension - this way I keep all the other, non-problematic permutations like lie down on, like down upon, lie down with … etc. Less work than to disable “lie” and “stand” globally and remember to put in the other 15+ variations that are not causing me problems.

It’s a shame I cannot simply “undo” the two “offending” commands but it’s not that much work to comment them out in the extension.