If you’re sitting on a couch in a large room, and you want to interact with something that’s far away from you, you’d first have to get off the couch, right? Like say, you’re sitting on the couch, and you see a book you want to read that’s ten feet away from you. Logically, you’d have to first get off the couch before you can even examine the book (given that it’s so far away from you).
Here’s the code I have so far:
Place is a room. "On one side of the room, you can see a couch. On the opposite side of the room, you can see a book." A couch is an enterable scenery supporter in Place. The description of the couch is "It's a couch." A book is in Place. The description of the book is "It's a book." Before doing something when the current action is not entering the couch: if the player is on the couch: try getting off the couch.
This gives me a run-time error. I’m guessing I’ve somehow created an infinite loop of getting on and off the couch or something, but I don’t know. Mainly, I just want the parser to automatically make the player “(first getting off the couch)” before doing anything else. It also might be nice if I could allow the player to interact with objects near or on the couch, or carried by the player when on the couch, since that technically wouldn’t require getting off the couch first. How would I do this? Thanks in advance! You all are always so helpful and informative, and I’ve learned a lot from you all in the three months since I’ve begun writing IF.