I posted this in the wrong forum earlier, so here’s a new thread.
Like many other long-time players of IF, I have recently decided to try my hand at writing some myself. I’m using Inform 7 because it’s supposed to be easy and intuitive for non-programmers. I’ve found this to be true–but I’ve also been having a few problems, and I would appreciate any help or input on what caused them and how I can prevent them.
When I try to test the game by clicking the “Go” button, the Error tab comes up and tells me that the source was successfully translated. However, the Game tab won’t open, preventing me from trying out the game. Sometimes the Game tab comes up after I click the Go button multiple times, but sometimes I also get a message saying that the source translation failed for apparently no reason.
I’m currently writing a game that takes place on a ship, so I have created new directions: Fore, Aft, Port, and Starboard. The directions work, but Inform fails to recognize opposites (even though I specifically wrote that Fore was the opposite of Aft and Port the opposite of Starboard). Thus, when I write that a room is Fore of another room, once I go into the latter room and try to go Aft (the opposite of Fore), it doesn’t work and I can’t return.
Finally, I just want to know if there’s any way to start the game off with the player inside of an enterable container.
Oh, and I’m using a computer running Mac OS X. Thanks in advance for any help!
It sounds like you may be running into a bug in Inform’s Mac OS X IDE that shows up only under some versions of the OS X. There are some details over here. If that’s the case, it’s annoying and we’re sorry. There may be a workaround that will let you get past it in the short term, depending on which old OS version you happen to be using.
That’s a little mysterious; I can’t help without looking at some code. You could post a small sample of what is failing to work for you, or alternatively you could compare what you’ve done with the example on shipboard directions and see whether that suggests anything.
Sure. Just include an assertion such as “The player is in the hammock.” as part of your world definition.
Thanks for the link to the bug page. At least now I know that what I’m seeing is a genuine bug and not the result of something I did wrong. Regardless, it is, as you said, only an annoyance, and doesn’t prevent me from working altogether.
Here’s the source code for a portion of the game’s map:
[code]The Pod Room is a room.
The Middle Hallway is a room. It is fore of the Pod Room.[/code]
Here’s the code defining the new directions:
Fore is a direction. The opposite of fore is aft.
Aft is a direction. The opposite of aft is fore.
Port is a direction. The opposite of port is starboard.
Starboard is a direction. The opposite of starboard is port.
And here’s the result when I try to go return to the Pod Room.
And finally, the container assertion works. Thanks!
Put the direction definitions before your first use of the directions. Not sure why exactly it makes a difference, but it seems to. Just a wild guess, but maybe the exit is made at your first mention of “fore”, and at that point, it doesn’t know that fore has an opposite, so it doesn’t make automatically make the opposite exit in the other room, and then once it does know about fore and aft, it doesn’t go back to check and fill in anything that came before it.
To those more experienced than I: Is this a bug? Or just the way the compiler has to work?
Yup, that’s it. I hate to keep asking questions, but I’ve been perusing the documentation for the answer to this one and I can’t find it. How to I move something to the room that the player is currently in? For example, how would I do something like
If the player is wet:
move the frog to X
In place of X, I’ve tried “occupied room”, “currently occupied room”, and “room where the player is”, as well as many other similar phrases, but the compiler doesn’t recognize any of them.
As a side note, “location” used by itself is synonymous with “location of the player”. I don’t know if this has any impact on execution speed or memory (it would be negligible if any, I assume), but the latter might make the code slightly more readable.