creating first game going to need some help.

Hi, I am very new to IF and IF programming. And by very new I mean I played my first IF game last week which was ZORK and that was only because it is playable in the new Call of Duty video game. Well I became very interested and have played some simple games and now have decided that I want to start writing IF. I have decided to write a small game to get my self acclimated with the Inform programming language.

My game is based around my house and the player has to escape the house. I figured this was an easy way to help me create rooms and things that are in those rooms because I could base it all off of my house. Well there are obviously some things that I have made different but that’s not really why I am here.

I am going to put my questions here and maybe this will help me learn a lot about inform 7.

The first part is copied from a thread i put in the wrong section before but it really longs here.

Here i am trying to make a code unlock a door. I have a keypad next to the door and i would like the player to type enter code. then i would like for them to right in the code on the next line. But i am stuck here and dont know what to do.

entering code is an action applying to one visible thing.

understand "enter code" as entering code.

check entering code:
	if in the laundry room:
		say " you walk up to the keypad and start to enter the code.";
	otherwise:
		say "There is nothing here to enter a code on."

the key pad is a thing in the laundry room. it is fixed in place. key pad has a number called keycode. the keycode of the key pad is 1234.

understand "keypad" as key pad.

another question I have involves breaking a bench with a hammer. this is what I have so far.

It all works find and dandy except for one thing. if someone just says break bench i want I7 to ask what do you want to break the bench with and then the player can just type hammer. but as of now if they say break bench I7 just gives out the normal “violence is not the answer” response.

a bench is a thing in the breakfast nook. "A bench is oddly positioned in the center of the room with nothing else around it.".  The description of a bench is "A place to sit.".

understand the commands "break" and "destroy" and "hit" and "smash" as something new.

attacking it with is an action applying to one visible thing and one carried thing.

understand "attack [something] with [something preferably held]" as attacking it with.

understand the commands "break" and "destroy" and "hit" and "smash" as "attack".

check attacking something with something:
	if the noun is not the bench:
		say "that is not something worth breaking.";
		stop the action;
	otherwise:
		if the second noun is not a metal hammer:
			say "You cannout break the bench with that.";
			stop the action.

			
carry out attacking something with something:
	say "The bench breaks apart into tiny pieces, there might be one piece left salvagable.";
	remove the bench from play;
	now the piece of bench is in the location.

piece of bench is a thing. "the only piece of bench left after you smashed it."  The description of the piece of bench is "Well it was a bench now it is just a random piece of wood.";

Thanks to anyone who helps and comeback for more im sure i will run into some problems. And once this is done I would like to have a few IF veterans to try this little game out to give me some feedback on what things I have missed and what things need to be done better in my future projects.

You’re almost there.

Understand the commands "break" and "destroy" and "hit" and "smash" and "attack" as something new.

Because you didn’t define “attack” as a new command, when you reassigned the verbs to attack, they went right back to the original attacking verb. (Disclaimer: not rigorously tested.)

thanks for the help. That is all I had to do.