Author Topic: Modifying Weapon Color and Appearance from Loot Script  (Read 417 times)

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« on: February 17, 2014, 02:04:04 pm »


               Hey guys,

Currently working on my loot script.  The script is called from Onspawn.  I also have a weapon reward script from a quest (conversation) that adds Item Properties at random and renames the weapon.

What I want to do is put the random IP script into the loot script, and I am having trouble figuring out how to do this.  So some questions off the bat:

1) How do you modify weapon model and color randomly?  *This is a BIG one.

2) Can I create an item in the Mob's inventory and then modify it, or do I have to use a copy/replace routine?

I am hoping I can make, for example, 1 longsword, and then put it in the mob's inventory, give it random properties, random name, and random appearance.  If anyone has such a script, I would love to see it.  If not, any help available would be appreciated.

Thanks.
               
               

               
            

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« Reply #1 on: February 17, 2014, 02:33:54 pm »


               An idea I have if this is not possible is to have a separate in-game loot box for each loot range; the box has one type of weapon per weapon type; an on-heartbeat script constantly changes/sets the item properties of each weapon in the chest by cycling through them.


The loot script, given a certain chance (like 1% on d100) would grab a weapon from the proper chest and put it in the creature's inventory.

But I still don't know how to change model/appearance.
               
               

               


                     Modifié par bdtgazo, 17 février 2014 - 02:52 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« Reply #2 on: February 17, 2014, 03:18:38 pm »


               Give this a whirl.

http://nwvault.ign.c....Detail&id=3015

Otherwise, you would use CopyItemAndModify(), setting up the changes of randomly inserted values for ITEM_APPR_WEAPON_COLOR_# and ITEM_APPR_WEAPON_MODEL_#

object CopyItemAndModify(object oItem, int nType, int nIndex, int nNewValue, int bCopyVars=FALSE)

This may interest you as well.

http://nwvault.ign.c....Detail&id=3233

FP!
               
               

               


                     Modifié par Fester Pot, 17 février 2014 - 03:23 .
                     
                  


            

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« Reply #3 on: February 17, 2014, 03:33:20 pm »


               Hi Fester.

Thanks for the reply.

This is pretty much what I got from the Lexicon:

Otherwise, you would use CopyItemAndModify(), setting up the changes of randomly inserted values for ITEM_APPR_WEAPON_COLOR_# and ITEM_APPR_WEAPON_MODEL_#

object CopyItemAndModify(object oItem, int nType, int nIndex, int nNewValue, int bCopyVars=FALSE

Which means nothing to me unfortunately.  Or at least very little.  I wish the lexicon had provided a few examples.  

I will check out the links you provided.
               
               

               
            

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« Reply #4 on: February 17, 2014, 03:50:20 pm »


               Checked out the links.  Great!


Thanks Fester!
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Modifying Weapon Color and Appearance from Loot Script
« Reply #5 on: February 17, 2014, 04:08:11 pm »


               No problem!

From reading the comments and description of those two packages, it seems like they're quite easy to modify if you find the random results are too uber for what you're making.

Have fun building!

FP!