intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Jan 19, 2019 7:05 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Jan 06, 2019 1:11 am 
Offline

Joined: Fri Dec 29, 2017 2:13 pm
Posts: 6
I'm trying to use Inform 7 for a choice based game and I'm using parser parer (basically a list of "Understand nothing as" statements) to eliminate all existing commands. I'd like to be able to use letter shortcuts but I can't seem to make e.g. "e" refer to anything other than going east. I already have "understand nothing as going." from parser parer and have added "Does the player mean going: it is very unlikely." and "does the player mean doing something to a direction: it is very unlikely."

But if I try to make a thing called "choice e" or whatever then going east will always take precedence if I use it bare with something like "understand "[any choice]" as choosing. If I make "e" an actual command (like "taking fifth choice is an action applying to nothing. Understand "e" as taking fifth choice.) it works but that's very restrictive and clunky solution.

Am I missing something obvious? Is this some deep i6 level hardcoding that's outside the normal understand system? Is there something in the standard rules that I can can delist? Is this a bug I can report? Am I doomed beyond all mortal help?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Jan 06, 2019 2:21 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 404
There are two things going on here. One is that any command consisting of a direction (with no verb) is interpreted by the parser as "go". There's not much you can do about that, as it's hard-coded in the parser.

The other thing is that the standard directions have their usual abbreviations, "e" for east and so on. This is fairly easy to override --- you can just replace the section of the Standard Rules in which those abbreviations are defined.

Create a section in your code called something like
Code:
Section - Directions (in place of Section SR1/4 - Directions in Standard Rules by Graham Nelson)

Then go into the Standard Rules, and copy and paste Section SR1/4 (without its section heading) as your new section. Now you can edit it to get rid of the abbreviations.

Of course, this will have the effect that the player can never use "e" to refer to east. But if you're 100% choice-based that won't matter. If you were planning a mixed-mode choice/parser interface, you might be able to use conditional understand statements to allow direction abbreviations just when you wanted them.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Jan 06, 2019 4:03 am 
Offline

Joined: Fri Dec 29, 2017 2:13 pm
Posts: 6
Thanks, that worked! I went ahead and made all the directions privately-named too while I was at it. I think that will make them fully inaccessible now, hopefully without breaking anything.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Jan 06, 2019 11:53 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
There should be a better way to drop the parser entirely and just get a line of input. ("Does the player consent" does this, in a specialized way.)

Possibly what you want is an "After reading a command" rule which always rejects. Or which always replaces the player's command with a controlled snippet like "CHOICE 5".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Jan 06, 2019 12:42 pm 
Offline

Joined: Fri Dec 29, 2017 2:13 pm
Posts: 6
I don't want to eliminate the parser completely though. I'm just trying to turn off all previous verbs so I can make new ones for a different interface. "Choice e" was kind of a toy example for why I might need to repurpose single letters. I also don't want to destroy all the testing commands.

Regardless, overriding the standard rules and making directions private-named seems to work, so I think I'm just going to go with that. Thanks for the suggestion though.


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: Google [Bot] and 15 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