intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Nov 19, 2018 3:56 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Oct 13, 2018 12:35 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 54
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 ^^):

Code:
"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:

Code:
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.


Last edited by Harald Schuster on Sat Oct 13, 2018 4:01 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Oct 13, 2018 2:22 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5405
Location: Burlington, VT
I believe that "understand... as something new" only works on a single word. So you would have to do this:

Code:
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!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Oct 13, 2018 2:49 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 54
matt w wrote:
I believe that "understand... as something new" only works on a single word. So you would have to do this:

Code:
Understand the command "leg" as something new.




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

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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 16, 2018 5:00 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5405
Location: Burlington, VT
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 17, 2018 3:52 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 54
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.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: zarf and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group