intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Dec 13, 2018 9:23 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Fake Gun Help!
PostPosted: Wed Sep 05, 2018 10:52 pm 
Offline

Joined: Sun Aug 19, 2018 3:04 pm
Posts: 20
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.

Code:
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 :D


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Fake Gun Help!
PostPosted: Thu Sep 06, 2018 1:35 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 802
Location: Malmö, Sweden
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.

Code:
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).

_________________
~Björn Paulsen


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Fake Gun Help!
PostPosted: Thu Sep 06, 2018 8:17 pm 
Offline

Joined: Sun Aug 19, 2018 3:04 pm
Posts: 20
Eleas wrote:
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.

Code:
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).


Brilliant. Thank you for your help!

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


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group