i’ve got a huge problem about solving a task in inform7:
I want to place a ball in a room and want to push the ball into another room. The command should be: push ball west/east/south/north. But here is the problem, i have to push the ball without using the property pushable. I’am troubling with this all day and it would be really nice if someone could help me here.
Thanks in advance.
Why can’t you use the “pushable between rooms” property? This is exactly what it’s made for.
Unfortunately i am just not allowed to use pushable. I am supposed to solve this without using pushable. That’s the problem.
Ohh, is this for a class or something? Is outside help allowed?
Yeah it’s for a class, but outside help is allowed. For me it is not any different than looking for examples with google
What I would do is I would go to the standard rules, copy all the code about “pushable,” change it to “smushable,” and then declare the ball “smushable.”
…but your teacher might not be too pleased with that solution.
Seriously though, you could do worse than look at the rules for pushing it to in the Standard Rules and how they use the pushable property.
I think “pushing between rooms” means the player goes with it as when someone pushes a cart.
It sounds like you want to push a ball and have it roll in the direction you want on its own, hopefully to another room. I had to resist working this out and showing it to you because you’re doing this for a class!
I would make a new command called something like “pushing it directionwise” applying to one thing and one direction.
I’d make sure it only applies to the ball, rejecting everything else, and redirect PUSH BALL to pushing directionwise. The behavior you want is for it to ask “which direction”. Then it needs to check if there is a room in that direction. If so, the ball should notify the player it rolled the correct direction, then be relocated. If there is not a room in the chosen direction, the action need to be rejected, hopefully with a sensible explanation to the effect of “The ball bounces off the wall to the west and rolls back to you.”