Jump to content

RND___.2DA descriptions


Ascension64

Recommended Posts

UPDATED: 29 November 2005

 

Recent woes with BGT-WeiDU have resulted in me discerning the full format of RNDEQUIP.2DA, RNDTREAS.2DA, RNDMAGIC.2DA, RNDWEP.2DA, and RNDSCROL.2DA, of which I make the following submissions:

 

RNDEQUIP.2DA

 

This file defines what items are generated when a creature uses an item of filename RNDEQUx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDEQUIP.2DA is read), and #=the row number of RNDEQUIP.2DA to use (can be 1-9).  RNDEQUx#.ITM is replaced by the generated item.  Therefore, this works like a random treasure table.

 

The first column of RNDEQUIP.2DA specifies the name of the row, currently a simple generic name.  The rest of the 20 columns have headers 1, 2, 3, 4, 5, ..., 18, 19, 20.  Note that this is different from RNDTREAS.2DA and RNDMAGIC.2DA, which do not have the column labelled '1', but similar to RNDSCROL.2DA and RNDWEP.2DA.  Only 21 columns in total are supported, else the 2da file will fail to work entirely.  When this happens, all RNDEQUx#.ITMs are replaced by erroneous invisible items that cannot be removed.

 

The BG2:ToB version of RNDEQUIP.2DA is shown below.  As an example of how RNDEQUIP.2DA is used, a creature has the item RNDEQU01.ITM.  As soon as the creature is created, row 1 of RNDEQUIP.2DA is read.  A D20 is rolled, and produces a value of 6.  Row 1, column 6 reads LEAT05.  Therefore, RNDEQU01.ITM on that creature is replaced by LEAT05.

 

<insert BG2:ToB version of RNDEQUIP.2DA>

 

RNDEQUIP.2DA supports 9 functional rows of random treasure.  Rows 10 and above are completely ignored.  If RNDEQUx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDEQUx#.ITM is replaced by an erroneous invisible item that cannot be removed.  Note that the replacing item is NOT RNDEQUx#.ITM itself, in this case.

 

Items that can be referenced:

-specific items, such as LEAT05 in the above example (for stackable items, a *# suffix, that is, an asterisk followed by a number, can be added to the item ResRef to specify the amount of that item to create, e.g. BOLT04*4 generates a single stack of 4 BOLT04 items; for non-stackable items, a *# suffix does nothing; the limitations on the size of # are the same as that for gold pieces described below)

-#, that is, a number, refers to a gold value (e.g. #=016 replaces RNDEQUx#.ITM with a stack of 16 gold).  The maximum stack of gold allowable is 256 pieces.  More than that listed will max out at 231 (interestingly, this is the remainder when you divide 256 into 999; # need not be three digits, so if #=4 or #=04 or #-004, a stack of 4 gold will still be generated without error)-*, that is, a single asterisk, generates an erroneous item, i.e. an invisible item that cannot be removed.  This is useful if you want your creature not to drop anything, but you do not want to use this for containers and item piles

-RNDMAG##, which references RNDMAGIC.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDSCR##, which references RNDSCROL.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDTRE##, which references RNDTREAS.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDWEP##, which references RNDWEP.2DA, where ##=row number to use, allowing a third level of randomisation; a D20 is rolled to determine which column of this file to use

 

Items that cannot be referenced:

-RNDEQU##; using this will create RNDEQU##.ITM, exactly as it is (circular loops are not possible)

 

Since RNDEQUIP.2DA can reference RNDTREAS.2DA, RNDMAGIC.2DA, RNDSCROL.2DA, and RNDWEP.2DA, this 2da file is the top of the random treasure table hierarchy.

 

RNDTREAS.2DA

 

This file defines what items are generated when a creature uses an item of filename RNDTREx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDTREAS.2DA is read), and #=the row number of RNDTREAS.2DA to use (can be 1-9).  RNDTREx#.ITM is replaced by the generated item.  Therefore, this works like a random treasure table.

 

The first column of RNDTREAS.2DA specifies the name of the row, currently a simple generic name.  The rest of the 19 columns have headers 2, 3, 4, 5, ..., 18, 19, 20.  The column used is specified by a roll of a D20, with rolls of 1 replacing RNDTREx#.ITM with no item.  Note that this is different from RNDEQUIP.2DA, RNDSCROL.2DA, and RNDWEP.2DA, which have an extra column labelled '1', but similar to RNDMAGIC.2DA.  Only 20 columns in total are supported, else the 2da file will fail to work entirely.  When this happens, all RNDTREx#.ITMs are replaced by erroneous invisible items that cannot be removed.

 

The BG2:ToB version of RNDTREAS.2DA is shown below.  In essence, RNDTREAS.2DA works exactly the same as RNDEQUIP.2DA, so see RNDEQUIP.2DA for an example of how RNDTREAS.2DA works.  However, RNDTREAS.2DA can be directly referenced by RNDEQUIP.2DA without actually having RNDTREx#.ITM as a resource.  For example, an entry in RNDEQUIP.2DA that reads RNDTRE05, and a D20 roll of 6 will replace RNDTREx#.ITM with AMUL12.

 

<insert BG2:ToB version of RNDTREAS.2DA>

 

RNDTREAS.2DA supports 9 functional rows of random treasure.  Rows 10 and above are completely ignored.  If RNDTREx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDTREx#.ITM is replaced by an erroneous invisible item that cannot be removed.  Note that the replacing item is NOT RNDTREx#.ITM itself, in this case.

 

Items that can be referenced:

-specific items (for stackable items, a *# suffix, that is, an asterisk followed by a number, can be added to the item ResRef to specify the amount of that item to create, e.g. BOLT04*4 generates a single stack of 4 BOLT04 items; for non-stackable items, a *# suffix does nothing; the limitations on the size of # are the same as that for gold pieces described below)

-#, that is, a number, refers to a gold value (e.g. #=016 replaces RNDTREx#.ITM with a stack of 16 gold).  The maximum stack of gold allowable is 256 pieces.  More than that listed will max out at 231 (interestingly, this is the remainder when you divide 256 into 999; # need not be three digits, so if #=4 or #=04 or #-004, a stack of 4 gold will still be generated without error)-*, that is, a single asterisk, generates an erroneous item, i.e. an invisible item that cannot be removed.  This is useful if you want your creature not to drop anything, but you do not want to use this for containers and item piles

-RNDMAG##, which references RNDMAGIC.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDSCR##, which references RNDSCROL.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDWEP##, which references RNDWEP.2DA, where ##=row number to use, allowing a third level of randomisation; a D20 is rolled to determine which column of this file to use

 

Items that cannot be referenced:

-RNDEQU##; using this will create RNDEQU##.ITM, exactly as it is (circular loops are not possible)

-RNDTRE##; using this will create RNDTRE##.ITM, exactly as it is (circular loops are not possible)

 

Since RNDTREAS.2DA can reference RNDMAGIC.2DA, RNDSCROL.2DA, and RNDWEP.2DA but not RNDEQUIP.2DA, this 2da file is the second to the top of the random treasure table hierarchy.

 

RNDMAGIC.2DA

 

This file defines what items are generated when a creature uses an item of filename RNDMAGx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDMAGIC.2DA is read), and #=the row number of RNDMAGIC.2DA to use (can be 1-9).  RNDMAGx#.ITM is replaced by the generated item.  Therefore, this works like a random treasure table.

 

The first column of RNDMAGIC.2DA specifies the name of the row, currently a simple generic name.  The rest of the 19 columns have headers 2, 3, 4, 5, ..., 18, 19, 20.  The column used is specified by a roll of a D20, with rolls of 1 replacing RNDTREx#.ITM with no item.  Note that this is different from RNDEQUIP.2DA, RNDSCROL.2DA, and RNDWEP.2DA, which have an extra column labelled '1', but similar to RNDTREAS.2DA.  Only 20 columns in total are supported, else the 2da file will fail to work entirely.  When this happens, all RNDTREx#.ITMs are replaced by erroneous invisible items that cannot be removed.

 

The BG2:ToB version of RNDMAGIC.2DA is shown below.  In essence, RNDMAGIC.2DA works exactly the same as RNDEQUIP.2DA, so see RNDEQUIP.2DA for an example of how RNDMAGIC.2DA works.  However, RNDMAGIC.2DA can be directly referenced by RNDTREAS.2DA or RNDEQUIP.2DA without actually having RNDMAGx#.ITM as a resource.  For example, an entry in RNDTREAS.2DA that reads RNDMAG03, and a D20 roll of 3 will replace RNDTREx#.ITM with BOLT05.

 

<insert BG2:ToB version of RNDMAGIC.2DA>

 

RNDMAGIC.2DA supports 9 functional rows of random treasure.  Rows 10 and above are completely ignored.  If RNDMAGx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDMAGx#.ITM is replaced by an erroneous invisible item that cannot be removed.  Note that the replacing item is NOT RNDMAGx#.ITM itself, in this case.

 

Items that can be referenced:

-specific items (for stackable items, a *# suffix, that is, an asterisk followed by a number, can be added to the item ResRef to specify the amount of that item to create, e.g. BOLT04*4 generates a single stack of 4 BOLT04 items; for non-stackable items, a *# suffix does nothing; the limitations on the size of # are the same as that for gold pieces described below)

-#, that is, a number, refers to a gold value (e.g. #=016 replaces RNDMAGx#.ITM with a stack of 16 gold).  The maximum stack of gold allowable is 256 pieces.  More than that listed will max out at 231 (interestingly, this is the remainder when you divide 256 into 999; # need not be three digits, so if #=4 or #=04 or #-004, a stack of 4 gold will still be generated without error)-*, that is, a single asterisk, generates an erroneous item, i.e. an invisible item that cannot be removed.  This is useful if you want your creature not to drop anything, but you do not want to use this for containers and item piles

-RNDSCR##, which references RNDSCROL.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

-RNDWEP##, which references RNDWEP.2DA, where ##=row number to use, allowing a third level of randomisation; a D20 is rolled to determine which column of this file to use

 

Items that cannot be referenced:

-RNDEQU##; using this will create RNDEQU##.ITM, exactly as it is (circular loops are not possible)

-RNDMAG##; using this will create RNDMAG##.ITM, exactly as it is (circular loops are not possible)

-RNDTRE##; using this will create RNDTRE##.ITM, exactly as it is (circular loops are not possible)

 

Since RNDMAGIC.2DA can reference RNDSCROL.2DA and RNDWEP.2DA but not RNDTREAS.2DA nor RNDEQUIP.2DA, this 2da file is the third to the top of the random treasure table hierarchy.

 

RNDWEP.2DA

 

This file defines what items are generated when a creature uses an item of filename RNDWEPx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDMAGIC.2DA is read), and #=the row number of RNDWEP.2DA to use (can be 1-9).  RNDWEPx#.ITM is replaced by the generated item.  Therefore, this works like a random treasure table.

 

The first column of RNDWEP.2DA specifies the name of the row, currently a simple generic name.  The rest of the 20 columns have headers 1, 2, 3, 4, 5, ..., 18, 19, 20.  The column used is specified by a roll of a D20.  Note that this is different from RNDTREAS.2DA and RNDMAGIC.2DA, which do not have the column labelled '1', but similar to RNDSCROL.2DA and RNDEQUIP.2DA.  Only 21 columns in total are supported, else the 2da file will fail to work entirely.  When this happens, all RNDWEPx#.ITMs are replaced by erroneous invisible items that cannot be removed.

 

The BG2:ToB version of RNDWEP.2DA is shown below.  In essence, RNDWEP.2DA works exactly the same as RNDEQUIP.2DA, so see RNDEQUIP.2DA for an example of how RNDWEP.2DA works.  However, RNDWEP.2DA can be directly referenced by RNDEQUIP.2DA, RNDTREAS.2DA or RNDMAGIC.2DA without actually having RNDWEPx#.ITM as a resource.  For example, an entry in RNDMAGIC.2DA that reads RNDWEP03, and a D20 roll of 3 will replace RNDWEPx#.ITM with CHAN05.

 

<insert BG2:ToB version of RNDWEP.2DA>

 

RNDWEP.2DA supports 9 functional rows of random treasure.  Rows 10 and above are completely ignored.  If RNDWEPx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDWEPx#.ITM is replaced by an erroneous invisible item that cannot be removed.  Note that the replacing item is NOT RNDWEPx#.ITM itself, in this case.

 

Items that can be referenced:

-specific items (for stackable items, a *# suffix, that is, an asterisk followed by a number, can be added to the item ResRef to specify the amount of that item to create, e.g. BOLT04*4 generates a single stack of 4 BOLT04 items; for non-stackable items, a *# suffix does nothing; the limitations on the size of # are the same as that for gold pieces described below)

-#, that is, a number, refers to a gold value (e.g. #=016 replaces RNDWEPx#.ITM with a stack of 16 gold).  The maximum stack of gold allowable is 256 pieces.  More than that listed will max out at 231 (interestingly, this is the remainder when you divide 256 into 999; # need not be three digits, so if #=4 or #=04 or #-004, a stack of 4 gold will still be generated without error)-*, that is, a single asterisk, generates an erroneous item, i.e. an invisible item that cannot be removed.  This is useful if you want your creature not to drop anything, but you do not want to use this for containers and item piles

-RNDSCR##, which references RNDSCROL.2DA, where ##=row number to use, allowing further randomisation; a D20 is rolled to determine which column of this file to use

 

Items that cannot be referenced:

-RNDEQU##; using this will create RNDEQU##.ITM, exactly as it is (circular loops are not possible)

-RNDMAG##; using this will create an erroneous item that cannot be removed

-RNDTRE##; using this will create RNDTRE##.ITM, exactly as it is (circular loops are not possible)

-RNDWEP##; using this will create RNDWEP##.ITM, exactly as it is (circular loops are not possible)

 

Since RNDWEP.2DA can reference RNDSCROL.2DA but not RNDMAGIC.2DA nor RNDTREAS.2DA nor RNDEQUIP.2DA, this 2da file is the fourth to the top of the random treasure table hierarchy.

 

RNDSCROL.2DA

 

This file defines what items are generated when a creature uses an item of filename RNDSCRx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDMAGIC.2DA is read), and #=the row number of RNDSCROL.2DA to use (can be 1-9).  RNDSCRx#.ITM is replaced by the generated item.  Therefore, this works like a random treasure table.

 

The first column of RNDSCROL.2DA specifies the name of the row, currently a simple generic name.  The rest of the 20 columns have headers 1, 2, 3, 4, 5, ..., 18, 19, 20.  The column used is specified by a roll of a D20.  Note that this is different from RNDTREAS.2DA and RNDMAGIC.2DA, which do not have the column labelled '1', but similar to RNDWEP.2DA and RNDEQUIP.2DA.  Only 21 columns in total are supported, else the 2da file will fail to work entirely.  When this happens, all RNDSCRx#.ITMs are replaced by erroneous invisible items that cannot be removed.

 

The BG2:ToB version of RNDSCROL.2DA is shown below.  In essence, RNDSCROL.2DA works exactly the same as RNDEQUIP.2DA, so see RNDEQUIP.2DA for an example of how RNDSCROL.2DA works.  However, RNDSCROL.2DA can be directly referenced by RNDEQUIP.2DA, RNDTREAS.2DA, RNDMAGIC.2DA, or RNDWEP.2DA without actually having RNDSCRx#.ITM as a resource.  For example, an entry in RNDWEP.2DA that reads RNDSCRL03, and a D20 roll of 3 will replace RNDSCRx#.ITM with SCRL9F.

 

<insert BG2:ToB version of RNDSCROL.2DA>

 

RNDSCROL.2DA supports 9 functional rows of random treasure.  Rows 10 and above are completely ignored.  If RNDSCRx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDSCRx#.ITM is replaced by an erroneous invisible item that cannot be removed.  Note that the replacing item is NOT RNDSCRx#.ITM itself, in this case.

 

Items that can be referenced:

-specific items (for stackable items, a *# suffix, that is, an asterisk followed by a number, can be added to the item ResRef to specify the amount of that item to create, e.g. BOLT04*4 generates a single stack of 4 BOLT04 items; for non-stackable items, a *# suffix does nothing; the limitations on the size of # are the same as that for gold pieces described below)

-#, that is, a number, refers to a gold value (e.g. #=016 replaces RNDSCRx#.ITM with a stack of 16 gold).  The maximum stack of gold allowable is 256 pieces.  More than that listed will max out at 231 (interestingly, this is the remainder when you divide 256 into 999; # need not be three digits, so if #=4 or #=04 or #-004, a stack of 4 gold will still be generated without error)

-*, that is, a single asterisk, generates an erroneous item, i.e. an invisible item that cannot be removed.  This is useful if you want your creature not to drop anything, but you do not want to use this for containers and item piles

 

Items that cannot be referenced:

-RNDEQU##; using this will create RNDEQU##.ITM, exactly as it is (circular loops are not possible)

-RNDMAG##; using this will create an erroneous item that cannot be removed

-RNDSCR##, using this will create RNDSCR##.ITM, exactly as it is (circular loops are not possible)

-RNDTRE##; using this will create RNDTRE##.ITM, exactly as it is (circular loops are not possible)

-RNDWEP##; using this will create an erroneous item that cannot be removed

 

 

Since RNDSCROL.2DA cannot reference the other four random treasure .2DA files, this 2da is at the bottom (fifth to the top) of the random treasure taable hierarchy.

Link to comment

I've been researching these random treasure tables quite a bit for a mod. From the looks of them, I'd say the engine is using 2d10 (or possibly even a d8 + d12) to determine the results, rather than a d20 as described. This means you can weight the treasure outcome differently, with 2 and 20 values being more rare than those in the middle columns.

Link to comment

The null item is created because there is no default item specified. Most 2DA files let you specify a default value immediately following the 2DA header, and this value is set to null (*) in the default random treasure tables. You could probably specify an item (or gold) here (or perhaps another table if high enough in the heirarchy?) if you wanted. Corresponding null entries in the table body will then be replaced by the default value.

 

As to 2d10 or d20, I suppose it depends on the 2DA in question. The files starting with column 2 may be 2D10, while those starting with column 1 may be d20 (rolling two dice causes column 1 to be ignored because you can't roll a 1, for example, with 2d10).

Link to comment
As to 2d10 or d20, I suppose it depends on the 2DA in question. The files starting with column 2 may be 2D10, while those starting with column 1 may be d20 (rolling two dice causes column 1 to be ignored because you can't roll a 1, for example, with 2d10).
Yes - you're probably right on that... rndtreas and rndmagic appear weighted: they go from 2 to 20 with nicer and rarer values on the ends, whereas rndequip, rndscroll and rndwep go from 1 to 20 and appear to be unweighted.
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...