.DT gathering Discworld Creator Help gathering .SH Name .SI 5 Gathering - How to use the gathering handler and its data file .SH Overview .SP 5 5 The gather command uses: .EP /obj/handlers/gathering.c and its data file, /obj/gatherables/handler.dat .SP 5 5 The gathering handler draws upon data stored in its data file. All entries in the data file must be correctly completed, or the handler will fail to load and all items which would normally be gatherable, will suddenly stop being gatherable. Items can be made gatherable from just about any source. Most items on the handler are currently in /obj/plants but items in /obj/food and any other directory can be made gatherable. There are currently no restrictions upon this. .EP .SH Adding the item to the data file .SP 5 5 For example, to make nettles gatherable, imagine that the path is /obj/plants/nettle.ob This would then be added to the end of the handler.dat file like so: .EP ::item "nettle":: ::->season:: ({ "spring", "summer", "autumn", "winter" }) ::->quant:: (: random(3) + 3 :) ::->ob:: "/obj/plants/nettle.ob" .SP 5 5 The data in this file is in the form of a mapping, so adding new entries is easy. Before returning the file to RCS, check that the handler (/obj/handlers/gathering.c) loads, and double check that you can still gather items. .EP .SH Adding the item to a room .SP 5 5 Items can be gathered from a room by using the gather command within an add_item as shown below: .EP add_item( "nettle", ({ "long", "Tall and stong, with the occasional white flower, these " "nettles certainly look very stingy indeed.", "gather", ({ "item name", "nettle", "scarcity", 30 }) }); .SP 5 5 The simple addition of: .EP "gather", ({ "item name", "<item>", "scarcity", <value> }) .SP 5 5 in an add_item allows a valid item (one that is in the data file) to be gathered from a room. The scarcity parameter is the percent chance of finding any quantity of the gatherable. This is an additional constraint on finding the gatherable, in addition to any skill requirements and quantity calculations. A scarcity of 100 (the default) indicates no scarcity constraint. A scarcity of 0 means that the gatherable will never be found. .EP .SH Summary .SP 5 5 So, to make an item gatherable: .EP * Create the item. * Add item to /obj/gatherables/handler.dat * Update data file then update handler (/obj/handlers/gathering.c) to ensure that the handler still loads - if not debug it or remove changes until the handler loads. * Add item to the room you want to gather it in. .EP