So, I have this bit in my game where the player needs to look under something for a clue, but they have to pry the item up with a specific tool.
I am having a great deal of difficulty mastering conditionals. Every time I try to do a conditional with more than one condition it wont work with referencing the first noun and the second noun.
In fact it seems like conditional statements are the hardest thing to get right in Inform 7, I always seem to screw them up.
Heres what I have so far:
[spoiler][code]
understand the command “pry” as something new.
Understand “pry [something] with [something]” as prying it with. Prying it with is an action applying to two things.
instead of prying something with something:
if the noun is the floor begin;
if the floor is secured begin;
if the player is holding the foo begin;
say “You pry the floorboard with the foo, revealing something hidden underneath!”;
now the floor is unsecured;
move the foundthing to the old cabin;
otherwise if the floor is unsecured:
say “It’s already loose.”;
end if;
otherwise if the noun is not the floor:
say “Nothing happens.”;
otherwise if the player is not holding the foo:
say “You don’t have a suitable tool for that.”;
otherwise if the second noun is not the foo:
say “You can’t pry with that.”;
otherwise if the first noun is not the floor:
say “Nothing happens.”;
end if.
[/code][/spoiler]
I’ve always had trouble with conditionals in I7. I don’t know why. Sometimes I write things that I feel look exactly like the documentation and they don’t compile. Why are they so hard?