While the framework can be used without touching any script, a good understanding of how the 2DA tables intertwine is crucial. For that reason, the source package includes the Excel files used to generate the example tables. Those files are commented through notes and explanation rows, but those comments are DACrafting specific and do not describe the structure of vanilla tables. Meaning that people having a poor understanding of the vanilla 2DA_base or ABI_base should first have a look at the relevant Toolset wiki pages :
-
Generic 2DA introduction-
2DA_base-
ABI_base-
Guitypes.
There is no need to alter this table, however as said before it's crucial to understand how it works. Basically, the entries defined here combine together the 2DA sheets sharing the same prefix. For instance, in the examples package the twophae_dacft_reags* tables are fused in one single M2DA table, meaning the ID values shouldn't collide.
.
This M2DA table holds the details of every craftskill added via the DACrafting framework. Since it's merged, you'll want to use an unique suffix and make sure the ID you're using don't collide with those of anyone else using the framework as well.
The obvious being said, let's have a look at that table structure.
The table prefix will be used by the scripts to access the tables specific to that craftskill. Therefore it'd better be unique.
The logic column defines how the scripts will be identifying recipes :
- Type 1 :
Each recipe must use a specific reagent, defined on the recipes table via the CondItemTag field. - Type 2 :
The recipes are identified by the ability used to trigger the craftskill. Think NwN2 here : players had to cast a precise spell on the crafting container to use the right recipe. The ability are linked to recipes via the CondAbilityID field on the recipes table. - Type 3 :
The recipe will simply be guessed using the exact reagents assortment found in the container, by checking the reagents list against the recipes table reagents columns.
The AbilityID field is necessary for type 1 and 3 craftskills. It defines which ability is authorized to trigger the craftskill ; this ID obviously have to match the relevant ABI_base entry.
Type 2 craftskills do not need this field since they are not triggered by a single ability but through a series of recipe-specific abilities defined in the phae_dacft_rcpabi table.
Finally the placeable define which placeable will be holding the reagents. You can use the tag of an existing placeable, or leave that field to "auto". When a craftskill is set to "auto", the scripts simply create a temporary invisible placeable.
Important :
The abilities triggering the craftskill have to be able to target the placeable. When set to "auto", the abilities have to be able to target the controlled character (targettype=1) otherwise the ability must be able to target the specified placeable.(targettype=8)
.
This M2DA table holds the information about the type 2 craftskills. More exactly it does reference the recipe-specific abilities and link those to the relevant craftskill.
This is once again a merged table, so unique IDs are crucial. However, since the IDs here are actually keyed from the ABI_base abilities ID, there is not much to worry about ; you wouldn't want your ABI_base entries to collides with other people's anyway.
Here, the CraftskillID must be a valid craftskill ID defined in the phae_dacft_skills table.
.
You will have to create one 2DA recipe table per craftskill. Those tables won't be merged and the ID used in there do not need to be unique to your craftskill or module ; they don't have to be consecutive either, you're pretty free.
This table holds all the information related to a craftskill recipes : the conditions, the reagents to expect, and what to create. Let's have look at the structure :
That's a mouthfull, yep, but I'd like to think it's pretty logical and easy to understand.
The CondItemTag column concerns type 1 craftskills ; type 2 & 3 will have empty fields here. For type 1 craftskills you must define the key reagent by putting its tag here ; by key reagent, understand a reagent this recipe will be the only one to use in that entire craftskill. It can be a recipe scroll, a mold, whatever idea you can come with. However, there are two restrictions :
- The player must be able to place that reagent in the container. Meaning no plot items.
- The player must be able to place only 1 unit of this reagent. If it's a stackable item, you'll want to add it to thephae_dacft_reags table.
You mustn't add that key reagent to the recipe reagent list (the Reagent1, Reagent2 (...) fields) as it'll be automatically done.
Likewise, the CondAbilityID is the column defining the key ability used in type 2 craftskills, and will be empty for type 1 & 3 craftskills. Each of this abilities have to be unique to a single recipe, and must be able to target the placeable defined in thephae_dacft_skills M2DA table.
The OptPlotUID and OptPlotFlag fields can be used to restrict a recipe to pretty much any condition you can imagine ; the flag can be either a main flag or a defined flag. For instance, in the recipe excerpt below - the Dalish arrow from the example craftskills - the script will automatically check the defined flag 256 of the plot having the UID4EB13E46F6FF497A853165A0B0C2718B :
Basically, that defined flag restrict that recipe to Dalish characters. Neat, huh.
Obviously, the ResultRes and ResultStack define the number and kind of item to create when the crafting attempt is a success.
As for the five ReagentX and ReagentXCount columns sets, they are used to set the reagents list required for each recipe. Note that recipes must have at least one reagent - key reagent not included - and that the players will have to place the exact quantities you define here. Hopefully, you'll find in the framework a placeable core script making stacks splitting easy as pie. (cf. example package)
.
Speaking of which : in order to have the container automatically split reagent stacks, and believe me you want that to work, you need to expand the phae_dacft_reags M2DA table. That table holds the information needed to split the stacks of every Origins & Awakening reagents, however it doesn't include gems or - obviously - your own custom reagents.
So, you'll have to create a new phae_dacft_reags_youruid table to define those reagents. Hopefully, that's as easy as easy can get :
Enter the reagent tag in ReagentTag, push the resource in ReagentRes, and that's it... Just make sure the IDs doesn't collide with other DACrafting using addons since that's a M2DA.