intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 6:34 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Thu Apr 05, 2012 4:42 pm 
Offline

Joined: Tue Apr 03, 2012 12:30 pm
Posts: 8
I have a pile of sticks. I have the variable, stickCount.
Instead of taking a stick, I increase the stickCount by 1 but that leaves the player's inventory empty.

I could place a dummy object in the player's inventory and give it a printed name that changes from "a stick" to "some sticks" but I have the feeling that this is not the best way to go.

Is there a conventional way to do it?


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:00 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 674
There is a similar problem here. David J Prokopetz gives some code for taking multiple coins. If you replace the coins with sticks, it can give you what you want.

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


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:23 pm 
Offline

Joined: Tue Apr 03, 2012 12:30 pm
Posts: 8
Thanks. One problem, however.

This is the first time I've used any unincluded extensions. I've imported both Multitudes and Conditional Backdrops.

The problem is, when I followed the example in the documentation:
Code:
Gravel is a multitude.

...I get a compile error.

Quote:
Problem. The sentence 'Gravel is a multitude' appears to say two things are the same - I am reading 'Gravel' and 'multitude' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Laurel is Hardy'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Blue-Ridge Mountains is a lighted room' says that something called Blue-Ridge Mountains exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.


Am I meant to use some sort of include/import? I assume I don't need to.


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:29 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 674
When including the multitudes extension you need to add this to your code.

Code:
Include Multitudes by Mike Ciul.


Hope this helps.

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


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:36 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 674
If you wanted to use the dummy object method you could try this.

Code:
"Test"

Rule for printing the name of the stick when taking inventory:
say "[the stick count of the stick in words] stick[s]".

Check taking the pile of sticks:
increase the stick count of the stick by one;
if the player is not carrying the stick, now the player carries the stick;
say "You take a[if the stick count of the stick is greater than one]nother[end if] stick from the pile." instead.

Check dropping the stick:
decrease the stick count of the stick by one;
if the stick count of the stick is zero, remove the stick from play;
say "You place a stick back onto the pile." instead.

A first check dropping rule:
if the noun is the pile of sticks, say "You are not carrying any sticks." instead.

The Testing Room is A Room. A pile of sticks is in the testing room. A stick has a number called the stick count. The stick is proper-named. The stick count of the stick is usually zero. Understand "stick" as the pile of sticks.

Test me with "take stick / i / take stick / i / take stick / i / take stick / i / drop stick / i / drop stick / i / drop stick / i / drop stick / i / drop stick".


It's a simplified version but it does the trick.

Hope this helps.

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


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:39 pm 
Offline

Joined: Tue Apr 03, 2012 12:30 pm
Posts: 8
climbingstars wrote:
When including the multitudes extension you need to add this to your code.

Code:
Include Multitudes by Mike Ciul.


Hope this helps.


Thanks. I got confused by the documentation When any source text is run through Inform, a secret first line is inserted, Believing the include was automatically generated.


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 5:50 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 674
animalsadventurables wrote:
Thanks. I got confused by the documentation When any source text is run through Inform, a secret first line is inserted, Believing the include was automatically generated.


This is just for the standard rules, which is in essence just an extension. You'll need to manually include all the others.

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


Top
 Profile Send private message  
 
PostPosted: Fri Apr 06, 2012 10:45 am 
Offline

Joined: Fri Jul 16, 2010 2:09 pm
Posts: 1950
Thanks for volunteering as a beta tester for Multitudes! :twisted:

Please let me know if the documentation is confusing, or wrong, or if it doesn't work right.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Gorobay and 0 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