Help with modifying David Ratliff's Armed ext.

Hi. I’m brand new at this so bear with me.

I’m trying to add a slingshot that requires ammo (rocks) to my story. I have managed to create a shooting slingshot thanks to David Ratliff’s Armed extension, but I can’t find a way to require the player to carry ammo to fire it. I’d also like the number of rocks the player is carrying to decrease by one each time the player fires.

So the slingshot requires the player carry at least one rock for it to shoot at all, and each shot the player takes decreases the number of rocks he carries by one.

Can anyone suggest some source code that might accomplish this?

Thanks for the help.

You probably want something like this:

[code]Check shooting something with the slingshot:
if the player does not carry a rock, say “You have nothing to load the slingshot with.” instead.

Carry out shooting something with the slingshot:
now a random rock carried by the player is in the location.[/code] Etc.

I recommend really digging into rulebooks, especially check/carry out/report. They’re a big, powerful part of the language.

Thank you. Much appreciated. Worked like a charm. Like I said I’m new. By digging through rulebooks, do you mean digging through the Inform manual? I’ve read the chapter on Rulebooks, but still don’t know how to access existing rulebooks to review. I’ve been studying up as best I can but I’m still struggling to grasp a lot of the concepts. I’m hopeful it will come with time and diligence.

I have another question. Still using the “Armed” extension as the foundation for the slingshot, I’m having trouble adapting it to shoot certain objects (besides persons) that I specify as shootable. Armed.ext is designed to recognize only people as targets. Is there a way I can designate a new “kind” of object that is also shootable? I’d like to make select objects destroyable, in addition to persons.

Thanks again.

Chapter 7, and then bits of chapter 12. (You can skip the parts of 12 that are about other people, for the moment.)