Specifically, help with GetItemAppearance and CopyAndModify.
I have a number of creatures that break your stuff (Rust Monster, Caryatid Column, etc.)
I want to allow (if you can get it before the rm eats it) Players to fix their stuff...using Craft skills, ingots, etc.
It works...except for 1 problem:
test character is a fighter, test item is the standard fighter scale mail. Rust Monster eats it, i pick it up in time, i kill the RM, I toss the broken armor in a bench with some ingots, use the hammer and bam!, a new suit of scale mail. Issue is, the appearance is the standard scale mail, not the fighter's.
Tried to use GetItemAppearance to save variables on the broken item to use copyandmodify later to set the appearance, but that didn't work; GetItemAppearance only gave values of "0" or "-1" for all possible appearance slots, based on useing this:
int nN = 0; for(nN;nN<=4;nN++) { int nM = 0; int nMax; switch (nN) { case 0: nMax = 0; break; case 1: case 2: nMax = 2; break; case 3: nMax = 18; break; case 4: nMax = 5; break; } for(nM;nM<=nMax;nM++) { SetLocalInt(oItem,"nApp_ind"+IntToString(nN)+"_n"+IntToString(nM),GetItemAppearance(oOld,nN,nM)); SendMessageToPC(GetItemPossessor(oOld), "nApp_ind"+IntToString(nN)+"_n"+IntToString(nM)+" = "+IntToString(GetItemAppearance(oOld,nN,nM))); } }
Now then, I know why it's not making fighter scale mail (I save the resref then spawn the item from it, and the TemplateResRef for fighter scale mail is the default scale mail). BUT the scale mail itself should have it's appearance on it somewhere, but when I run that in the "destroyitem" script, it yields only -1s and 0s (fighter scale is chest 1 btw).
And if i set CopyAndModify to any version of those numbers, it crashes the game (likely due to trying to set a weapon model on armor).
Any ideas?
What does GetItemApp return if invalid?
Item Appearance Help
Débuté par
Darin
, juil. 20 2013 06:32
#1
Posté 20 juillet 2013 - 06:32
#2
Posté 21 juillet 2013 - 10:42
I suspect those functions are left over from NWN1, so may not work properly (or at all).
One solution might be to squirrel the actual item away somewhere in a hidden container, swap it for the broken item, then store the original item as a local object on the broken one. Then when you fix the broken item, it gets destroyed and the original item in the hidden container gets transfered to the blacksmith bench (via the local object).
You could use a store object as the 'hidden container'. They have inventories that can be manipulated, and they don't have a physical presence in the game.
One solution might be to squirrel the actual item away somewhere in a hidden container, swap it for the broken item, then store the original item as a local object on the broken one. Then when you fix the broken item, it gets destroyed and the original item in the hidden container gets transfered to the blacksmith bench (via the local object).
You could use a store object as the 'hidden container'. They have inventories that can be manipulated, and they don't have a physical presence in the game.
#3
Posté 22 juillet 2013 - 09:11
possible, but that sounds like it wouldn't work between modules (as most likely place to break your stuff is in the Hauntedv Halls, most likely place to fix it is Eveningstar). But yes, those could very well be hold-overs from nwn1, and at least most items match the appearance of their resrefs,
#4
Posté 22 juillet 2013 - 09:23
Those are deprecated, use nwnx_craft instead, or setup blueprints allow you to swap out items on the fly. What those functions were made for is NWN1. We were hoping to get another patch which could have dealt with some of those things, but it's just not to be. There are a lot of leftovers from NWN1 which sound like they might work, but are just not hooked up.
It might be helpful, to get a copy of the Community Script Library and find the file nwscript_i.nss
This has doxygen comments by each function which you can use to create html documentation, or just read it as is for ALL the official functions, it lists which work, which are broken, and what you have to pay attention to when using each and every function. This includes information from the now gone nwn2 lexicon, plus many discussions in the old bioboards, PW admin round table, plus all my notes and comments while i used these functions myself.
It might be helpful, to get a copy of the Community Script Library and find the file nwscript_i.nss
This has doxygen comments by each function which you can use to create html documentation, or just read it as is for ALL the official functions, it lists which work, which are broken, and what you have to pay attention to when using each and every function. This includes information from the now gone nwn2 lexicon, plus many discussions in the old bioboards, PW admin round table, plus all my notes and comments while i used these functions myself.
Modifié par painofdungeoneternal, 22 juillet 2013 - 09:24 .
#5
Posté 24 juillet 2013 - 12:50
That's a lot of content to add for something that only comes up every so often. I en does the could either (1) say meh, how often does the appearance of an item NOT match it's refref? or I could (2) summon a creature to take the item, send it to LIMBO..
Question: Limbo creatures, persist across modules?
Question: Limbo creatures, persist across modules?





Retour en haut







