A
          / \      _                                               Nemesis on 
          | |     | |  _______   _        _   _______    _______   _    _______
          | |\    | | |   ____| |  \    /  | |   ____|  /   ____| | |  /   ____|
 /-------/-------------------------------------------------------------------,
O= Home <=XX|  About  News  Pics  Adventurers  Wizards  Download  Connect     >
 \-------\-------------------------------------------------------------------'
          | |   \   | |  |____  | |      | | |  |____   ___ \  \  | |  ___ \  \
          | |     \_| |_______| |_|      |_| |_______| |_______/  |_| |_______/
          \ /
           V  

Documentation Area

Document path: /doc/object/reset


Lfun:	reset - reset occurrence
 
Synopsis:
	void reset(int flag)

Description:
	The reset function is called at two occasions.

	With flag 0, when the object has just been created.

	With flag 1, every time it is resetted. Normally all 1-2 hours a
	reset occurs.

	Notice that when you clone an object for the first, actually two
	reset(0) are performed: one in the blueprint object, and one in
	the clone. You should almost always leave a blueprint unitialized
	as the example below will show.
	If a room creates things when reset, it should check that these
	objects are gone before creating new ones. You can use PROVIDE
	for this purpose.

Return value: ignored

Examples:
	reset(a) {
		if (a || !clonep(ME)) return;
		set_data(...);
	}

	The initialization of an armour could look somewhat like this.
	The first line leaves the function if reset() is not performing
	for the first time or this_object is not a clone, but the blueprint.
	The second line then sets up the item with proper data.

See also:


This page was generated in LPC

Imprint / Impressum