A
/ \ _ Play Now Nemesis on
| | | | _______ _ _ _______ _______ _ _______
| |\ | | | ____| | \ / | | ____| / ____| | | / ____|
/-------/-------------------------------------------------------------------,
O= Home <=XX| About News Pics Adventurers Wizards Download Connect >
\-------\-------------------------------------------------------------------'
| | \ | | |____ | | | | | |____ ___ \ \ | | ___ \ \
| | \_| |_______| |_| |_| |_______| |_______/ |_| |_______/
\ /
V
Documentation Area
Document Path: /doc/room/set_items
Name: set_items - set room item IDs and descriptions in a room
Synopsis:
#include <room2.h>
void set_items(string *items_arr)
Description:
The set_items call sets the item identifiers and descriptions in a
room. Room items are entities in a room a player can look at.
Normally everything that is mentioned in the long description should
have an item description. Recursive item descriptions are possible
and appreciated, too: an item is described via an other item. This
other item's description points back to the first item.
The single argument is an array of even length with an room item ID
specification and description after each other. Set_items affects
the long and id function in the room.
The ID specification is a string containing one ore more IDs,
separated with a '#' - see Examples:.
Or it is "sub-array" in the list of items. Technically the notation
with sub-arrays is the way as multiple items are stored in the room.
Query_items (see 'man room/query_items') returns the list items in
room also as an array with sub-arrays, an array of arrays. So it is
useful and makes sense to support this notation, too.
The description is a string which will be automatically completed by
a '.' if the last char of the description is not a '!', '?' or a ' '
('<space>').
For dynamic items the description string could be an expression like
"@@func@@", too. "func" is handled by the efun process_string (see
'man efun/process_string'). Therefore functions can be called also
in other objects and arguments can be submitted. "func" called is
called when a player looks at this room item.
Return value: none
Examples:
set_items( ({
"tree#apple tree", "The tree is full of apples"
}) );
set_items( ({
({ "tree", "apple tree" }), "The tree is full of green apples"
}) );
set_items( ({
"tree#apple tree", "@@show_tree@@"
}) );
set_items( ({
"tree#apple tree" , "@@show_tree:players/bla/room|tree@@"
}) );
Notes:
All above meantioned features also are available in set_day_items
and set_night_items - see also 'man room/set_day_items' and 'man
room/set_night_items'.
More about all types of room items can be found in the tutorial
about room coding in the inner guild on the pages 8, 10 and 17 or
or via https://nemesis.de/lpc/doc/room2/page8 (items in general),
https://nemesis.de/lpc/doc/room2/page10 (day & night items) and
https://nemesis.de/lpc/doc/room2/page17 (dynamic room items).
See also:
This page was generated in LPC
Imprint / Impressum