I am using Inform 7 to develop my game.
In my game, there is a puzzle where you are essentially trying to arrange some large objects next to an engine that moves water(where I do not intend for the water to be an object accessible by the player, only alluded to)–this was inspired by thoughts of the game ‘Mousetrap’ that I used to play when I was a kid. My problem is that I cannot seem to devise a routine that allows the player to move the objects freely with reference to the engine. I want the player to be able to move an object away from the engine, or from the other objects. I have tried using Table formats, I have tried value and string variables. Initially, I made the engine itself moveable, but then I decided that there were more permutations to that than I wanted to deal with, so I decided to make it stationary so that I would only have to account for six possible permutations(of three objects–if they are all connected). I really wanted to use a Table, where each row represents a placement next to the engine–placement 1 would be right next to the engine, 2 the next spot, 3 the next. Initially, the Table would be empty in each row, with each object placed in the room, but not at the engine–originally, since my Table entries are objects, I simply put the word ‘nothing’(as opposed to “nothing” as a textual value) in that column–then I tried using blanks(–), with the word ‘a thing’ in the top row. I even tried using string variables in a Table, where the entries were the textual names of the objects. I cannot seem to get this to work. Here is specifically what I want to do–
The engine, the thing that sets the whole thing going, moves water. It is stationary and collects the water from a trough filled by a spigot in the wall. There are three moveable objects in the room, though they are scenery and you can’t pick them up, you can push them(at least conceptually) to the engine. If arranged in the correct way, the intended result, of course, is a success(and the discovery or recovery of a certain item). I want the player to be able to arrange the objects in any way with respect to each other, and then be able to re-arrange them(before setting the thing in motion, of course) if the player so desires. For instance, if the item is not in place, it’s not on the table. But if it is pushed to the engine, it is in placement 1(which really is the only placement available to it, otherwise I would have the program say “You see no practical purpose to that.”). Then the next item, if the player tries to push it to the engine, I want the program to say “The [item(or whatever moniker I give to this column) entry in row 1 of Table 2] is already there.”(Inform returns a problem message with this line, and I don’t understand why I can’t say it). If the player pushes the next item to the item that is already there, then this second item is supposed to go into the second row, in position 2, etc. I want the player to be able to push any item out of configuration, and still have the other item(s) remain where they were pushed. I created a verb ‘heaving it to’(Understand “push [something] to [something]” as heaving it to), to refer to the action(of course the player does not have to type Heave, only ‘push’)–this was a solution to an earlier problem, because I did not want the objects moved between rooms, just this one room.
Simply put, is there something about Tables that I don’t understand or did not get? Or am I attempting something impossible? Can objects not be included in, or added to or removed from Tables?
I even tried making a Table where the objects were in the first column, their placements would be indicated in the other column, where a 0 would indicate that the object is not in the configuration(as it is initially or after being pushed out of it). For some reason I cannot get the program to refer to specific entries in the table.
I was having such a good time programming along until I hit this snag.
Some help would be appreciated.