Jump to content

rndtres.2da - unlimited random item spawns for BG2:EE and IWD:EE


Recommended Posts

Information about IWD:EE rndtres.2da implementation that has been recently (patch 1.3) ported to BG2:EE and will be also implemented in the next BG:EE patch.


Here is how the random tables work in vanilla BG2:

when a creature or container has 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 randomly generated item.
In other words 2da file accepts up to 9 rows. Same deal with other random tables: rndequip.2da, rndmagic.2da, rndscrol.2da, rndwep.2da.



And here is how new rndtres.2da work (notice that the file has different name than old rndtreas.2da):

rndtres.2da doesn't need items that follows the 2da name and points to row number like I explained above. Engine now checks the item name that will be replaced with random loot directly in the rndtres.2da (first column). You can choose any 8 character name, so it's possible for modders to use this 2da without any conflicts, as long as they add rows with unique names (for example using mod's prefixes). Thanks to this it is not limited to 9 columns like old 2da files, or even 99 columns (which would be true if it worked with RNDTRE## names, which isn't a case). Just tested it with row named TESTITM1, placed as a 130th row and dummy item named TESTITM1.ITM - random loot spawned correctly. Another test with row name "TEST_" also spawned correctly.

More information in this topic: http://forum.baldursgate.com/discussion/comment/622831

Link to comment

What happens if you add a no_drop entry to the bottom of the list, with just a * as the first created item?

[edit] ah, i see. yeah, recursion isn't done because it could create infinite loops. GemRB does have a loop limit, didn't see the need for this in EE.

Link to comment


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

  • Create New...