Fake Gun Help!

Heyo!

I’m making a gun that, if fired at oneself, will not go off and will instead display a message. It cannot be fired at anything else, either, it is simply a gag.

Shooting it with is an action applying to two things. Understand "shoot [something] with [something]" as shooting it with.

Check shooting it with:
	if the first noun is not self:
		say "Trust yourself. You want to die. Use the bullet on something worthwhile.";
		stop the action;
	if the second noun is not a gun:
		say "I don't even want to know what you've gotta be smoking. That's not possible.";
		stop the action;

Carry out shooting it with:
	if the first noun is self and the second noun is a gun:
		say "You press the gun to your temple. Breathing slowly, you pull the trigger.[paragraph break][italic type]Click.[roman type][paragraph break]The gun does nothing. You check the chamber, only to find that the 'bullet' is a tootsie-roll. It would seem that your future self has just duped you. He knows how badass this fucking game is.[paragraph break]Now that you think about it... You're hungry as hell. And the gun is starting to look quite appetizing... Care to indulge?";

The code ends with an error in translation, with two errors in matching phrases but not recognizing them. I’d really appreciate any help!!
Thanks :smiley:

Replacing “self” with “yourself” (which is the player object, default referred to as “me” in game) and “first noun” with just “noun” (I7, a bit counter-intuitively, uses “noun” and “second noun” to track the two nouns) makes the example compile.

One issue is that the second part of the Check Shooting It With rule will apply only if and only if the player tries to shoot themselves with something other than a gun. That means (for instance) that trying to shoot other things with yourself will result in the first message, which may not be what you want.

To avoid those and similar issues, I recommend splitting up rules and placing the logic in the head of the rules. That can become a lot more compact, and you can name the rules, which will help in debugging.

Check shooting something which is not yourself with the gun (this is the suppressing of non-suicidal impulses rule): say "Trust yourself. You want to die. Use the bullet on something worthwhile." instead.

Check shooting it with when the second noun is not a gun (this is the you need a gun to shoot pardner rule): say "I don't even want to know what you've gotta be smoking. That's not possible." instead.

Carry out shooting yourself with the gun (this is the plain ole suicide attempt rule):
	say "You press the gun to your temple. Breathing slowly, you pull the trigger.[paragraph break][italic type]Click.[roman type][paragraph break]The gun does nothing. You check the chamber, only to find that the 'bullet' is a tootsie-roll. It would seem that your future self has just duped you. He knows how badass this fucking game is.[paragraph break]Now that you think about it... You're hungry as hell. And the gun is starting to look quite appetizing... Care to indulge?"

Finally, note that since the carry out rule went through, the game would count the action as successful. This may help if you want I7 to track the attempt (say, for instance, that you want to suppress future suicide attempts with another rule).

1 Like

Brilliant. Thank you for your help!

I love the community on this site. Everybody is so eager to help and fun to work with!

3 Likes