Blowing up instead of unlocking

Right now I have a rockwall which is unlocked by a grenade.
Cavern is west of pit.

The rockwall is a locked door. The rockwall is west of Cavern and east of pit. Grenade unlocks rockwall.

I would like to make it so I can throw the grenade then the grenade blows up and unlocks rockwall removing the rockwall from play

I don’t think you can remove a door from play, but you can make it have a printed name of “rubble” or something like that. Then you can make the busted door unable to be closable, lockable, and other things that you can’t do with a door that’s laying in pieces.

You could also make the door scenery if you don’t want it to be in the room description at all post-explosion. However, it’s still necessary to make it unclosable, etc.

An alternative approach, depending on the nature of the game, is to not make the rock wall a door at all. You could simply make it a thing (probably fixed in place) inside the room. You would then manually block the player’s movement in the appropriate direction as long as the rockwall is in there.

That’s the first thing I thought of but take it with salt, I’ve only been at this a week.

Something similar was also mentioned here with regards to adding and removing doors.

You could try something like this.

[code]“Test”

The implicitly remove thrown clothing rule is not listed in the check throwing it at rulebook.
The futile to throw things at inanimate objects rule is not listed in the check throwing it at rulebook.
The block throwing at rule is not listed in the check throwing it at rulebook.

The Pit is A Room. The Cavern is A Room.

The rockwall is an open unopenable door. The Rockwall is west of The Cavern and east of The Pit. The rockwall is either intact or broken. The rockwall is intact. The description of the rockwall is “[if the rockwall is intact]A big solid wall of rock[otherwise]Just a lot of rubble[end if].”.

Check going through the intact rockwall (this is the can’t walk through walls rule): say “You can’t walk through walls!” instead.

The grenade is carried by the player.

Check throwing when the noun is not the grenade or the second noun is not the rockwall (this is the can only throw grenade at wall rule): say “You either can’t do that or don’t need to do that!” instead.

Carry out throwing (this is the standard carry out throwing rule):
now the rockwall is broken;
remove the grenade from play.

Report throwing (this is the standard report throwing rule):
say “With a mighty throw, you launch the grenade at the wall, obliterating it completely!”.

Test me with “e / throw grenade at rockwall / e”.[/code]

Hope this helps.

It is possible to remove a door, but not by default. I recently wrote “Mobile Doors”, which allows you to move and remove doors.

However, for a single door, this might be overkill.

That looks like it could come in handy! You may want to consider uploading it to the Inform Extensions site.

And if you like GitHub, we have a place for this already: github.com/i7/extensions
Would you like access?

Yes, I would like access; thanks! I had found i7/extensions already, but I didn’t know how to get access. Is there a convenient way to merge my repo into a directory of yours while keeping its history?

I will submit it to the Extensions site, but I need to clean up some rough edges first. I hope Inform 7 will eventually allow moving doors, since it doesn’t require any drastic world-model changes. Mostly it involves rewriting some routines to be less restrictive.

I’ve given you access. It would be possible to merge them, but I personally don’t think it would be worth the effort, not for two files and eight commits.

Thanks Alot climbingstars it really helped and it works now. :smiley: