I took a break from Inform, and now I’m trying to get back into it. I’m afraid I’m biting off more than I can chew. I’m not especially good at reading or remembering the entire documentation, so I’m sort of winging it.
Basically one idea I’m working on is people behavior. The code so far:
[code]Feeling tracker is a kind of value. 1f specifies a feeling tracker. All people have a feeling tracker. Feeling tracker is usually 1f.
Feeling is a kind of value. The feelings are neutral, suspicious, angry, or hostile. All people have a feeling. It is usually neutral.[/code]
I could actually name these variables better.
I’ll try to put this as simply as possible. The idea is feeling tracker goes up 1 when someone sees the player perform a suspicious action, or down 1 after a few turns. Feeling changes based on what feeling tracker is. At 1, they are neutral, at 2 they are suspicious, etc. The reason for having both is that behavior is dictated by Feeling. Once someone becomes hostile, they don’t become un-hostile, for instance. And they also give the player grief when hostile.
Also, it might take 3 points to go from angry to hostile, not just one category jump with every suspicious action.
What would be the way to associate the feeling tracker with a feeling (whenever feeling tracker changes, alter the feeling so it coincides with the number)?
How would I enforce the behavior (if hostile, then do these actions instead of normal actions)? That’s maybe too broad a question.
Maybe better still: Is this a decent way of doing this at all?
The other thing I’ve been struggling with is parts of an object. I can get it to work in a limited way. This code works:
The top, bottom, and interior are parts of the cabinet.
The top, bottom, and interior are open containers.
In the top is a sugarfree gum.
We can examine the top and find the gum.
However, trying to make a universal system doesn’t work.
This code is errorless, but does not work:
[code]A searchable object is a kind of thing.
The bottom, top, and interior are parts of a searchable object.
The bottom, top, and interior are open containers.
The safe is a searchable object.
In the top is a foozle.[/code]
There is no foozle, nor does there seem to be a bottom, top, or interior at all.
Thanks for any help!