Aller au contenu

Photo

Set Item Color/Model


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

#1
Veyth

Veyth
  • Members
  • 3 messages
Hello All,

I have a script that generates random armor.  What I'd like to do is apply a random color scheme and model to the armor.  I've tried AddItemProperty(), but I can't figure out which ItemProperty function to use with the  ITEM_APPR_ARMOR_XXX's.
Any idea's or am I going down the wrong path?  I've done it before in NWN1, but it was a long time ago and I don't have the script anymore.

Thanks!

#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I don't think those nwn1 functions work in nwn2. The vault has some item changing solutions, but I think that generally they spawn in new items rather than editing the ones you have.

Regards

#3
Veyth

Veyth
  • Members
  • 3 messages
Thanks for the reply.  I looked in the vault and found that IPDyeArmor was included in "x2_inc_itemprop" so I included it and tried the following script

#include "x2_inc_itemprop"
void main()
{
int nArmor = -1;
int nHelmet = -1;
int nColor2 = -1;
string sArmorTemplate;
string sHelmetTemplate;
object oTarget = OBJECT_SELF;
object oArmor;
int nStackSize = 1;
int nColorType1 = ITEM_APPR_ARMOR_COLOR_METAL2;
nColor2 = Random(62)+1;
nArmor = Random(3)+1;
nHelmet = Random(6)+1;
switch(nArmor)
{
case 1:
sArmorTemplate  = "nw_aarcl011";
break;
case 2:
sArmorTemplate  = "nw_aarcl007";
break;
case 3:
sArmorTemplate  = "nw_aarcl006";
break;
}
switch(nHelmet)
{
case 1:
sHelmetTemplate  = "nw_arhe001";
break;
case 2:
sHelmetTemplate  = "nw_arhe002";
break;
case 3:
sHelmetTemplate  = "nw_arhe003";
break;
case 4:
sHelmetTemplate  = "nw_arhe004";
break;
case 5:
sHelmetTemplate  = "nw_arhe005";
break;
case 6:
sHelmetTemplate  = "nw_arhe006";
break;
}
oArmor = CreateItemOnObject(sArmorTemplate, oTarget, nStackSize);
IPDyeArmor(oArmor,nColorType1,nColor2);
CreateItemOnObject(sHelmetTemplate, oTarget, nStackSize);
}

It compiles but the armor spawned is regular color. - sorry not sure how to create a window for scripts

#4
kamal_

kamal_
  • Members
  • 5 259 messages

Veyth wrote...
sorry not sure how to create a window for scripts

You can't on Bioware Social. Social is so awesome there's no need. :whistle:

Also you can't dye. As Kaldor said you have to spawn new. Yes it's annoying that you can't dye like nwn1, but it is what it is.

#5
Veyth

Veyth
  • Members
  • 3 messages
ok thanks