I’m currently trying to cobble together a version of Zork II’s Crystal Spheres.
If you’re not familiar, looking into a orb prints the room description of the room enclosing the ‘next’- peering into the blue orb shows you the room enclosing the red orb, peering into the red orb shows you the room enclosing the clear orb, etc.
How can I ask Inform to print the room description of a room the player isn’t currently in?
I’ve read a little about putting things in Scope, but that seems like it would introduce some problems. The action of “peering” should do three things:
- say a brief preamble (as you look into the sphere, your vision swirls as…etc)
- give the room description of wherever the ‘paired’ orb is
- say a brief postscript (your vision clears; you are once again standing in… etc)
…which means that “look” or “examine” actions relating to the other room should always fail, and i’m not sure how to bring a room into scope and back out again before the player’s next action…
This one’s a little more broad.
Rather than write a ton of specific If-loops for every orb, it seems like I should be able to create a relation that pairs them unidirectionally. Since the purpose behind this is to learn more about Inform, I figure taking the ‘harder’ path might be the better option here, but I’m really struggling!
Writing a linked / linked-to relation between orbs was easy enough, and checking the >relations debug confirmed that inform understands what i mean. Here’s my setup:
An orb is a kind of thing.
[a bunch of lines making orbs in different places]
linking relates one orb to one orb.
The verb to link to means the linking relation.
The Red Orb links to the Blue Orb. The Clear Orb links to the Red Orb. The Black Orb links to the Clear Orb. The Void Orb links to the Black Orb.
I’m just really struggling to actually use this relation, for some reason? Any action or definition I try and insert it into seems to understand that it’s a relation between a specific kind of thing called “orb,” but still won’t allow it as an input. Am I just misunderstanding the use-case for relations…? Is there a better way to do this…?