[I7]After reading command when command is a value?

Okay so Im trying to set up a system that allows for some basic modifications to a light. In this case changing the color so I have color defined as such:

Color is a kind of Value. The Colors are white, red, green. Understand "white" as white. Understand "red" as red. Understand "green" as green.

and I have this to allow for the modification commands

[code]Carry out Modding-Constructs:
if the noun is Floating Ball of Light:
say “[Change-Light]”;
say “You can also be done.[line break]”;
now the command prompt is "Modify Command > ".

To decide whether modding creature:
if the command prompt is "Modify Command > ", yes;
no.

After reading a command when modding creature:
If the player’s command includes “”:
now the color of the floating ball of light is the color understood;
if the player’s command includes “done”:
now the command prompt is "> ";
reject the player’s command.[/code]

And just to show you, here is the light ball code:

Light Orb is a kind of Magical Construct. A Light Orb is lit. A Light Orb is not portable. A Light Orb has a color. Floating Ball of Light is a Light Orb. Floating Ball of Light is white.

If I try to just enter a color it gives me the verb not recognized output. Done works fine though. Does anyone know what is it that I’m missing here?

You’re not rejecting the player’s command when they type a color. This means that the command “white”, for instance, gets passed along to the normal parser, which has no idea what to do with it and gives the “verb not recognized” output. The easy fix is to remove one level of indentation from the last line of code here (“reject the player’s command”).

Unrelated to the main question, though, you don’t need those Understand lines. Inform can parse value names automatically (which is really convenient). You might also want to check whether the player’s command “matches” the color rather than “includes” it, which means that it will interpret “ANYTHING EXCEPT WHITEKHAJHGSFHDG” as an unrecognized value rather than exactly the same as “white”.

You can also make an action apply to one thing and one value, such as “modding is an action applying to one thing and one color”. Then you could accept commands like MOD THE FLOATING ORB TO WHITE, or even MAKE THE ORB WHITE. If you want to parse a bunch of different types of values, not just colors, you can use the built-in “setting it to” action, which takes one object and one blob of text, and then parse the values out of that text just like you’re doing here. (Just replace “the player’s command” with “the topic understood” and move your code into an “instead of setting the floating orb of light to a topic” rule.)

Ah well I knew it was something stupid I did lol, thanks.

I appreciate the suggestions though. They are good, mostly I was just trying to get it to work here so I was probably going to change it up, and I think your ways are pretty good.