stoonboii10 / garglk

Automatically exported from code.google.com/p/garglk
Other
0 stars 0 forks source link

SCARE: Commands abbreviated twice #180

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Commands like "examine", "look", "inventory", "wait" etc are abbreviated both 
in SCARE itself and in the code that connects SCARE to Glk. The result can be 
seen in the following transcript:

---

> z
[z -> wait]
Time passes...

> 'z
Time passes...

> glk abbreviations off

Glk abbreviation expansions are now off.

> z
Time passes...

---
The abbreviation handling from os_glk.c has the highest priority and it prints 
a message when it expands an abbreviation: [z -> wait]. This abbreviation 
handling can be bypassed by starting the input with a quote or can be turned 
off via a setting.

The abbreviation handilng from scrunner.c treats the one-letter command as an 
equal version of the longer command. For example "i", "inv" and "inventory" are 
treated equally. There is no expansion step and there is no way to turn it off.

I think that having two mechanisms for accepting short commands is unnecessary. 
It can also be confusing: for example in the transcript abbreviations are 
turned off but the short version is still accepted. And in some games the short 
versions of commands can conflict with custom commands from the game, having 
the ability to bypass abbreviations is useful then.

One way to address this would be to remove the Glk abbreviations. The advantage 
of this option is that it doesn't require any changes in SCARE.

Another way to address this would be to remove the short aliases from SCARE. 
The advantage of this option is that the user would gain the ability to bypass 
or turn off abbreviations.

I'm willing to write a patch for this, but I'd first like to hear the 
maintainer's opinion on which approach is preferred.

Original issue reported on code.google.com by mthuu...@gmail.com on 7 Feb 2012 at 10:16

GoogleCodeExporter commented 8 years ago
I don't have a strong opinion on this. It's fairly easy to extend the default 
garglk.ini to disable the Glk abbreviations by default:

# Adrift game types
[ *.taf ]
terp scare -na

This doesn't address the advantage of removing the aliases at the SCARE level, 
though. How common are the conflicts between the short commands and custom game 
commands?

Original comment by bcressey@gmail.com on 14 Jun 2012 at 8:28

GoogleCodeExporter commented 8 years ago
Not very common, but I did encounter a problem with one game that required a 
phrase starting with "I " to be entered and that triggered the inventory 
instead, so it is not just a theoretical problem.

From the user's perspective, I think it would be best to disable the 
abbreviations in SCARE, since the abbreviation handling at the Glk level is 
superior (visible expansion, bypass and enable/disable).

It seems that SCARE still has active upstream development, so from a 
maintainer's perspective I can imagine it's easier to minimize changes to the 
interpreter.

Would it be an option to add a #define for disabling the SCARE abbreviations at 
compile time and commit that patch for garglk as well as offering the patch to 
the upstream project?

Original comment by mthuu...@gmail.com on 14 Jun 2012 at 9:57

GoogleCodeExporter commented 8 years ago
Yes, the #define option sounds like the best approach.

Original comment by bcressey@gmail.com on 14 Jun 2012 at 11:28