intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Aug 20, 2018 1:38 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jun 29, 2018 4:37 pm 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
Hi everyone! I have wrote this:
Code:
playing is an action applying to one topic.
   understand "play [text]" as playing.
   report playing:
      say "You are not very good at this game...";


I need to make him say a different thing only if [text] is "briscola"... how can I do?
thank you in advance! bye!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jun 29, 2018 8:06 pm 
Offline

Joined: Sun Apr 08, 2018 6:45 pm
Posts: 7
The easiest way is probably to make "playing briscola" a separate action, triggered by the command "play briscola". This won't cause any problems with the compiler.

If you wanted several customized responses, you could use a table like this, adapted from chapter 5.4 of the recipe book:

Code:
Playing is an action applying to one topic. Understand "play [text]" as playing.
Report playing: say "You are not very good at this game."

Instead of playing a topic listed in the Table of Playing Responses: say "[response entry][paragraph break]".

Table of Playing Responses
Topic      Response
"Briscola"      "Good job!"
"Pinochle"      "LOL, nope."
"Uno"      "What a numpty!"


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jun 29, 2018 11:45 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2638
Location: The Midwest
You could also just use an Instead rule.

Code:
Instead of playing "briscola":

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jun 30, 2018 3:34 am 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
Yes! Now it works! Thank you both very very much!


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 9 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