Editing the ga_setrecipes script... no changes in game

hello,
I d like to customize the recipes from MoTB, for example, I d like to change the effects of the enchantmens, the spell required and so on.
I tried to modify the ga_setrecipes script via toolset and placed the 2 files that result from this into the override folder… same way I do when I modify the script of a spell… but does not do anything in game.
I undertand that the script ga_setrecipes is run just once, and then the game saves the recipes…
so, anybody knws how can the changes to ga_setrecipes, effectives in game??

thank you very much!!! :slight_smile:

Just guessing here but…maybe you need to edit a 2da file for this to work, like spells.2da?

1 Like

thanks for the answer…
at the bottom of the ga_setrecipes script, is says something about the 2da files… perhaps should I do something with crafting.2da?

   		SetGlobalInt(VAR_REC_SET, TRUE);
   		bDone = TRUE;
   		output("Recipes now loaded in Global Memory.  Crafting now based on Global Memory set up for this session.");
   		output("Recipe data can be exported to 2da format in the log by stepping into designated area.");
   }
   output("Script completed.");

   if (!bDone)
   {
   	DelayCommand(0.2f, ExecuteScript("ga_setrecipes", OBJECT_SELF));
   }
1 Like

hi, I worked on crafting ( OC/MotB-style ) a lot some 5 or 10 yrs ago … SoZ-style crafting is different but a bit related.

Vandervecken then put together The Complete Craftsman Reboot with the extensively revised scripts and advice. So I suggest anyone interested in OC/MotB-style crafting to install his add-on (and check for duplicate files in /override). He/we worked it over and maintained it for a few years, so it should be very robust (with only a couple of known bugs).

That said, i believe ga_setrecipes is obsolete. I believe it was a method that the developers of the crafting system used to design and export the necessary 2da files. But it seems to have long fallen by the wayside …

The primary files that are now used can be found in TCCReboot … Crafting.2da, Crafting_Index.2da, and the scripts.

 
The thing is … just modifying the recipes can be unusually complicated. You shouldn’t have to touch the scripts. Only Crafting.2da and perhaps Crafting_Index.2da

I strongly suggest using my 2da editor Yata for editing those 2das … because it can be set up to print info to its statusbar about what you’re looking at in Crafting.2da

There’s instructions on Info setup in yata’s ReadMe text.

 
ps. Always remember that when specifying REAGENTS that they must be arranged alphanumerically and are case sensitive – per the standard ASCII definitions – eg. capital B gets sorted into a list before small a … (although i might have put in some code that sorts the reagent-tags its best to stick to the rule /iirc)

2 Likes

hi, thank u for assisting me.
I tried to understand a bit the Crafting.2da.

I suppose the 2 highlighted in this picture, are the effects of feat WOnderous Items, for 1 brillant fire essence and the effect for 3 pristine fire essence…
so I changed the column Effect of the Brillant Fire essence (originally it was 23,10,2) to make it like the effect of the 3 pristines.(23,10,8).
So, I believed that enchanting a cloak with 1 brillant fire essence, would give me the same result as I was enchanting it with 3 pristine fire essence… But the enchantment was the same as always :frowning:
Perhaps I am doing something wrong

CATEGORY is the trigger-spell in Spells.2da, 150 is Resist Energy … is that the enchantment you want ?

 
[edit] and if you haven’t set up Info/Paths for Crafting.2da, I suggest getting that going … then mouseover should say what the Category is, what the Tags mean, what the Skill is, and if you make a mistake on the Effects it should (likely) point out that there’s an error of some sort …

look into the yata-setting pathzipdata= if your 2das are still all zipped up in nwn2’s \Data folder

 
ps. make sure there’s only 1 Crafting.2da file in your /override (and that it isn’t being overridden in a .hakfile, if applicable)

oh, thanks to yata I am more aware of what things are… :slight_smile:
I wonder, is there a way to understand how the effects are turned into these numbers?
for example, here we have 1d6 fire damage is 16, 10, 12, 0, 0.


How can I make 1d12? 2d12? Should I try numbers randomly, or there is a way?
also, can i add bracers as enchantble items? Or just gloves?
thank you!!!

1 Like

u have to work backwards and ask, How are those numbers turned into effects? …

The first number is the property-type and that’s the most important, deciding what the successive numbers mean (and how many there need to be). The type is one of the constants in NwScript.nss – for your case above →

int ITEM_PROPERTY_DAMAGE_BONUS = 16;

Then the crafting script(s) take that number and run it through this function in x2_inc_itemprop

itemproperty IPGetItemPropertyByID(int nPropID, int nParam1 = 0, int nParam2 = 0, int nParam3 = 0, int nParam4 = 0);

where the first arg nPropID is the value 16 for damage bonus

The successive ‘nParam’ variables are those sucessive numbers in the EFFECTS col. So if you look in the function you’ll find →

   else if (nPropID == ITEM_PROPERTY_DAMAGE_BONUS) // 16
   {
        ipRet = ItemPropertyDamageBonus(nParam1, nParam2);
   }

So … the resulting itemproperty is constructed by the function ItemPropertyDamageBonus() … next look at its description/declaration in NwScript.nss →

// Returns Item property damage bonus. You must specify the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
//       Cold, Electrical, Fire, Piercing, Slashing, Sonic.
itemproperty ItemPropertyDamageBonus(int nDamageType, int nDamage);

hence the encoded IP numbers after the 16 mean →

nDamageType = 10
nDamage = 12

And go back to the NwScript.nss constants →

int IP_CONST_DAMAGETYPE_FIRE = 10;
int IP_CONST_DAMAGEBONUS_2d4 = 12;

!
uh, now that’s odd … your info says (fire + 1d6*) but when i mouseover 16,10,12,0,0 mine says (fire + 2d4)
[Yata ver 5.4.2.2]

* IP_CONST_DAMAGEBONUS_1d6 = 7

/ not sure what to make of that … is your mouse in the right place in your screenshot ?

 
/anyway

int IP_CONST_DAMAGEBONUS_1d12 = 14;
int IP_CONST_DAMAGEBONUS_2d12 = 15;

This is important … use the IP_CONST_DAMAGEBONUS_* constants. Do not use integer literals unless you’ve specifically looked them up in NwScript.nss …

that’s determined by the TAGS col. I think it’s also kinda complicated and might depend on whether you’re running TCC or the stock crafting 2das/scripts

I can look into it some more for ya, if you give more information about your setup … or, if you’re decent with reading scripts have a look through 'em …

1 Like

u have been incredible useful.
I didnt expect so.
about bracers, I ll change the tag of gloves to the tag for bracers, and see if I can enchant bracers instead.
thank u vey much sir! :smiley:

2 Likes

kk :)

mm…
looks like changing the “Category” in Crafting.2da and in crafting_index isnt enough to change the trigger spell.
I changed for example, just to make a test, the 150 to 137 (protect from energy) and in game, does nothing.

Also, changing the Tag in Crafting.2da for the Gloves to B78, that it the tag for bracers, doesn t allow me to enchant bracers…

I wonder it is possible to enchant bracers?
I ll keep trying…

recipes with the same trigger-spell (CATEGORY) must be kept contiguous. Crafting_Index.2da defines the first row-id of each category in Crafting.2da

When you change the trigger-spell, or add/remove a recipe in Crafting.2da, you’re in for a bit of a headache …

 
I believe that TCC Rebooted has a console-script that can be used to automatically generate the Crafting_Index.2da text.

 
Also, Yata might not be displaying accurate Info for TAGS with the stock Crafting.2da loaded … the B prefix might be unique to TCC’s 2das …

1 Like

I have been able to enchant bracers using the mold spirit feat (I used the tag B36,78 : gloves, bracer)
I gave a regeneration 2 to my bracers…

however, when I tried the same with elemental or power essences, that do not use the mold spirit, nothing happens. :face_with_raised_eyebrow:

I ll experiment further…

The thing is … these issues could be greatly eased if you’re using Vandervecken’s The Complete Craftsman Reboot. (not sure what version/edition of Crafting you started with …)

V. and i became all too familiar with those wtf-is-wrong moments so there’s a toggle in TCCR’s ginc_crafting

const int TELLCRAFT = FALSE; // toggle for debug.

change that to TRUE and recompile the scripts and voila – messages appear in chat saying exactly where crafting failed.

2 Likes

finally… odd but seems true…

tag 2, 78 (correclty displayed as armor/bracer)
does not work in game. I got an invalid recipe.
while
tag 78,2 (bracer/armor)
seems to work!!!
:smiley:

I wanted to share this success :smiley:

3 Likes