Hello,
Ok, I’m off and running and after a couple days, I’m already pretty pleased with my progress. I am attempting something fairly complex, though, and while I’ve got it almost solved, I’m hoping it can be better still.
It involves a new action ‘reading’ (which is no longer the same as examining.) Essentially, the game contains magic scrolls. If the player just says ‘read scroll’, I want it give a general description. In this case, he is reading it to himself, not out loud, so the spell is not actually cast. Whereas ‘read scroll aloud’ should read it out loud and results in the spell being cast (making him invisible, for example.) And, to make it even more complicated, you should be able to read it to someone and the spell targets them. ‘read scroll to the druid’ should read it out loud targetting the druid - making him invisible - instead of the reader. Needless to say, this is pretty complicated…
The first problem is that reading is already a synonym for examining. I solved that with:
Understand the command "read" as something new.
The second problem is separating reading silently to one’s self to reading aloud. I basically solved this by creating two different actions and using “Understand” commands to distinguish:
[code]Reading silently is an action applying to one thing and requiring light.
Understand “read [something]” as reading silently.
Reading aloud it to is an action applying to two things and requiring light.
Understand “read [something] to [something]” as reading aloud it to.[/code]
This got the job done and makes sense to me (as in, it doesn’t seem too kludgy.) But then there’s the final problem. Reading something aloud without a target. It seems an action either applies to one thing or two things and can’t be both. So I solved this with the “rule for supplying a missing second noun” trick:
Understand "read [something] aloud" as reading aloud it.
Understand "read [something] out loud" as reading aloud it.
Rule for supplying a missing second noun while reading aloud (this is the reading aloud to myself rule):
now the second noun is the player.
Victory! Well, almost … If I understand what I’ve read correctly, (and I haven’t tested it yet), there is still one problem. Reading aloud without a target will always target the player. But what if the player isn’t the one doing the reading? “Druid, read the scroll aloud” will result in the druid reading it out loud, but it won’t turn him invisible, as it should, it will still turn me invisible. I thought the solution to that was simply to set the second noun to “actor” rather than “player” but that does not compile, and it seems that it should.
So, does anyone know how to solve this problem so it works generically? I do have an idea, but it would be an ugly kludge. Basically, instead of setting the second noun to the player, set it to some special object the player can never find out about and then have the various rules that carry out spellcasting check for this and handle correctly. I’m hoping there’s a cleaner way.
Also, if there is a better approach to this whole reading thing, that would also be good to know