intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Nov 16, 2018 9:55 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Nov 07, 2018 8:30 pm 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
Hey there,

I'm brand new to inform, working on my first game. I've got some questions if you experts wouldn't mind indulging me. Sorry for the long post, but I saved them up so I didn't flood the forum.

Question: Does this forum or the Inform community in general have a Discord?

I'm in the Narrative Games discord but they don't have an Inform channel and I feel awkward asking Inform questions. Also it's pretty quiet in there most of the time. It would be cool to hang out around people that are making IF and talking about it.



Question: Can I be more efficient with some of my declarations?

Just for example, I have some Instead rules laid out like so:

Code:
Instead of going to the Triangle Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";

Instead of going to the Circular Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";

Instead of going to the Square Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";


This works fine, but instinctively I want to write something more along the lines of:

Code:
Instead of going to either the Triangle Hole, the Circular Hole, or the Square Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";

This doesn't work.

I tried the extension Alternatives by Eric Eve, but I couldn't find a single scenario where I wanted to simplify what I had written into this format where it actually worked. I just feel like I am writing lots of inefficient little rules like this and I'm worried it's because I don't understand that there's a better way to do it.



Question: What am I doing wrong here?

Code:
Rule for printing the description of a dark room (called the dark place) when the dark place is in the Waterway:
   if the dark place is Canal3:
      say "The waterway is dark. A faint glow of light emanates in the distance from a passage in the north wall." instead;
   say "The waterway is dark.";


My idea here is that I have a number of rooms representing a canal. If it is dark, "The waterway is dark." unless you are in Canal3, in which case the description mentions a lit passage to the north. The error message that kicks back here is:

Quote:
You wrote 'Rule for printing the description of a dark room (called the dark place) when the dark place is in the Waterway' , but the description of the thing(s) to which the rule applies ('(called the dark place)') did not make sense. This is nothing based rulebook, so that should have described nothing.


I've also tried:

Code:
Rule for printing the description of a dark room when the room is in the Waterway:


and:

Code:
Rule for printing the description of a dark room when it is in the Waterway:




Question: In the Simple Chat extension by Mark Tilford, can you set a chat node to sc-inactive and sc-once at the same time?

I'm guessing not many people will know the answer to this, but when I tried it, it kicked back an error. I just wanted to set a chat node that was inactive by default, but once activated could only be used once.



Question: Is there a way to do exceptions?

For example:

Code:
The sun is a view. It is everywhere. EXCEPT X, Y, and Z.


It makes more sense to me to list exceptions to a rule when there are only one or two, rather than making a long list of places where it is. This isn't a huge problem when you are creating a view or something like this but becomes a problem when you want to list a rule like:

"Instead of doing anything other than:"

Where you want to prevent the player from doing anything other than maybe two or three approved actions for a specific time. For example:

Code:
Instead of doing anything other than waiting during jackScene1:
   say "Hey, I didn't say you could do that."


But I don't want the player to only be able to wait. I would like the player to be able to look, wait, and push Jack off a cliff. All other functionality should fall under the "Instead of doing anything:" rule, but I can't for the life of me figure out how to get any exceptions in there.



Question: What am I doing wrong here?

Code:
Understand "ask [someone] about [any seen thing]" as interrogating it about. Interrogating it about is an action applying to two visible things.

Understand the commands "show" and "display" and "present" as something new.

Understand "show [something] to [someone]" or "display [something] to [someone]" or "present [something] to [someone]" as interrogating it about (with nouns reversed).
Understand "show [someone] [something]" as interrogating it about.

Carry out interrogating someone about something:
   say "'Sorry. I don[']t know anything about that.'";

Instead of interrogating Jack about an item listed in the Table of Jack Items:
   say "[reply entry][paragraph break]".

Table of Jack Items
item   reply
"painted key"   "Jack thinks it over. 'You said you pulled it out of a painting?'"


I pretty much ripped this word for word out of an example in the documentation and I can't get it to compile.

Quote:
You wrote 'Instead of interrogating Jack about an item listed in the Table of Jack Items' , which seems to introduce a rule taking effect only if the action is 'interrogating Jack about an item listed in the Table of Jack Items'. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.


The example that I pulled it from is 297: Nameless.



Question: What am I doing wrong with my Glimmr include?

I was hoping to test out the Glimmr Automap extension. According to the documentation it says I just need to include Glimmr Automap and Glimmr Automap Tileset. When I do that, it kicks back the error:

Quote:
It looks as if 'Table of Common Color Values (continued)' is meant to be related to an existing table, but I can't find one if it is.


I can't really figure out what this is referring to.

I do have another extension, Glulx Text Effects which also references a Table of Common Color Values (continued), but that one compiles fine with no issues. Is there some kind of clash?



Phew, that's a lot of questions. Sorry to drop a big one on ya, but like I said, I didn't want to make a bunch of posts with all these nagging little things that I've been stumbling over. Any help is appreciated, even if it's just pointing me in the right direction for something.

Thanks a bunch.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 07, 2018 10:41 pm 
Online

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5397
Location: Burlington, VT
Welcome to the forum! I don't know of any Inform Discord but we're usually happy to answer questions here.

Code:
Instead of going to either the Triangle Hole, the Circular Hole, or the Square Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";


Usually with things like this, the way to do it is to write things out in full:

Code:
Instead of going to the Triangle Hole by cog boat, or going to Circular Hole by cog boat or going to the Square Hole by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";


or you could simplify this by exploiting the fact that "by cog boat" is an abbreviation for an action variable called "the vehicle gone by":

Code:
Instead of going to the Triangle Hole or going to the Circular Hole or going to the Square Hole when the vehicle gone by is the cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";


BUT the simplest way to do this may be to define a new property that wraps all these up:

Code:
Definition: a room is canal bank if it is the Triangle Hole or it is the Circular Hole or it is the Square Hole.

Instead of going to a canal bank room by cog boat:
   say "There's no way you could haul the boat out of the canal. You'll have to get out.";


(Warning: I haven't tested any of these, so they could all be wrong.)

A warning: if you got Alternatives from the Inform7.com site, those extensions tend to be for older versions of Inform, so they might not work. Anyway, you can usually do what you need just by writing everything out. Remember, Inform isn't really English and it can't fill in a lot of stuff we automatically fill in when we write it. (Also, the word "either" doesn't do anything in Inform, I think.)


--Printing the description of a dark room. This is a bit messed up.

The thing is that the phrase "rule for printing the description of dark room" is actually about an activity called "printing the description of a dark room" and doesn't break out the dark room as a separate thing! This is unusual--usually activities like this are called something like "printing the name of something" and then if you say "printing the name of a dark room," the dark room would be an argument of the activity, and you could say "(called the dark place)" as you did. But in the specific case of printing the description of a dark room, that won't work. There's more discussion of that here.

OK, so here's what you can do:

Code:
Rule for printing the description of a dark room when the location is in the Waterway:


"The location" is the location of the player, that is, the room they're in. So that should work. (This is like what you're trying to do with "the room," but again, when you say that Inform doesn't understand which room you mean.)

--
"Instead of doing anything other than:"

Try a kind of action.

Code:
Looking is jack action. Waiting is jack action. Pushing Jack off a cliff is jack action. [assuming you've defined pushing jack off a cliff as an appropriate action]

Instead of doing anything other than Jack action during jackscene1: say "Hey, I didn't say you could do that."


(WARNING: this might be interpreted as "anything other than (Jack action during jackscene1)". If that happens sometimes you can clear it up by explicitly putting in parentheses: "Instead of doing (anything other than Jack action) during jackscene1:")

--Question: What am I doing wrong here?

The interrogation action is defined as applying to two things, but you're trying to apply it to a table column that contains quoted topics rather than things. If the painted key is an object in your game world, take the quotation marks off it in your table. If "painted key" is just supposed to be a text, use the built-in asking it about action, which applies to one thing and one topic, as in the Nameless example:

Code:
Instead of asking Nameless Advisor about a topic listed in the Table of Nameless Advisor Topics: 
    say "[reply entry][paragraph break]".


--Glimmr

I think most of the Glimmr extensions that you might officially find are for older versions of Inform--6G60, specifically. The main Glimmr dev basically stopped working on it before the next Inform update, which changed a lot of things. (In particular, I think that the formatting of the Table of Common Color Values got changed--that may be a table that's in Glulx Text Effects, which did get updated--that leads to the kind of error you got.)

The latest I know of Glimmr is here--some of the extensions are getting updated for use in Kerkerkruip and can be found at Kerkerkruip's Github page. But it might not be easy to get versions that work with the latest Inform.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 08, 2018 7:42 am 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
Thanks so much for the comprehensive reply.

Code:
Definition: a room is canal bank if it is either the Triangle Hole or the Circular Hole or the Square Hole.


This works perfectly with Alternatives. I think it seems to work well with IF statements, but not with INSTEAD...WHEN... statements. (I think "either" is a part of the extension that adds the word "or")

I was sketchy on how Definitions worked, so this helps clear that up a bit as well.

--The dark room thing:

Code:
Rule for printing the description of a dark room when the location is in the Waterway:


This actually kicks back a different error:

Quote:
You wrote 'Rule for printing the name of a dark room when the location is in the Waterway' : but I don't understand the 'when/while' clause, which should name activities or conditions.


Just to clarify, the waterway is a region that contains the rooms of the canal.

--Instead of doing anything other than:

Code:
Instead of doing anything other than Jack action during jackscene1: say "Hey, I didn't say you could do that."


This works! Thank you. I did not know you could do this.

--Interrogating

It was the quotes. That fixed it! Thank you.

--Glimmr

Thanks for the link, I will try these out to see if they work any different.

Cheers for your help overall.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 08, 2018 8:48 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2747
Location: US - Central
Don't know if this will work, but you might try:

Code:
Rule for printing the name of a room when the location is in the Waterway and the location is dark.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 08, 2018 10:22 am 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
Oh man, I have to apologise.

Code:
Rule for printing the description of a dark room when the location is in the Waterway:


...did work, but I had a typo in my initial declaration of the region which is why it didn't understand it. Sorry!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Nov 08, 2018 4:19 pm 
Online

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5397
Location: Burlington, VT
HanonO wrote:
Don't know if this will work, but you might try:

Code:
Rule for printing the name of a room when the location is in the Waterway and the location is dark.


So this is moot, see above, but I think this doesn't work because "printing the name of a dark room" doesn't actually go by printing the name of the room... it's a special activity that usually prints "Darkness" without checking the room name.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 13, 2018 7:56 pm 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
In my initial post I'd asked a question about exceptions. One issue I was having with this was with multiple scenes:

So the example:

Code:
Instead of doing anything other than waiting during jackScene1:
   say "Hey, I didn't say you could do that."


...works. But what if you want that to happen during 3 or 4 scenes?

Code:
Instead of doing anything other than waiting during jackScene1:
   say "Hey, I didn't say you could do that."

Instead of doing anything other than waiting during jackScene2:
   say "Hey, I didn't say you could do that."

Instead of doing anything other than waiting during jackScene3:
   say "Hey, I didn't say you could do that."


Doesn't seem efficient.

I thought I had found a solution for this in Example 159: Bowler Hats and Baby Geese. I set "A scene can be restricted or free." and then labeled all the scenes as restricted. For example:

Code:
jackScene1 is a restricted scene.
jackScene2 is a restricted scene.
jackScene3 is a restricted scene.

Instead of doing anything other than waiting during a restricted scene:
   say "Hey, I didn't say you could do that."


The three scenes are sequential.

I then add other actions by declaring something like:

Code:
Instead of attacking Jack during a restricted scene:
   try pushing Jack instead;


This all seems to make sense in my head, and matches the way it is written in Example 159. Yet, when I try to compile this, Inform throws back an internal error.

Quote:
Problem. An internal error has occurred: not a description. The current sentence is 'Instead of attacking Jack during a restricted scene' ; the error was detected at line 111 of "inform7/Chapter 20/Descriptions.w". This should never happen, and I am now halting in abject failure.

What has happened here is that one of the checks Inform carries out internally, to see if it is working properly, has failed. There must be a bug in this copy of Inform. It may be worth checking whether you have the current, up-to-date version. If so, please report this problem via www.inform7.com/bugs.


I'm really not sure what I did here as I feel like I copied the example pretty much exactly as it is described in the documentation.

In fact, just to rule out the possibility that I might have done something stupid elsewhere or included a typo, I tested this in a fresh/blank project using only the copy pasted pertinent parts of the example:

Code:
A scene can be restricted or free. 

Instead of going somewhere during a restricted scene:
   say "Better to stay here for the moment and find out what is going to happen next."

The Broad Lawn is a room. "A sort of fun fair has been set up on this broad lawn, with the House as a backdrop: it's an attempt to give local children something to do during the bank holiday. In typical fashion, everyone is doing a very good job of ignoring the House itself, despite its swarthy roofline and dozens of blacked-out windows."

The House is scenery in the Broad Lawn. The description is "A cautious vagueness about the nature of the inhabitants is generally considered a good idea. They might be gods, or minor demons, or they might be aliens from space, or possibly they are embodiments of physical principles, or expressions of universal human experience, or... at any rate they can run time backward and forward so it warbles like an old cassette. And they're always about when somebody dies. Other than that, they're very good neighbors and no one has a word to say against."


...and it still throws back the internal error.

So assuming this is not me missing something really stupid, is there some alternative way of replicating this functionality? To save me copy pasting and repeating large chunks of code for each scene where I would like an alternative or excluded action to apply?

Thanks.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 13, 2018 10:20 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2747
Location: US - Central
It sounds like your INSTEAD rules are clashing. "Instead of doing anything except waiting..." is overriding "instead of attacking..." where you redirect to the pushing action, which then gets caught by "instead of doing anything" since pushing is an action that is something besides waiting.

You could try "Instead of doing anything except waiting or attacking jack or pushing jack during a restricted scene." which should free up your attacking and pushing actions to redirect elsewhere.

This is why you don't want to rely on INSTEAD for everything because INSTEAD suspends parsing and only follows the directions you write. If you write "instead of switching on the light switch" the parser will follow this written rule instead of every other rule that concerns darkness, whether the switch is already on, whether the room is already lit...which defeats the purpose of the parser entirely.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 14, 2018 9:06 am 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
Hey,

Thanks for the suggestion, but this example...

Code:
A scene can be restricted or free. 

Instead of going somewhere during a restricted scene:
   say "Better to stay here for the moment and find out what is going to happen next."

The Broad Lawn is a room.


...is copy pasted directly from the documentation, and even on a clean/new project it still throws back the same error. Even though there are no other Instead rules for this one to conflict with. The functionality of setting a scene as "restricted" or "free" seems to fundamentally break something. I'm wondering if there is an alternative way to be able to do the same thing? Group a bunch of scenes together so that a rule can be applied to two or three scenes without having to repeat code for every scene where a rule is applicable.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 14, 2018 10:07 am 
Offline

Joined: Wed Oct 31, 2018 8:17 am
Posts: 7
Apparently this is reported as a bug already: http://inform7.com/mantis/view.php?id=1823


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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