intfiction.org

The Interactive Fiction Community Forum
It is currently Wed May 22, 2013 4:17 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Jul 14, 2012 10:19 pm 
Offline

Joined: Sat Jul 14, 2012 10:04 pm
Posts: 7
Hello, amateur IF writer here, having trouble imagining a solution for a simple problem.

You see, there are a lot of things my player is capable of doing, but for one scene of my story,
the player is disabled and trapped in a sack. I'd like to make a very complex response that happens each time the player "struggles",

And I'd like the game to understand a whole slew of things as struggling (including a few custom actions), but only for that scene.

I know I could do something like:

Code:
instead of kicking while Stuck in the Sack is happening:


-but the response is going to be quite complex, so having this chunk of code repeated for every action seems like the wrong way of doing it.


Last edited by Outcast Orange on Sun Jul 15, 2012 11:54 am, edited 1 time in total.

Top
 Profile Send private message  
 
 Post subject: Re: Trapped in a Sack
PostPosted: Sat Jul 14, 2012 10:42 pm 
Offline

Joined: Fri Jul 16, 2010 2:09 pm
Posts: 1950
You haven't quite given enough information to suggest a strategy, but one thing that might help is a "struggling" kind-of-action:

Code:
Kicking is struggling. Untying the rope is struggling. Jumping is struggling. Attacking something enclosed by the player is struggling... etc.

Instead of struggling when the player is in the sack:
     something complicated.


Remember also that you can use "during" to make a scene-happening condition more concise. I think it has to come at the very end of the rule preamble.

Also, if you're saying something detailed that has a lot of chunks that get re-used, you can break them up into separate "to say" phrases. And remember, "to say" phrases can have side effects!

Depending on what you want to happen, activities might also help:

Code:
Escaping using something is an activity on objects.

Instead of struggling when the player is in the sack:
    Carry out the escaping using activity with the noun.


Top
 Profile Send private message  
 
 Post subject: Re: Trapped in a Sack
PostPosted: Sun Jul 15, 2012 2:58 am 
Offline

Joined: Sat Jul 14, 2012 10:04 pm
Posts: 7
Thank you very much for helping me with this problem. It seems obvious now that I know what the solution is.
Hopefully as I keep working on these projects I'll start developing a better inform vocabulary.

Quick question though:

What is the difference between using "is happening" and "during"? I want my code to be as concise as possible, and develop good practices, so any information would be appreciated. Just earlier today I looked at the source text behind one of Emily Short's fictions, and it was spectacularly clean. I aspire to do something like that myself some day.


Top
 Profile Send private message  
 
 Post subject: Re: Trapped in a Sack
PostPosted: Sun Jul 15, 2012 12:19 pm 
Online

Joined: Tue Jan 22, 2008 5:55 am
Posts: 841
Location: The Netherlands
Outcast Orange wrote:
What is the difference between using "is happening" and "during"?

As far as I know, there's no difference.


Top
 Profile Send private message  
 
PostPosted: Sun Jul 15, 2012 9:29 pm 
Offline

Joined: Fri Jul 16, 2010 2:09 pm
Posts: 1950
I believe the meaning is identical, but the places where you can use "during" are more limited. I think it can only appear in rule preambles, and if I'm not mistaken, it can only appear at the end, after the "when" clause if there is one.

If I am mistaken, I hope someone will correct me! :P


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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