Help

JS-TWEAKING-ARRAY

For immortals

Ordinarily the tweak code will use a predefined array of stats that it can tweak to, however builders have the option of specifying their own array of stats if they desire to have a more restricted set of options for the equipment to tweak to.

In order to achieve this, you must define an array on the entity (mobile, object or room) that is calling the tweak function, this array must be named tweakTypes. The array itself will contain within it arrays, one array per stat possibility. These sub-arrays will need three elements. The first is the weighting of the stat (See help JS-TWEAKING-WEIGHTING), the second is the limit that stat is permitted to tweak to, and the third is the stat itself. An optional fourth element can be used for a parameter to the stat, eg for resists or savings it is the resist/saving type - blunt/pierce etc for resists, will/ethos etc for savings.

As an example:

var tweakTypes=new Array(new Array(0.5,3,'str'),new Array((12,45,'hit'),
                         new Array(0.5,3,'alldamroll'),new Array(1.3,8,'resist','blunt'));

The above example would create an array of tweak types allowing for strength (capped at 3), hitpoints (capped at 45), alldamroll (capped at 3) and resist blunt (capped at 8).

Once this array has been defined, you can then call the tweak function as normal.

If defining the stat caps yourself, try not to stray too far from those defined in the default array at the start of behavior one of room 90. These values have been thoroughly tested for overall game balance and anything straying too far from this may result in balance issues.

Last edited by Engada in June 2006.