intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Jun 20, 2013 5:31 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Tue Apr 17, 2012 2:14 pm 
Offline

Joined: Sun Mar 01, 2009 8:02 pm
Posts: 904
Hardwater wrote:
And now for Question #....what am at, 5 now? How many do I get before the interactive fiction community bans me for life? 4? :)

You'll find that folks in this community are extraordinarily willing to respond to questions. Inform 7 is not a simple system, so newcomers often need help getting their brains wrapped around it. Even the more experienced users (except Zarf and Emily) have questions from time to time.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 3:51 pm 
Offline

Joined: Mon Apr 16, 2012 12:33 am
Posts: 10
Juhana wrote:
You need a bit of math for the "every X turns" thing.

Code:
Every turn when the remainder after dividing the turn count by 5 is 0:
   say "Ding!"

You could use a variable or scenes, but this is the one-liner solution.


That's very nice and simple. However, I think I need variables as I need to track each character individually and not have them all speak at once.

Here is my broken code below, as I attempt to wrap my head around assigning a variable to characters, searching through them all, and altering that variable.

Code:
Anders has a number called babble.

Every turn:
   repeat with temp running through people who are not the player:
      [somehow check to see if the player can see the temp character]
            increase the babble [temp] by 1;
            [if the babble temp is 4 then]:
                  [say a random phrase];
                  [reset the temp's babble to 0].


Am I on the right track here?


Tom / Hardwater


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 4:31 pm 
Offline

Joined: Wed Jan 19, 2011 3:36 pm
Posts: 99
Hardwater wrote:
Here is my broken code below, as I attempt to wrap my head around assigning a variable to characters, searching through them all, and altering that variable.

Code:
Anders has a number called babble.

Every turn:
   repeat with temp running through people who are not the player:
      [somehow check to see if the player can see the temp character]
            increase the babble [temp] by 1;
            [if the babble temp is 4 then]:
                  [say a random phrase];
                  [reset the temp's babble to 0].


Am I on the right track here?


Tom / Hardwater


You can just write this:
Code:
If the player can see temp:


You probably also want to write this, instead of making it specific to Anders:
Code:
A person has a number called babble.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 5:02 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 999
Location: Gothenburg, Sweden
Here's a pretty flexible variant.
Code:
The Place is a room.
Igbut is a person in place.
A person has a number called babble. The babble of a person is usually 4.
A person has a text called gibberish.
The gibberish of a person is usually "[one of]Fee![or]Fie![or]Foo![or]Fum![at random]".
The gibberish of the player is "[one of]Hic.[or]Haec.[or]Hoc.[purely at random]".
The babble of the player is 5.

Every turn:
   repeat with chatter running through persons:
      if the remainder after dividing the turn count by the babble of the chatter is 0 and the chatter is visible:
         say the gibberish of the chatter.

Test me with "z / z / z / z / z / z / z / z / z / z / z / z".

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 5:56 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 706
Jim Aikin wrote:
You'll find that folks in this community are extraordinarily willing to respond to questions.


Perhaps too willing! :)

_________________
"Will you stop breaking the fourth wall? It's costing me an absolute fortune to replace it!"


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 6:40 pm 
Offline

Joined: Mon Apr 16, 2012 12:33 am
Posts: 10
Thank you so much.

I've got different characters up and running saying all sorts of things right when they're met and then every few turns after that. I'm slowly forcing Inform into my head.


Tom / Hardwater


Top
 Profile Send private message  
 
PostPosted: Tue Apr 17, 2012 11:40 pm 
Offline

Joined: Tue Dec 25, 2007 10:06 am
Posts: 898
Hardwater wrote:
Juhana wrote:
Code:
Every turn when the remainder after dividing the turn count by 5 is 0:
   say "Ding!"


That's very nice and simple. However, I think I need variables as I need to track each character individually and not have them all speak at once.

You can phase it by changing the remainder:

Code:
Every turn when the remainder after dividing the turn count by 5 is 0:
   say "Ding!"

Every turn when the remainder after dividing the turn count by 5 is 1:
   say "Dong!"

Every turn when the remainder after dividing the turn count by 5 is 2:
   say "Bing!"

But yes, you get more flexibility using other methods.

_________________
Vorple UI libraryBeta testing siteBlog


Top
 Profile Send private message  
 
PostPosted: Wed Apr 18, 2012 1:47 am 
Offline

Joined: Wed Oct 13, 2010 1:42 am
Posts: 343
Here is a way to do it without any math. Each player "says" something every turn, but most of the time the statement they say is nothing ("run paragraph on" keeps it from printing extraneous line breaks):

Code:
The place is a room.

Igbut is a person in the place.
A person has a text called gibberish.
The gibberish of a person is usually "[one of][gib1][or][run paragraph on][or][run paragraph on][or][run paragraph on][cycling]".
The gibberish of the player is "[one of][gib2][or][run paragraph on][or][run paragraph on][or][run paragraph on][or][run paragraph on][cycling]".

To say gib1:
   say "[one of]Fee![or]Fie![or]Foo![or]Fum![at random]".
   
To say gib2:
   say "[one of]Hic.[or]Haec.[or]Hoc.[purely at random]".

Every turn:
   repeat with chatter running through persons:
      say the gibberish of the chatter.


To change on which particular turn the character speaks, swap the [gib1] text token with one of the [run paragraph on] tokens. If you'd rather they say something one random turn out of 5 (or however many) rather than every fifth turn, replace "cycling" with "at random".


Top
 Profile Send private message  
 
PostPosted: Wed Apr 18, 2012 3:14 pm 
Offline

Joined: Wed Jan 19, 2011 3:36 pm
Posts: 99
katz wrote:
To change on which particular turn the character speaks, swap the [gib1] text token with one of the [run paragraph on] tokens. If you'd rather they say something one random turn out of 5 (or however many) rather than every fifth turn, replace "cycling" with "at random".

As a matter of personal preference, I'd use "in random order" instead of "at random". That way, you always get it exactly once every 5 turns (instead of once every 5 turns on average), although when in those 5 turns is unpredictable. On the other hand, "at random" ensures you won't get the same output printed twice in a row, which "in random order" does not guarantee (although it is somewhat unlikely, at least).


Top
 Profile Send private message  
 
PostPosted: Fri Apr 20, 2012 2:30 pm 
Offline

Joined: Mon Apr 16, 2012 12:33 am
Posts: 10
Is there a method to combine multiple Insteads?

I have a Flight Stick object that I don't want to be pushed, pulled, or new action: grabbed.

Code:
Instead of pulling flight stick:
   say "no".


Do I write three separate versions of the code above or can the actions be combined with some sort of Understand that is specific only to flight stick?


Thanks,

Tom / Hardwater


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

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