Specific question about IF7 coding. Inventory limit system

Firstly, I have never used forums like this before, so please pardon my lack of friendly formatting.

Mainly, I am asking for assistance regarding a couple of coding implementation issues I have been giving myself headaches over for two days now. (I have re-read the ‘Documentation’ completely twice over in that time period…)

  1. I want to apply a weight-class system to objects so as to have certain objects take up a larger proportion of the player inventory than others.
    What I have:
        Mass is a kind of value.
	1Mass specifies a Mass.
	A thing can be Negligible, Light, Medium, Heavy, or Massive.
	The carrying capacity of the player is 10010.
 I want a Negligible object to take up 1 carrying capacity, a Light object to take up 10 carrying capacity, Medium 100, etc. Not clear on how to implement at all I just started Inform7 yesterday.
  1. I don’t want supporters to display their contents until they are specifically looked at by the player using the Look [something] command. (Examine)
    Whenever I tried to do this using various online strategies I either could never see the contents even if I used the Look command or I got an error… in one case the ‘solution’ completely ruined the room description formatting so spacing etc was off. I don’t really have any constructive code relating to this so… that’s that.

Thank you to anyone still reading!

Please help,
Techies.

I would suggest taking a look at the source code for the Bulk Limiter extension which seems to do exactly what you’re wanting. You could decide to use the extension wholesale, or just implement the parts you wish to use.

http://inform7.com/extensions/Eric%20Eve/Bulk%20Limiter/doc_0.html

[code]A table is a supporter in Example Location. An apple and an elvish sword are on the table.

Rule for printing the name of the table while listing contents of the room:
say “interesting table”;
omit contents in listing.[/code]

Thank you for replying, the bulk extension seems promising.

One further question I have is about the supporter code, I wanted to make it a more general case so any generic supporter I make behaves this way. I can’t get the respective name of the supporter to print in the say action…

Rule for printing the name of a supporter while listing contents of the room:
	say "[name of supporter]"; {This line doesn't compile, apparently it's not that simple.}
	omit contents in listing.

Techies

Start with

Rule for printing the name of a supporter (called T) while listing contents of the room:

…and then you can refer to “T” in the rule.

Okay bear with me… about the supporters…
;
Now that I made the most recent change suggestion I got a little further, but now there is this Error

*** Run-time problem P12: Too many activities going on at once.

Produced by this code:

Rule for printing the name of a supporter (called T) while listing contents of the room:
	say "[T]";
	omit contents in listing.

Now there is an infinite loop happening I suspect relating to a Rule saying in response to saying… This is starting to seem so hopeless!

Still, thanks for the help.

Techies

See if this does what you want:

After printing the name of a supporter while listing contents of a room: omit contents in listing.

Another thing you can try:

Rule for printing the name of a supporter (called T) while listing contents of the room: say "[printed name of T]"; omit contents in listing.

If you say “[T]” it goes through the “printing the name of T” activity, which invokes this rule again, hence an infinite loop. But if you say “[printed name of T]” it should just go straight to the printed name property of the object, which is usually what you want.

I

Thank you! It’s finally working exactly as I wanted. Now there is a greater level of depth in exploring each room… Seriously I’m glad you were all here to help, I will probably be making more posts on this site, as the community seems helpful, patient, and friendly.

Hopefully I will become proficient enough at some point to help others.

Techies