search:

General



Rooms & Areas



Presence



Systems



Wiki Help



pmwiki.org



edit menu
Edit Page Upload Security

You can use SUPER_PARSE to handle something like AFFIX [MY] [<number>] [<desc>] <item> TO [<number>] [<desc>] <item>

It has a default search order that commits searches to specific types of data and in certain locations. The default search goes through: players, NPCs, and then objects. When it searches through objects, the default order is the same as FIND_OBJECT_ALWAYS (which only accepts a noun and no other parameters, unfortunately), and that is: player's hands, object on ground in player's room, held/worn object in player's posession, object in a container that player is holding or wearing, and finally objects in a container on the ground in player's room.

SUPER_PARSE is smart enough to know that it should always match on whole words first, giving that priority over the order of player, NPC, and object targets. For example, if I type "wave ball", the parser will locate an object named 'ball' before a player named 'Ballkor'.

SUPER_PARSE syntax:

SUPER_PARSE
This method will use mode 0 (or any mode set by _sp) and $line as the input text.
SUPER_PARSE <mode #>
This method will create and set _sp to <mode #> and use that mode in the search. $line will be used as the input text.
SUPER_PARSE <dummy command> <custom text>
This method will use mode 0 (or any mode set by _sp) and <custom text> as the input text. <dummy command> must be supplied, which is skipped by the parsing process.

To modify SUPER_PARSE's default behavior, create custom INT variables named and set to the following:

_sp
Parse mode for SUPER_PARSE to operate.
_sp_invisobject
Overrides whether or not SUPER_PARSE should locate invisible objects that a player would normally not be able to manipulate. Set to (1) for YES. Default is (0), no (so you don't need to create/set this variable if you want 'no').
_sp_hiddenplayer
Overrides whether or not SUPER_PARSE should locate hidden players that a player would normally not be able to interact with. Set to (1) for YES. Default is (0), no (so you don't need to create/set this variable if you want 'no').
_sp_invisplayer
Overrides whether or not SUPER_PARSE should locate invisible players that a player would normally not be able to interact with. Set to (1) for YES. Default is (0), no (so you don't need to create/set this variable if you want 'no'). Players cannot be invisible at the time of this writing, but will eventually.
_sp_invisstaff
Overrides whether or not SUPER_PARSE should locate invisible staff characters that a player would normally not be able to interact with. Set to (1) for YES. Default is (0), no (so you don't need to create/set this variable if you want 'no').

SUPER_PARSE modes and methods:

mode 0
Default, no need to set explicitly
mode 1
Only find object targets, in the default object search order (as like FIND_OBJECT_ALWAYS)
mode 2
Only find player targets
mode 3
Only find NPC targets
mode 4
Only find player and NPC targets (attackable targets)
mode 5
Only find player targets, no invisibility or room restriction (replacement for FIND_PLAYER_IN_WORLD)
mode 6
Find object targets, then NPCs, then players, but change how objects are searched as follows: room, player's hands, held/worn, in player's container, in room's container.
mode 7
Find object targets, then NPCs, then players, but change how objects are searched as follows: player's hands, room, in room's container, held/worn, in player's container.
mode 8 (and 9)
Find object targets, then NPCs, then players, but change how objects are searched as follows: preposition between object1 and <any target> does not restrict location of object1. This is used when you are finding two objects (or an object and a player, or an object and an NPC) that are independant of each other (for example when you need to WAVE WAND AT <target> OR SMASH ROCK WITH HAMMER).
mode 10
Find object targets, then NPCs, then players, but change how objects are searched as follows: return all text beginning with first preposition. Do not parse any possible additional targets. This is useful for parsing syntax such as "TEND BOB LEFT ARM".

(modes #8 and #9 function exactly the same: the logic may change slightly later, one is intended specificly for OBJECT WITH OBJECT and one is intended for OBJECT AT TARGET, so technically #8 shouldn't search through players or NPC's for the second target, but it will anyway right now)

SUPER_PARSE understands number parsing up to twentieth, whereas FIND_COMPLEX_OBJECT_xxx commands only accepted up to tenth.

Recent Changes - Page History - Printable View
Page last modified on June 03, 2005, at 06:38 AM EST
PmWiki 2.20-beta16 - www.PmWiki.org