Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Prevent things from acquiring a monetary value

13 views
Skip to first unread message

demonboy

unread,
Dec 18, 2010, 3:55:49 AM12/18/10
to
Hi all,

I am a newcomer to both IF and Inform 7. I'm really excited about this
project and just thought I'd send a couple of simple questions via
this newsgroup to see if I'm up and running ok.

I have copied and pasted the Nickle and Dimed example as I want my
player to buy objects. Unfortunately normal objects like a key are
given a value of $0.00. How do I stop Inform from printing the value?

Related to that - when the player finds a sum of money, how do I get
them to pick it up so that the sum is added to their total cashbox?
And how do I give money to a vendor and get them to accept it, making
it subtract from the cashbox? I can't find any examples of this level
of interactivity with money.

Looking forward to further dialogue with IF enthusiasts.

Cheers,

Jamie

Michael Neal Tenuis

unread,
Dec 20, 2010, 12:49:00 AM12/20/10
to
demonboy wrote:
> Hi all,
>
> I am a newcomer to both IF and Inform 7. I'm really excited about this
> project and just thought I'd send a couple of simple questions via
> this newsgroup to see if I'm up and running ok.
>
> I have copied and pasted the Nickle and Dimed example as I want my
> player to buy objects. Unfortunately normal objects like a key are
> given a value of $0.00. How do I stop Inform from printing the value?


Hi,

welcome to the newsgroup and to the IF world!

If you don't want Inform to print the price in the room descriptions,
you need to comment out/delete the following passage from the Nickel and
Dimed example:

Rule for printing room description details of something (called target)
which is for sale (this is the disclose prices in room description
rule): say " ([price of the target])".

> Related to that - when the player finds a sum of money, how do I get
> them to pick it up so that the sum is added to their total cashbox?

The Nickel and Dimed example automatically calculates the player's cash
from the individual bills and coins which she carries. So, as an author,
you just need to put bills or coins somewhere in your game world, like
it's done in the example: "The Bitterly Cold Street contains a dollar
bill." When the player decides to ">take dollar", it will be added to
her inventory.

If you want the player to pick up money automatically, you could do it
by adding the following to the example:

Report going to a location that contains money:
say "As you venture forth, you find some money, which you stuff into
your pocket. Cool!";
repeat with loot running through money in the location:
move the loot to the player.


BTW, the "cashbox" is somethng different - in the example, it's for the
vendor's change (see the comment "It contains all the money that is
available for non-player characters to use in making change").


> And how do I give money to a vendor and get them to accept it, making
> it subtract from the cashbox? I can't find any examples of this level
> of interactivity with money.

In the example, the player doesn't need to ">give dollar to man"
explicitly; it's all handled in the buying action (">buy gum"). The
details of the buying implementation, including the transfer of the
bills etc., can be found in "Section 3 - Purchasing and Sales".

If you don't need your game to keep track of individual bills of varying
denominations, you could also try a less detailed approach to money.
Several examples are listed in the Inform Recipe Book, Chapter 9.4
"Money" (there's a link to the Recipe Book near the bottom of the
Documentation tab).

For giving things to other characters in general, see Chapter 7.4
"Barter and Exchange" of the Recipe Book.


> Looking forward to further dialogue with IF enthusiasts.
>
> Cheers,
>
> Jamie

Regards,
Michael

dott.Piergiorgio

unread,
Dec 20, 2010, 8:08:26 PM12/20/10
to
Il 20/12/2010 06:49, Michael Neal Tenuis ha scritto:

hmmm... thinking on a bit, this ought to be an interesting scene for an IF:

Granted that I came from a country in where chatting trump on business &
productivity, but being involved in many small chat with shop owners and
employers &c not business-related, but more often than not, I came with
interesting tidbits, tips and info, what about something along the line
of having an information or hint (not critical, because is admittely a
RAM (Read Author's Mind) case) having helped an shop owner or employer
in exchanging the small coins/bills needed for change ?
(is indeed a rare episode, but happens that a selling is delayed or even
not done because there are not enough nickel/dime/quarters (or whatever
is the local currency) around to give the exact and expected change to
the (annoying...) customer)

Best regards from Italy,
dott. Piergiorgio.

0 new messages