I6: Money

Hi all,

I need money. And I want the player to have a certain amount, while an event may create further money. First I looked into the documentation of money.h, but didn’t understand how to handle it. Then I created a multiple object, and it works fine but for one flaw:

take euro
Euro taken.
Euro taken.
Euro taken.
Euro taken.
Euro taken.

How can I turn this into “5 Euro taken.”?

Everyone needs money. You should either try to understand money.h or compile the Multitudes extension into inform6 (not sure if it works). Or create a moneyobject class and have money bags or caches, and have them disappear when taken but add their money-value to player’s money-balance. (That’s what I’d do in an object-oriented language).

Which Multitudes extension do you mean?

Help still needed with this. Can anyone explain to me how money.h works?

I’ve never used money.h, but have you taken a look at greenbacks.inf? It seems to illustrate how to use it.

Sorry, but I still got no idea what to do. I can initially create me X Euro, but how do I create further money that I can pick up and thos combine with the one originally created? Greenbacks.inf doesn’t help me at all I’m afraid.

Does anyone know a game with an in-game currency that has the source code available?

Have you looked at Chapter 29 of the DM4? It seems to address precisely the problem you’re running into.

If you’ve attempted to use the techniques in this chapter, and they aren’t giving you the results you’re hoping for, perhaps you can provide more specifics on where the snag is.

What I’ve achieved so far is to create some Euros and give them to the player. What I want to do is to create some more Euros and put them on the ground. I did so, but they’re individual objects, so “get all” results in “You take the Euro.” X times. I’d like to have the player get them all at once, like “You take the 20 Euros.”. That’s my problem. I can’t seem to find a solution for this in the manual. I assume money.h provides a solution, but I don’t understand how it works.

I haven’t done this before, but have you given the euros the plural and list_together properties?

I’ve just done some experimenting with this. I don’t think it is possible to achieve what you want without directly hacking the library. Even then I can’t immediately think of an easy way to do it. Try to live with it for now.

Have you tried creating a big pile of indistinguishable Euros offstage at the start of the game and then moving some of them to the player and others to the room when you need them? If you do that, does Inform still end up thinking some of them are indistinguishable and some are distinguishable?