Hair and Eye color...

Hello all. I would have thought that this was a simple thing to add. Apparently it is not. I have defined eye color, hair color, height and frame as the following:

Hair color is a kind of value. The hair colors are blonde, brunette, black, grey, bald, red, cyan, green, magenta, and purple.  A person has hair color.

Eye color is a kind of value. The eye colors are yellow, brown, grey, blue, red, cyan, green, magenta, and purple. A person has eye color.

A person has a number called height. The height of a person is usually between 48 and 83.

Frame is a kind of value. The frames are lithe, tiny, average, fit, stocky, and large. A person has frame.

For some bizarre reason, this is not working. Any help would be greatly appreciated

The problem is with the “usually between 48 and 83” line. Inform doesn’t know how to interpret that: if you create a person and don’t specify their height, what should it be set to?

Actually, I am getting the following error:

So I haven’t even gotten to that part of the problem.

I’m not getting that error. Are you sure the source you’re attempting to compile is the same as the source that you’ve pasted here? That’s the kind of error you’d get if you had a typo in the code, for instance if you had written “Haircolor is a kind of value” and “Eyecolor is a kind of value” and then specified "the hair colors are… and “the eye colors are…” with a space.

I do get errors with the code you have though. One is what Draconis pointed out–“usually” sets a default value so you have to set a specific value. The other one is that you can’t give hair colors and eye colors the same name–Inform won’t know whether “grey” refers to a hair color or an eye color if you try to use it elsewhere. You might have to say “grey-haired” and the like.

Ok, I think I have fixed that part, but when I do the following:

The hair color of the player is a random hair color. The eye color of the player is a random eye color. The frame of the player is a random frame. The height of the player is a random number between 60 and 83.

I keep getting this error:

What gives?

You have to say: “When play begins: now the hair color of the player is a random hair color.” Inform doesn’t compute random values at compile-time but only in the course of play (note: I don’t really understand the internals so I may be somewhat confused here), so if you’re going to use a random value you have to implement it as a change during the course of play, and you have to tell Inform when to make that change. In this case, “When play begins” tells Inform to make that change as soon as the game begins.

Matt,

Thank you!!

That worked like a charm!!