Aller au contenu

Photo

Creating new craftable items


  • Veuillez vous connecter pour répondre
81 réponses à ce sujet

#26
CPK87

CPK87
  • Members
  • 73 messages
Ah, I knew there had to be something that set the item-type restrictions on the recipe. That's definitely helpful. I still can't seem to figure out those last 2 Effect numbers on certain item props. For instance, I was testing entries 57-59 (all 3 have a value of 10 for the 4th Effect number) which give different alignment damage bonuses to weapons, and even though they exist in the crafting.2da file, it just says "not a valid recipe" in game. Other weapon recipes seem to work just fine, however.

Oh well, I probably won't waste too much more time on this stuff, I seem to have a fairly good grasp on most of it. Thanks again for all your research - I'm sure we've both come out the wiser from it!

#27
kevL

kevL
  • Members
  • 4 052 messages

CPK87 wrote...

I'm sure we've both come out the wiser from it!

oh yes :)

Ah, I knew there had to be something that set the item-type restrictions on the recipe. That's definitely helpful. I still can't seem to figure out those last 2 Effect numbers on certain item props. For instance, I was testing entries 57-59 (all 3 have a value of 10 for the 4th Effect number) which give different alignment damage bonuses to weapons, and even though they exist in the crafting.2da file, it just says "not a valid recipe" in game. Other weapon recipes seem to work just fine, however.

hmm, entries 57-59 in the default (SoZ) Crafting.2da shows EFFECTS "1,2,0,0,0" here. (looks like +2 Armor in MotB)

ah, i see you've been looking at the OC crafting.2da -- if you have any expansions use those, i suggest. ( in \\Data\\2DA_X1 or \\2DA_X2.zip instead of just \\2DA.zip ) But if yer going from scratch it hardly matters ... thought i'd mention it tho, might be conflicting with the rest of your install!!!

I can say that any EFFECTS values after the first are simply extra parameters that describe the first. row#57 in the OC's .2da says CATEGORY 435. Triggerspell = Inflict_Critical_Wounds (per Spells.2da). ((hm, why does that bother me already)) REAGENTS = "cft_ess_air1,cft_ess_power1,cft_gem_09". TAGS = 1, ITEM_CATEGORY_WEAPON (per 'ginc_item'). EFFECTS = "17,2,5,10,0"

17 -> DamageAlignmentGroup

now I'm going to look up the script-effect for damaging alignment groups (in 'x2_inc_itemprops'):

itemproperty IPGetItemPropertyByID(int nPropID, int nParam1 = 0, int nParam2 = 0, int nParam3 = 0, int nParam4 = 0)
{
//...
  else if (nPropID == ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP) // 17
  {
    ipRet = ItemPropertyDamageBonusVsAlign(nParam1, nParam2, nParam3);
  }
//...

(notice how that function takes the 5 params of EFFECTS - but only the initial value plus the next 3 are used in the ip-function)

now to nwscript.nss:

// Returns Item property damage bonus vs. Alignment groups. You must specify the
// alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and 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 ItemPropertyDamageBonusVsAlign(int nAlignGroup, int nDamageType, int nDamage);

So I'm guessing that.. (these constants are all in nwscript.nss, but should also prob. be found as row#'s in various iprp_*.2das)

2 = IP_CONST_ALIGNMENTGROUP_LAWFUL
5 = IP_CONST_DAMAGETYPE_MAGICAL
10 = IP_CONST_DAMAGEBONUS_2d6


well well, notice the NOTE in the function description excludes IP_CONST_DAMAGETYPE_MAGICAL

That may or may not be valid; but this is symptomatic of NwN vs NwN2.

#28
CPK87

CPK87
  • Members
  • 73 messages
Ah, you may be right. At least the 5 for magical damage makes sense, although I'm still not sure how the 10 translates to 2d6. Wish I could test it, except the recipe doesn't work. I didnt find a Crafting.2da file in the x2 zip file, but I found one in the x1 zip file and the same recipes exist at lines 106-108... so I can't imagine why it would be an expansion conflict issue. I'm sure it's not a big deal anyway, just has me curious :).

#29
kevL

kevL
  • Members
  • 4 052 messages
yeh I don't see one in X2 either..

But I notice that SKILL has been re-defined as "0" in the enhanced Vault version I have. Am not sure if that disables ( "not a valid recipe" ) certain recipes or what, but really, if the recipe doesn't work properly that's what the PC should get, (btw, Skill might mean Feat also, like you've probly guessed)


Too complicated to set up a test atm.

although I'm still not sure how the 10 translates to 2d6

I think the only reliable way is to bookmark 'x2_inc_itemprops', IPGetItemPropertyByID() which lists all the possible itemproperties - it's just a long, simple function that checks the first EFFECTS param. That returns the specific itemproperty, which you'd have to look up in nwscript.nss, and add in the EFFECTS params #2 to #5

the specific itemproperty function as well as its required constants are all found in nwscript.nss. This is the actual line there that says 10 = 2d6:

int IP_CONST_DAMAGEBONUS_2d6 = 10;

that traced backwards to

ItemPropertyDamageBonusVsAlign()

whose description said that the third parameter would be an IP_CONST_DAMAGEBONUS_* value.

That traced back to 'x2_inc_itemprops', IPGetItemPropertyByID()

that's about all i can say

[edit] The 'cost' is defined in Iprp_damagecost.2da

Wish I could test it, except the recipe doesn't work.

just try changing "17,2,5,10,0" to "17,2,6,10,0" (acid), might work might not :)

Modifié par kevL, 02 février 2014 - 02:40 .


#30
kevL

kevL
  • Members
  • 4 052 messages

CPK87 wrote...

... but I found one in the x1 zip file and the same recipes exist at lines 106-108... so I can't imagine why it would be an expansion conflict issue.

If let's say the OC Crafting.2da were copied to a module campaign folder but MotB was also installed, the index could/would get out of synch...

#31
kevL

kevL
  • Members
  • 4 052 messages
well i got to doing some tests.

even though the function says it excludes Magical damage, it appears that it doesn't. In fact I tried putting Negative damage on, and it reverted to Magical. (This doesn't show on the Examine sheet, but does show on the Character sheet as well as in combat damage)

It was just a simple test, nothing exhaustive.


On the other hand, CATEGORY 435 Inflict Critical Wounds seems to work fine. yes, even w/ Magical damage specified. Oddly, my supposedly enhanced Crafting.2da - that had "0" under SKILL - works whether it's left at "0" or changed back to "1092" Craft Magical Arms and Armor ( have no clue why somebody set it to "0" at present - it just might have something to do with a bug in MotB, as a workaround for scripts that may not allow the Spirit feats to craft properly (but ofc has been fixed in my own scripts )

Also, i specifically tested MotB Crafting & Crafting_index 2da's for the first #435 entry: works as is. I think you had your _index out of sync,

Modifié par kevL, 02 février 2014 - 04:35 .


#32
CPK87

CPK87
  • Members
  • 73 messages
You were right, once again - switching the OC crafting.2da with the expansion version made the recipe work. I'll work in that one from now on and see if I can figure out what those last couple of numbers do. Thanks!

#33
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
I realize you said you do not want to use SoZ style crafting, but if you reconsider that you will find that my SoZ Crafting Plus makes all of this much easier and you can add recipes without modifying any 2da files.

Regards

#34
CPK87

CPK87
  • Members
  • 73 messages

Kaldor Silverwand wrote...

I realize you said you do not want to use SoZ style crafting, but if you reconsider that you will find that my SoZ Crafting Plus makes all of this much easier and you can add recipes without modifying any 2da files.

Regards


Well, from what I understood from briefly looking at it, doesn't SoZ crafting create entire items instead of applying specific enchantments?  What I liked about OC crafting was that you could mix/match different enchantments, sort of like sockets.  I have not actually played SoZ though yet, so if it's more flexible than I realized, I'd be willing to reconsider.

#35
Dann-J

Dann-J
  • Members
  • 3 161 messages
SoZ allows you to add additional enchantments to existing items. You don't need components or spells though (which spoiled it for me). All you need is a recipe, at least one party member with the relevant item creation feat, and a whole lot of gold. Hunting down the necessary components was half the fun for me.

When I decided to create items that allow you to craft custom ammunition, I scripted my own crafting system from scratch. Although I found it relatively easy to create new distillable items for alchemists by adding entries to one of the crafting 2DAs.

Another thing I noticed was how easy it was to use the MotB apply poison script to add new appliable weapon poisons to the game. Someone with a bit of forethought designed the script to use the last few digits of the poison bottle resref as the line number of that poison type in poison.2DA. Combining that with my new distillable crafting entries allows players to convert certain plant or animal parts into bottles of poison, provided their craft alchemy skill is high enough.

Modifié par DannJ, 04 février 2014 - 12:28 .


#36
kamal_

kamal_
  • Members
  • 5 238 messages
SoZ crafting does not replace OC crafting, you can use OC crafting in SoZ provided you have the materials (and remember the recipes, since SoZ doesn't give them).

#37
Tchos

Tchos
  • Members
  • 5 030 messages
To go into more detail about SoZ crafting -- as others have stated, you had the wrong impression of SoZ crafting. It can do the same kind of things as the OC crafting (adding "socket-like" enchantments to existing items in addition to creating new wondrous items, armour, etc.). The main differences are that you need to obtain the recipe for an item or enchantment before you can use it, and there is much less use of reagents than the OC used.

Some recipes do require the use of gems and other materials, but most abstract the cost of the items into gold, and just take the gold from you.

However, as I understand it, nothing is stopping you from using the SoZ crafting framework as Kaldor Silverwand provides and requiring the same sort of material reagents as the OC does.

#38
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages

Tchos wrote...
However, as I understand it, nothing is stopping you from using the SoZ crafting framework as Kaldor Silverwand provides and requiring the same sort of material reagents as the OC does.


+1.

It is entirely up to you if you want the recipe to require materials and/or spells.  The reason I developed SoZ Crafting Plus was to (1) extricate the SOZ trade system which I figured most campaigns would not want, (2) correct as many bugs as I could with existing recipes without requiring the 2da's to be modified, (3) add support for mobile crafting and compatiblity with all of the standard crafting workbenches, (4) add support for Warlocks, and (5) make it easy for modders to create their own recipes without requiring any 2da changes, instead using variables on the recipe object itself. And if you do not like some of my scripting decisions (such as the risk of recipes spontaneously combusting to prevent abuse), there are preferences in the 2da that I provide to make adjustments to your own taste.

Regards

#39
CPK87

CPK87
  • Members
  • 73 messages

Kaldor Silverwand wrote...

Tchos wrote...
However, as I understand it, nothing is stopping you from using the SoZ crafting framework as Kaldor Silverwand provides and requiring the same sort of material reagents as the OC does.


+1.

It is entirely up to you if you want the recipe to require materials and/or spells.  The reason I developed SoZ Crafting Plus was to (1) extricate the SOZ trade system which I figured most campaigns would not want, (2) correct as many bugs as I could with existing recipes without requiring the 2da's to be modified, (3) add support for mobile crafting and compatiblity with all of the standard crafting workbenches, (4) add support for Warlocks, and (5) make it easy for modders to create their own recipes without requiring any 2da changes, instead using variables on the recipe object itself. And if you do not like some of my scripting decisions (such as the risk of recipes spontaneously combusting to prevent abuse), there are preferences in the 2da that I provide to make adjustments to your own taste.

Regards


Sounds pretty handy - since I've already done a good bit of work in the 2da so far, I'm going to see how that works out first.  If I end up having problems or not liking the system I end up with, I'll give your system a look.

#40
CPK87

CPK87
  • Members
  • 73 messages
So, I must be missing something with editing these 2da files when it comes to rearranging and renaming things. I thought that changing the Category and Start_Row in crafting_index.2da to accommodate my changes in the crafting.2da file would work, but it doesn't. For instance, I would like to change one of the existing molds' tags to a new one that I've created, but it doesn't like me doing so even if I change the Category name in both the crafting and crafting_index 2da files. Is anyone familiar with this?

#41
kevL

kevL
  • Members
  • 4 052 messages
wow, did a bunch of tests on this one!

Here's the issue: molds for Mundane Crafting have to start with "n2_crft_mold"

As in, tag for an axe-mold: n2_crft_mold_axe

( This is what i was getting at earlier about looking at/changing the scripts... just found it, or this part of it.)


On the flexible side I found that the recipe can go either with the other molds, or at the bottom of Crafting.2da (as long as all triggers correspond to the _index properly). So I had something like this:

Crafting_index
115 n2_crft_mold_axe 1010

Crafting
1010 n2_crft_mold_axe n2_crft_ingiron,n2_crft_mold_axe **** **** nw_waxbt001 26 3


and it worked.

#42
CPK87

CPK87
  • Members
  • 73 messages
Hmm, I did keep the correct naming convention, I just switched n2_crft_mold_ltpd to n2_crft_mold_ltrb and then gave it 2 extra lines while removing the first 2 lines from n2_crft_mold_sm to make room for them. I guess I'll try your way instead and add some lines at the bottom. 

Edit:  Alright, it worked!  I'll try doing the replacement thing again and see if I can get that to work, too.  Thanks man.

Modifié par CPK87, 06 février 2014 - 07:29 .


#43
kevL

kevL
  • Members
  • 4 052 messages
k

we're off to see the wizard.. lalala


/jk

#44
kevL

kevL
  • Members
  • 4 052 messages
addenda:

Be careful row#'s don't get disjointed within Crafting.2da. that happens easily when fiddling with rows... they need to remain consecutive.

In the _index, the CATEGORY has to point to the same initial Crafting row# ...

and, again, reagents must be in alphanumeric order ( A..Z before a..z )

#45
CPK87

CPK87
  • Members
  • 73 messages
Yeah, replacing rows with other molds works too now - I can only guess that I had a typo in there somewhere the first time, since I didn't really do anything differently. So far, my new arsenal of weapon/armor recipes seems to work without any issues - time to work on the enchantments and encounters!

#46
kevL

kevL
  • Members
  • 4 052 messages
re Enchantments

I didn't explain it very well in previous posts. Of the 5 parameters, the first is the "itemproperty" and the last four are its values. Not all itemproperties use all four values (most use only 1 or 2).

To construct an EFFECT reliably, requires a bit of script-reading savy...,


the info is above but if ya need a bit more hints

#47
CPK87

CPK87
  • Members
  • 73 messages
Resurrecting this thread for a moment. It seems creating new distillable monster parts doesn't quite work the same way that creating new molds does. Simply changing the tag name of an existing distillable part to something else in Crafting.2DA and then creating your own blueprint doesn't make the item distillable. Anyone have experience with this?

Modifié par CPK87, 13 février 2014 - 06:54 .


#48
kevL

kevL
  • Members
  • 4 052 messages
I glanced over this and there doesn't seem to be anything special about tags. As long as you keep the reagent in the "DIS" Category and double check that those rows are included per the _index

i noticed that it might not like some types of BaseItems. but meh, doubt it.


Are you getting an error or success message to the chat? What was the original distillable blueprint, does it distill okay?

#49
CPK87

CPK87
  • Members
  • 73 messages
I took the wraith residue, ghost reside, and shadow residue and copied one blueprint of each, then renamed them to the items I wanted the new distillable ingredients to be.

I changed those exact same items' tags in the .2da file to the new ones I had copied from them. Now, neither the old nor the new items are distillable - it says they are not distillable items in the chat message.

Modifié par CPK87, 13 février 2014 - 07:45 .


#50
kevL

kevL
  • Members
  • 4 052 messages
hm,
i just copied the Wraith Residue ( "N2_CRFT_DIST038" ) -> module.

Then i changed it's .Uti-resref-filename to "kg_test_residue.UTI" (that didn't change the resref under Blueprints inside the TS but it didn't seem to matter, just wish there was a refresh there) and changed its Properties' tag/resref/template fields all to "kg_test_residue". Then i just changed, in Crafting.2da, "N2_CRFT_DIST038" to "kg_test_residue"

and shazam. 2 essences. Ofc the real Wraith Residue no longer works