The last update to the bug tracker was in December of last year. While I don't think the release schedule speaks well of the health of Inform 7, I still don't think it's dead quite yet. Edit: and issues are still being responded to. When this project dies, we will know when the bug tracker goes silent. Or when they tell us.
Setting aside the idea of using Inform as a tool to manage a tabletop game, and noting that there ARE existing tools to do this like FantasyGrounds or Roll20...
Yes, there are ways to change the rules during play, and one of them is the concept of Scenes in inform7.
http://inform7.com/book/WI_10_1.html
Scenes are basically groups of rules that can be triggered by the passage of time, or by any other specific trigger. This is probably the closest thing to what you're looking for.
I thought this was a great idea, so I used it. Thank you!
A thing can be notable or notnotable. A thing is usually notable.
Glancing is an action applying to nothing. Understand "Glance" as glancing.
Carry out glancing: If the location is dark, say "It is pitch dark, and you can't see a thing." instead; Let X be the list of notable things in the location; say "[X]".
It isn't pretty yet, though. The documentation on inventory highlights some simple ways to pretty-up lists: "with newlines" and "with extra indentation" would look great here. Having trouble figuring out exactly how to tell inform use those though.
I'll come back to update this comment if the code gets any better.
For more ideas about how to implement animal behavior, you can check out the examples in the recipe book -- specifically, 8.3 Animals and all of 7 Other Characters.
... it's written using Knuthian literate programming...
Which is to say, it's self-documenting!
Anyway, I've found it to be an impenetrable web of confusing B.S., but there's a lot of non-code (that is documentation), you can read here
I don't know which version of Inform7 you're using, but example code is always dark-blue in the manual. Sure, there are complete games on the official site, where you can see its source text, alternatively download the project file (I recommend "Bronze" by Emily Short). I wouldn't say it's the ideal way to start out as a beginner; do consider skimming through the manual so you get a grasp on how the code works and what the correct syntaxes are. For starters, brackets outside quotation marks are for code comments (and will make the text green coloured). Brackets inside quotation marks is for text substitutions (and will colour the text purple).
Example Room is a room.
[This text will be a comment, and will only be visible in the source text]
Instead of listening when the player is in Example Room: say "You can hear [sounds in Example Room]."
A thing can be audible. An audible thing has some text called the sound.
To say sounds in (room - a room): repeat with N running through audible things in the room: say the sound of N.
That's not the manual/documentation. That's your game's index (note that the Index tab is selected) You want the actual documentation, under the Documentation tab. Note that the white section is the manual, and the yellow section is the recipe book (for slightly more advanced writers).
The index is used for getting a comprehensive overview of everything in your game, and is updated each time the game is compiled. It only updates before play begins, so any changes during the game will not be reflected in the index.
Edit: The manual is also avaliable here. Brew a pot of coffee and start at the beginning. It's fun! Feel free to ask if anything's unclear :)
Just a small warning; substituting a carry-out rule will make it trigger twice. (Bug #1976)
I agree that the best way to handle is a conditional exception to the check rule, I think the proper syntax should be something like (based on example 227):
The can't take other people rule does when taking an animal.
In order to make taking animals work, you may need to revoke the "can't take other people rule" in addition to making it portable (if it isn't already?).
If you have non-animal people, you may wish to instead replace it with a rule that prohibits taking men or women.
Taken directly from the syntax example file, here is the way you would phrase these sorts of operations:
The can't take other people rule is not listed in the check taking rules. The new taking rule is listed instead of the standard taking rule in the carry out taking rules.
You may also wish to review the chapter on rulebooks.
/u/Trainzack is right, action names are supposed to be gerrands optionally modified by a preposition. I actually thought this was enforced by the compiler.
see also the section on "action variables" which would let the instead of talking to bob: ...
syntax work even if the action name is talking
instead of talking to
.
I strongly recommend you (re-)read the "Actions" and "Advanced Actions" chapters of the manual.
1. Isn't it just all things in <the room> which are not carried
(I've tested this and it works for me).
Ah. nm "in" only goes on layer deep, so if you have nested containers (in this case, the room, and within the room are some objects, one of which is the player, and perhaps a treasure chest or something, and then within the player/containers in the room there are other objects it won't nest.
The recursive containment relation is called enclosure, so you do:
the list of not carried things enclosed by <the room>
Could also do the list of things enclosed by <the room> and not enclosed by the player
or the list of things enclosed by <the room> and not possessed by the player
or the list of things enclosed by <the room> which the player does not have
possession is similar to containment in that it is not recursive; however, something "has"/"possesses" something else if is "in" (containment), "on" (supporting), or wearing the other other thing.
2. There aren't any built in operations for this, but of course you could write your own; however, it isn't very useful, since you'd usually just write your "description" (this is the technical term used in the i7 documentation, but I prefer to call/think of them as queries, and it seems you do too) differently. (though of course some times you have a list of things that aren't world-objects, but even then you could use custom-relations... I guess remember that i7 is secretly a dialect of prolog)
However, see §21.11. Variations: arrays, logs, queues, stacks, sets, sieves and rings in the docs.
3. Did you even check the documentation before asking? Though to be fair, the answer is under the heading building lists and that's a little confusing. (I just skimmed the entire chapter on lists)
You hit the "release" button. It should be right next to the "Go" an "replay" buttons.
You may wish to check out Chapter 25 Releasing in the inform7 manual.
I think you want Simple Chat, but there are several conversation engines for inform since the built in system for conversation is kind of lacking.
The "inform" way to do conversation is ask whoever about whatever
then there's a rule like:
carry out asking whoever about "whatever": say "'Whatever.', whoever replies".
Hi, I'm new to inform 7 myself and haven't done much with conversations yet.
However if you just want a simple response to the player saying something to someone you can do something like this:
Instead of answering the old woman that "hi":
Say "The old woman says hi".
Instead of answering the old woman that something: Say "The old woman gives you a puzzled look".
Instead of asking the old woman about "the answer to life universe and everything": Say "'The answer is 42' the old woman answers".
Instead of asking the old woman about something: Say "'Sorry, I don't know anything about [the topic understood]' the old woman answers".
Inform 7 treats saying something to someone as answering. If you're intrested you can find the block answering rule inside Graham Nelson's Standard Rules.i7x which is the code that gives you the default answer: 'There is no reply'.
One additional thing that might be useful, to see which rules that are considered when you type something you can enable action listing by typing 'ACTIONS'.
Moreover I can recommend Writing with inform and The inform recipe book, which are quite handy to give an idea on how to do stuff with inform.
Hope it helps and good luck.
If you're brand new, read about values!
They're the best way (I've found) to give a character a "Strength" or "Speed" stat that's easy to call-up when you need it.
There's quite a number of concepts in Inform that don't exist in other languages, so it can be a challenge to sift through the documentation. But once you begin understanding how it models the world, you'll be better at making things that work the first time.
You can model this situation a few ways, but let's work from an example.
[First we add places and things to the scene] The player is in a room called Bar. Bronston is a person in the bar. The player is carrying a club and sword.
[Erase the existing attack commands] Understand the commands "attack" and "punch" and "destroy" and "kill" and "murder" and "hit" and "thump" and "break" and "smash" and "torture" and "wreck" as something new.
[Make an action; actions are the basic 'steps' a story can take] Attacking it with is an action applying to one visible thing and one carried thing.
[Make a command so that the player can use the action with text input] Understand "attack [someone] with [something preferably held]" as attacking it with.
[Next we need to use rules to decide what happens.] [Rules are the code that does most of the game's heavy-lifting.] [They "catch" stuff that happens in the game and decide what the game will do in response.]
[This is the normal way to complete actions by 'reporting' them to the text output] Report attacking Bronston with a sword: say "Bronston's shield holds off some blows, but you manage to outpace him with deft swordsmanship"
[And the instead rule ignores the action, replacing it with something else] Instead of attacking Bronston with a club: say "Bronston deflects the club with his shield"
For the barrel, check Writing with Inform book 3.8 Scenery. However, if you're looking to have something hidden then you may want to check the Recipe Book 6.6 Looking Under and Hiding.
It'll really depend on what you want to achieve. Check both books as they have a lot of examples of ways to do this and what each way accomplishes. Making something disappear but still exist means that it is more tangible than just a description and thus you'll need to provide a bit of context to Inform so that it can handle it correctly.
check the player taking the hat from fred
will never work.
since from
isn't defined as an action variable, has to be check the player taking the hat when fred has the hat
It may be possible to add an action variable to the taking action like:
The taking action has a person called person taken from. setting the action variables for taking: now the person taken from is the owner of the noun.
(I haven't tested that and I don't think it will actually work since "from" seems to already be used by the parser)
Are you running the latest version of inform? my test program compiled.
My first thought was to use something like understand "x" as a mistake, but I'm not so sure that will work here.
I tried to make an example based off of what you described, but the tickets carried by people already aren't referable by the player. How are you letting the player ask for the other character's tickets? If we want to do what you're asking for, the solution will depend in part on that.
However, I personally don't think what you're asking for is the best solution. If the player is supposed to be checking everyone's tickets, then a new action (like check ticket, or pat down or whatever) is probably the way to go. Then you can write a generic response for someone showing you their ticket, write more extravagant responses for when you check certain people's tickets (this person searches through thirteen pockets and pulls out a bunch of weird stuff before they find it, or this person put their ticket someplace weird). And then when you check Jim's ticket, you can make it do whatever you need to.
This solution doesn't even need tickets to be part of the world model. We can redirect most interactions with the ticket to the "check ticket" command, and on the off-chance we do need to make a ticket a physical thing, we can integrate that in there pretty neatly.
If you don't EVER need to refer to "the piano roll" as "piano" then you can use the privately-named
property.
privately-named
means you can't refer to a noun by its actual name and can ONLY use understand
aliases. So, if you do this:
The Den is a room.
The wooden piano is a thing in The Den.
The wooden piano is fixed in place.
The description is "88 keys and all that.".
The piano roll is a privately-named thing in the Den.
The description is "Fits in the piano."
Understand "piano roll" or "roll" as the piano roll.
"piano roll" will refer to it, "roll" will refer to it, But "piano" won't.
Unfortunately that's basically a bug because users are damn well going to want to refer to the roll as "piano" when the wooden piano isn't present.
I will confess, I had to really do some research on this, even though it seems like a common thing.
I finally found a good answer deep in the Inform 7 documentation for "Does the player mean...".
http://inform7.com/book/WI_17_19.html
This allows you to choose for the player, and choose for the player only under certain conditions. That allows us to do this:
The Den is a room.
The Breezeway is a room. The breezeway is north of the den.
The wooden piano is a thing in The Den.
The wooden piano is fixed in place.
The description is "88 keys and all that.".
The piano roll is a thing in the Den.
The description is "Fits in the piano."
Does the player mean doing something with the piano roll:
it is unlikely.
I actually tested this as well as:
Does the player mean doing something with the piano roll
when the player can see the wooden piano:
it is unlikely.
Both work just fine and piano will always mean "wooden piano" when there is any other choice.
I hope that helps, and if anyone knows an easier way to do it, let me know.
Good point.
The thing is since inform7 is a single namespace language... anything that adds a ton of functionality will step on toes. You've defined "milky" and used it, and now it can no longer mean anything else besides what it means in the context of the extension... (if this extension is included into a story)
That being said, it's actually pretty well written, you need to replace all instances of
You
with [We]
The 2 most common problems are that people use "before," "after," and "instead" rules for new actions they define instead of check, carry out and report, but, and the "You" we thing. Most stories are written in second person (did you know you can change it so the player is referred to as "I" or "we" instead of "You"?), so this will only affect the minority of stories written to use non-standard pronouns for the player.)
here's more info on adaptive text for using the right pronoun for the player (or otherwise)
I have been out of the game for a couple of weeks, so I'm a little rusty, but this is the direction I think you should head in:
Documentation on creating new actions for reference.
You'll want to create "talking to", which will look something like this:
Talking to is an action applying to one person and one thing.
And then tell Inform what to recognize as "talking to":
Understand "talk to [a person] about [a thing]" as talking to.
(These might be minorly incorrect, very sorry if I've made an error, but it's the right tact.)
Don't think I have the skills to help with the disabling side of your question.
Apologies for the incomplete answer, hopefully this gets you started.
Emily Short generally publishes her source code (for non-commercial/IF competition stuff...). "Bronze" was christened an official example of inform, but they redid the website in 2019 to be github pages based (?) and that all got deleted...
It's still on the wayback machine though...
but you wanted a short example... not a medium sized thing. I remember... let me see if I can dig up some more.
There are a lot of steps to this, I'll do a broad sweep now and come back later tonight to give a more definite answer.
You'll want is to define the different 'shapes' a person can be. Something like this will work:
Form is a kind of value. The forms are human, monster, alien, apache attack helicopter, and slug. People have a form.
You'll also need the game to know if someone is wearing clothes. Something like this should work:
Definition: A person is naked rather than clothed if they are wearing an item.
Next you'll need "turn into" to be an action. Unfortunately, I don't know much about creating actions. You mentioned that you've checked the documentation, but here's a link to it just in case you're looking in the wrong spot. I'm interested in this idea, so I'll try to sus out how to do it when I come back later tonight.
Lastly, you'll want a system in place to make sure the player is human and clothed. You'll want to place a door in the room. Here's some documentation on doors.
Before opening the doorName: if the form of the player is not human, say "I can’t let my family know my secret!" instead; if the player is naked, say "If you think I’m going anywhere naked, think again!" instead.
Hopefully this is helpful, I don't have Inform open right now to test it out. As I said, I'll come back later to flesh out my answer. Comment any further questions you have and I'll do my best to help!
Love the idea by the way:)
You might want to take a look at §12.21. Guidelines on how to write rules about actions.
The rule of thumb is that 'check' is generic and 'instead' is specific. Check is great when you have several common sanity checks you want to run through before an action is performed. If I'm trying to fire a gun, am I holding it? Is it loaded? Is the safety off? Is the muzzle blocked? Do I have arms? etc.
Instead rules are for specific situations that fall outside of this, for example:
>"You would never shoot your beloved model train set! You feel guilty for even considering it."
In the cupboard example, I'd opt for 'instead', because this rule is only going to apply in this one particular situation, in one specific room.
>I don't know if there's any functionality to this code structure, or if it's just a broken thing in Inform that happens to compile.
Yes, it's intended behaviour.
For some reason, the part in quotes defines the objects "initial appearance", instead of its "description". Always seemed the wrong way around to me, but you can use it for things like:
>The pen is a thing in the office cubicle. "Half buried beneath the stacks of paperwork is a cheap, office pen."
>The description of the pen is "A plastic Bic, bought from a dollar store."
Example "Noisy Cricket" is a very complex example of one way to do it. http://inform7.com/book/RB_10_2.html
Here's a simpler way; it only works with pairs of objects.
Example Location is a room.
Mixing it with is an action applying to two things. Understand "mix [something] with [something]" as mixing it with.
Some red paint is a thing in the Example Location. Some yellow paint is a thing in the Example Location. Some orange paint is a thing. It is nowhere.
Instead of mixing red paint with yellow paint: now the red paint is nowhere; now the yellow paint is nowhere; now the orange paint is in the location; say "You mix the paints to make something new."
Instead of mixing yellow paint with red paint: try mixing red paint with yellow paint.
Example "Noisy Cricket" is a very complex example of one way to do it. http://inform7.com/book/RB_10_2.html
Here's a simpler way; it only works with pairs of objects.
Example Location is a room.
Mixing it with is an action applying to two things. Understand "mix [something] with [something]" as mixing it with.
Some red paint is a thing in the Example Location. Some yellow paint is a thing in the Example Location. Some orange paint is a thing. It is nowhere.
Instead of mixing red paint with yellow paint: now the red paint is nowhere; now the yellow paint is nowhere; now the orange paint is in the location; say "You mix the paints to make something new."
Instead of mixing yellow paint with red paint: try mixing red paint with yellow paint.
That code works fine for me, both in the regular editor and in playfic. Did you press the "Save & Test" button?
Also, after trying out playfic, I would honestly highly recommend the standard editor that you download from the website, because it has some features that make debugging easier, like the Index. You can even download 6G60 and then copy the source to playfic, if you want to share it with other people.
If your game is output in Glulx, there's Real Date and Time by Ron Newcomb: http://inform7.com/extensions/Ron%20Newcomb/Real%20Date%20and%20Time/doc_0.html
Include Real Date and Time by Ron Newcomb
The kitchen is a room. "A big kitchen with a lot of empty counter space."
The clock is in the kitchen. The description is "Pretty fancy digital clock! The clock says it is [the player's time] on [the player's year]-[the player's month]-[the player's day] which is a [the player's weekday]. It also shows seconds and microseconds ([the player's seconds]:[the player's microseconds]). The timezone is UTC[the player's timezone]."
There are several flaws with this code, but perhaps the biggest is that it doesn't seem as you know what you want the code to actually do.
I suggest taking a read of §12.2 - How actions are processed and §12.7 - New actions to learn how check, carry out and report works. Very much abridged, it goes something like this:
Your action processing has hard-coded object names, this is extremly bad form. Besides, several other lines of your code does not do what you think they do; try adding 'Use unabbreviated object names.'
docs on if...
start here.
Though as you can see your if statements are fine, it's just that multiple "check raging" rules are overriding each other. (with the first one winning for some reason).
You probably want something like:
Check raging: if the player is in the CastleRegion: say "You know you cannot go a slaughter in the castle.[paragraph break]The king's cleric has cast a peace spell. Consider treachery instead?" instead. otherwise if the player is wearing the mantle of calm: say "You will have to take off your mantle of calm first." instead.
or perhaps
Check raging when the player is in the castle region: say "You know you cannot go a slaughter in the castle.[paragraph break]The king's cleric has cast a peace spell. Consider treachery instead?" instead.
Check raging when the player is wearing the mantle of calm: say "You will have to take off your mantle of calm first." instead.
There are several extensions which can help you do that. The first one I can think of is Reactable Quips by Michael Martin.
Glulx is the default interpreter in the newest version of inform. and glulx supports images.
In practice, they aren't use very much, but notably Kerkerkriup, uses lots of images and graphics and is written in inform 7.
Unfortunately the web interpreter for glulx (quixe) doesn't support images, and I like to distribute my games as web pages that don't require the user to install anything.
If you look at chapter 23 "figures sounds and files" in the Inform 7 documentation (it looks much better in the inform app than on their website), you can see what's built in (not much), but there are several decent extensions (of course inform 7 extensions are split between 3 websites, that makes it difficult)
Just a quick google brought up this:
http://www.intfiction.org/forum/viewtopic.php?f=7&t=17057&view=previous
I don't think it helps, but it at least mentions that there is an updated compiler. You're apparently using 632. The website has 6L38 here.
And yeah, I feel for you with the lib-breaking release. I noticed quite a bit of incompatibility in the current state of things.