Ordinal Matching
---++Ordinal Matching
There are lots of situation in the game where there will be objects available to you that have the same name. For instance, you've just killed a chud, and now another chud has shown up and is wailing its lungs out at the sight of its fallen brother. You want to put an end to this insepid shreiking, but when you type 'kill chud' it tells you 'Relax, the chud is already dead.' No he's not, he's standing right here!
What's going on here is that the command parser is using the first object it finds that matched what you typed. Since both the dead chud and the live chud will match 'chud', it simply chooses the first one it finds. Great. So how are we going to make the _living_ chud into steaks? This is where ordinal matching comes in.
If you want to refer to a specific object when there are multiple matches, you will need to specify its ordinal. Ordinals are numbers like 'first', 'second', 'third', 'ninety-ninth', etc. So in order to pulverize the chud in this situation, you would need to say:
<pre>
kill second chud
</pre>
Now the command parser can tell exactly which chud you're talking about. I know what you're thinking... what order does the command parser number these things with? It's very simple. First, the parser looks are things you're carrying. If you have forty-two pogs, 'first pog' through 'forty-second pog' will match on objects in your own inventory. After that, the parser takes objects in the room with you into account. So if you still had your forty-two pogs, and there were also ten in the room, saying:
<pre>
get forty-fifth pog
</pre>
would target the third pog that it matched _in the room_.
You can also use numbers, as in:
<pre>
get 45th pog
</pre>
-- Main.SpunKy - 30 Apr 2004