Creating new craftable items
#26
Posté 02 février 2014 - 01:46
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
Posté 02 février 2014 - 03:04
oh yesCPK87 wrote...
I'm sure we've both come out the wiser from it!
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 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.
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
Posté 02 février 2014 - 03:38
#29
Posté 02 février 2014 - 04:13
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.
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 #5although I'm still not sure how the 10 translates to 2d6
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
just try changing "17,2,5,10,0" to "17,2,6,10,0" (acid), might work might notWish I could test it, except the recipe doesn't work.
Modifié par kevL, 02 février 2014 - 02:40 .
#30
Posté 02 février 2014 - 02:36
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...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.
#31
Posté 02 février 2014 - 04:33
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
Posté 02 février 2014 - 09:17
#33
Posté 03 février 2014 - 05:19
Regards
#34
Posté 03 février 2014 - 08:26
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
Posté 04 février 2014 - 12:18
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
Posté 04 février 2014 - 12:26
#37
Posté 05 février 2014 - 12:01
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
Posté 05 février 2014 - 12:17
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
Posté 05 février 2014 - 02:46
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
Posté 06 février 2014 - 06:22
#41
Posté 06 février 2014 - 08:20
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
Posté 06 février 2014 - 07:01
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
Posté 06 février 2014 - 07:35
we're off to see the wizard.. lalala
/jk
#44
Posté 06 février 2014 - 07:37
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
Posté 06 février 2014 - 08:47
#46
Posté 06 février 2014 - 09:48
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
Posté 13 février 2014 - 06:54
Modifié par CPK87, 13 février 2014 - 06:54 .
#48
Posté 13 février 2014 - 07:40
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
Posté 13 février 2014 - 07:44
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
Posté 13 février 2014 - 09:39
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





Retour en haut






