intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Jul 21, 2018 10:19 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Jan 10, 2018 4:47 pm 
Offline

Joined: Mon Dec 11, 2017 1:12 pm
Posts: 17
Hello there! Is there a way to implement a container which has an unlimited amount of a kind of thing in it?
I'm thinking along the lines of Extra Supply, but with being able of taking more than just one thing. Thanks in advance.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 10, 2018 4:56 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2634
Location: The Midwest
For reasons of practicality, it'll be best to limit the total number of such things in play. The pizza example under "Dispensers and Supplies of Small Objects" shows how to implement this. Consider how many such objects the player will really want to be carrying with them.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 10, 2018 7:07 pm 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2516
Location: US - Central
If you truly need an "endless" supply of something (like coins or money) it's best to represent it with variables.

For example, a jar of jelly beans: instead of taking the jellybeans, you'd generate a random number between 4 and 10 and say "You grabbed [X] jellybeans!" then add that to the jellybean variable.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jan 11, 2018 2:49 am 
Offline

Joined: Mon Dec 11, 2017 1:12 pm
Posts: 17
The amount should be limited to 5 things at a time and after inserting them into another container they would return to the source. So technically they should only appear unlimited by hiding the amount that is in the initial container and it should never be empty.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jan 11, 2018 11:11 am 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2516
Location: US - Central
Yes, it depends on how "physical" you need your multitudes to be. In Baker of Shireton, the coins you make for selling are physical but limited to (I think?) 50 total in the game. When the player has any more than 30 at a time, the game forces them to drop them all into a piggy bank where they are recycled.

In that game, inserting coins into the bank made the score go up, so it gave the player encouragement for not carrying hundreds of coins. You can do all kinds of tricky things like having an object called "your money" that takes a number variable depending on the amount the player has and then goes away when the variable is 0.

You can think of it how RPGs rarely model individual coins. There's just a pile of loot with a number that disappears when you take it, then that amount is added to your bank.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jan 11, 2018 11:59 am 
Offline

Joined: Mon Dec 11, 2017 1:12 pm
Posts: 17
That sounds good. You need a special container to take the liquids, which are limited to 5 and after a recipe succeeds the liquid is no longer inside the kettle and can return to its original container. Thanks alot!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jan 12, 2018 9:57 am 
Offline

Joined: Mon Dec 11, 2017 1:12 pm
Posts: 17
I started to adapt the Pizza Prince Code to fit the job at hand. If I test it in isolation it works fine. However, in the real code it won't accept the slice system. Any ideas what could be wrong?

Code:
Section - Ingredients

An ingredient is a kind of thing. A is an ingredient. B is an ingredient. C is an ingredient. D is an ingredient. E is
an ingredient. F is an ingredient. G is an ingredient.

Section - Fluid Containers

A fluid container is a kind of container.
Chapter - Liquids

A liquid is a kind of ingredient.
The indefinite article of a liquid is "some".

Instead of taking a liquid:
    say "You can't take the [noun]."

Section - Liquids

The H is a liquid.
The G is a liquid.
The F is a liquid. 

The Spring Itself is a thing in Blood Spring. Understand "G" as the Spring Itself. The description is "They are all
cheese-only, and all luke-warm."

10 G are in G Limbo.

Instead of taking the Spring Itself:
    let chosen slice be a random G in G Limbo;
    if chosen slice is nothing: [That is, there were no slices remaining]
        say "[manager refusal]";
    otherwise:
        move the chosen slice to the player;
        say "Taken (gingerly)."

To say manager refusal:
    say "[one of]'Hey!' barks a hitherto-unseen manager from behind you. 'It's an 'all you can eat' buffet, not
an 'all you can stuff down your pants' buffet.'[or]You are conscious of a disapproving huff from the manager, so
you refrain.[stopping]"

Rule for implicitly taking the Spring Itself:
    let chosen slice be a random G in G Limbo;
    if chosen slice is nothing: [That is, there were no slices remaining]
       say "[manager refusal]";
    otherwise:
        move the chosen slice to the player;
        say "(helping yourself from the spring)";
        now the noun is the chosen slice.

Rule for clarifying the parser's choice of the Spring Itself while taking:
    say "(from the magnificent spring before you)[line break]"


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jan 12, 2018 11:54 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2634
Location: The Midwest
You made G be a single thing rather than a kind of thing. If you want to create "10 G" then you need "a G is a kind of liquid".

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jan 12, 2018 3:25 pm 
Offline

Joined: Mon Dec 11, 2017 1:12 pm
Posts: 17
I noticed that too, but if I make it an ingredient and a kind of liquid or vice versa inform gives me an error message too.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jan 13, 2018 12:24 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5693
What error message?


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

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