intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 15, 2018 7:47 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Nov 03, 2018 10:43 pm 
Offline
User avatar

Joined: Sat Jan 30, 2016 7:28 pm
Posts: 29
The deal is this:
Code:
The vault is a room. "The vault is locked. [We] can't get out."

The panic button is a thing in the vault. The description is "Push me if you're stuck."

Pushing the panic button triggers a routine that prints a message after any action the player takes. So...
Code:
>PUSH BUTTON
You push the panic button.

An ear splitting klaxon echoes through the vault.

>X DOOR
You see nothing special about the door.

An ear splitting klaxon echoes through the vault. It's getting warm in here.

>OPEN DOOR
The door is locked.

An ear splitting klaxon echoes through the vault. It's getting hot in here. You can't breathe too good.

The trouble is, you can't seem to write a "report doing something" or "report doing anything" rule. I can write it as an "after doing anything" rule, but that puts the text before the action report, which I don't want.

I have searched the documentation and can't find anything that helps.

Any ideas?

_________________
A hollow voice says, ~Plugh.~
http://ajmako.com/interactive-fiction/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Nov 03, 2018 11:57 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5438
Location: Burlington, VT
Would an "Every Turn" rule work?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Nov 04, 2018 12:17 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 302
Location: Michigan
"Every turn when..." is how I handled this is a couple of games.

Here's some example code:

Code:
The vault is a room. "The vault is locked. [We] can't get out."

The panic button is a thing in the vault. The description is "Push me if you're stuck."

A person can be endangered or safe. A person is usually safe.

The danger level is a number that varies.

Instead of pushing the panic button:
   Now the player is endangered;
   say "You push the panic button.".

Every turn when the player is endangered and the player is in the vault:
   Increment the danger level;
   say "[One of]An ear splitting klaxon echoes through the vault.[or]An ear splitting klaxon echoes through the vault. It's getting warm in here.[or]An ear splitting klaxon echoes through the vault. It's getting hot in here. You can't breathe too good.[stopping]";
   if the danger level is greater than 3:
      end the story saying "You die.".


And example output:

Code:
vault
The vault is locked. You can't get out.

You can see a panic button here.

>push the button
You push the panic button.

An ear splitting klaxon echoes through the vault.

>look
vault
The vault is locked. You can't get out.

You can see a panic button here.

An ear splitting klaxon echoes through the vault. It's getting warm in here.

>look
vault
The vault is locked. You can't get out.

You can see a panic button here.

An ear splitting klaxon echoes through the vault. It's getting hot in here. You can't breathe too good.

>wait
Time passes.

An ear splitting klaxon echoes through the vault. It's getting hot in here. You can't breathe too good.



    *** You die. ***


_________________
~~~
My ebooks on Amazon
My ebooks on Smashwords


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Nov 04, 2018 12:52 pm 
Offline
User avatar

Joined: Sat Jan 30, 2016 7:28 pm
Posts: 29
Quote:
"Every turn when..." is how I handled this is a couple of games.

This is what I came up with about an hour after I posted the question.

_________________
A hollow voice says, ~Plugh.~
http://ajmako.com/interactive-fiction/


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: matt w and 20 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