LPC data type: mapping A mapping is a sort of associative array. What it does is map values onto keys. A key is any LPC value used to look up a value in the mapping. A mapping declaration looks like this: mapping borg; At this point, the mapping has a NULL value and will cause errors if you try to use it in any operations. The most common error you will find ate this point is "Illegal index." This always means that you have an uninitialized mapping. Mapping constants are enclosed in ([ ]) and one might look like: ([ "strength": 10, "intelligence": 15, "constitution":7 ]) Each element of a mapping, as in an array, is separated by a ",". So the first element of the above mapping is: ([ "strength": 10 ]) where "strength" is the key and 10 is the value. Any LPC data type may serve as a mapping index or value. Be carefule, however, when using objects as indices (keys), since they can cease to exist when the object is destructed. There are several ways of initializing a mapping: mapping borg; borg = ([]); borg = allocate_mapping(10); borg = ([ "strength":10, "intelligence": 15, "consitution": 7 ]); If you know from the start what they keys to your mapping will be AND there are values for those keys from the start (like with player stats), then the last version is the most efficient. If you know how many elements you will have in your mapping, but you do not have values for them yet (or you do not even know what their keys will be) the second method is best. The least effecient method, but most flexible is to simply initialize an empty mapping: borg = ([]); If you have an empty mapping, you can simply create a new element by assigning a value to a key: mapping borg; borg = ([]); borg["strength"] = 10; Note that mappings use the same indexing notation as arrays. This statement reads in English: assign to the elemebt of borg named "strength" the value of 10. Without mappings, for things like player stats you would have to have a query_*() and set_*() function for each individual stat. This of course limited the ease with which any new stats could be added. With a mapping, you only need one set_stats() and one query_stats() function: void set_stats(string stat, int value) { stats[stat] = value; } int query_stats(string stat) { return stats[stat]; }