Author Topic: is there a way to....?  (Read 389 times)

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
is there a way to....?
« on: March 01, 2011, 03:46:53 am »


               i was wondering if there was a way to make item proprties such as haste, bonus slots, ect. cost more when you ad them to a weapon, armor, ect.? figure it has to do with 2da files, but not sure where to start looking to do this.

any help is welcome,

zero
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
is there a way to....?
« Reply #1 on: March 01, 2011, 03:55:14 am »


               Are you talking about a forge system that you are using? You want it to cost more when a player adds the property to an item? Or do you just want the value of a weapon to be more when item properties are added?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
is there a way to....?
« Reply #2 on: March 01, 2011, 04:51:18 am »


               First let me Give the formula for the value of an item.  Oh an I should state that this is all copied and pasted from Documentation: Item Format


ItemCost = [BaseCost + 1000*(Multiplier^2 - NegMultiplier^2) + SpellCosts]*MaxStack*BaseMult +

The Multiplier  is the sum of the costs of all the Item Properties whose costs are positive.
So now we need the formula to find the value of a Item Properties.  Just Keep in mind that by the formula above all of the Item Properties values are going to be added together, Squared them multiplied by 1000 before being added to the value of the item.  example an item with only one Item Properties with a value of 5. would end up adding  5^2 * 1000 = 2,500 to the value of the item.  If the Item has 2  Item Properties with values of 5 it would add (5+5)^2 * 1000 = 100,000 to the value of the item.  This is why most number you see for the cost will be low. 

Any way here is the formula :


ItemPropertyCost = PropertyCost + SubtypeCost + CostValue


PropertyCost

In itempropdef.2da, get the floating point value in the Cost column, at the row indexed by the
PropertyName
Field of the ItemProperty Struct. If the Cost column value is ****, treat it as 0. This
floating point value is the PropertyCost




SubtypeCost

If the PropertyCost obtained above from itempropdef.2da was 0, then get the ResRef in the
SubTypeResRef
column of itempropdef.2da, at the row indexed by the 2PropertyName Field of the
ItemProperty Struct. This is the resref of the subtype table 2da.
In the subtype 2da, get the floating point value in the Cost column at the row indexed by the Subtype
Field of the ItemProperty Struct. This floating point value is the SubtypeCost.
Only get the SubtypeCost if the PropertyCost was 0. If the PropertyCost was greater than 0, then the
SubtypeCost is automatically 0 instead.


 
CostValue

In iprp_costtable.2da, get the string in the Name column at the row indexed by the CostTable Field in
the ItemProperty Struct. This is the ResRef of the cost table 2da.
In the cost table, get the floating point value in the Cost column in the row indexed by the CostValue
Field in the ItemProperty Struct. This floating point value is the CostValue.
 
   

I hope that helps.
               
               

               


                     Modifié par Lightfoot8, 01 mars 2011 - 04:55 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
is there a way to....?
« Reply #3 on: March 01, 2011, 05:22:25 am »


               Haste is a simple one. The only value you need to modify is the PropertyCost located in itempropdef.2da under the Cost column, it currently has a value of 3.5, That will  add 12,250   (=3.5^2 +1000)  to the item if it is the only thing added.
               
               

               


                     Modifié par Lightfoot8, 01 mars 2011 - 05:24 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
is there a way to....?
« Reply #4 on: March 01, 2011, 07:22:15 am »


               If you just need a property that adds cost to an item for UMD or level restrictions or some such, didn't they add a couple new 2das with 1.69 for material and condition?
               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
is there a way to....?
« Reply #5 on: March 02, 2011, 02:44:57 am »


               ok, let me explain a bit more for you guys.
i have a base sword that costs 30gp (i want to keep this at 30gp)
in my toolset i ad +1 to STR as a bonus and the weapons current (default) cost will now be 2910gp
i would like to be able to increase the cost of this weapon to say 3500gp or so without increasing the base cost and without adding extra cost in the toolset via the "Additional Costs" tab. this way level requirements will be raised without increasing the base costs of the weapons.
i thaught about material type and condition, but again, i don't know much about 2da's to know where to start with that. i'm also not sure that will work as well for what i want. since i'm looking to increase cost by enhancement rather than material type.... but i'm open to options.

@ lightfoot... as much as i appreciate the formula... huh? in other words... i'm not so good at that math thing '<img'>

zero
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
is there a way to....?
« Reply #6 on: March 02, 2011, 02:54:54 am »


               I got decrease cost in my new beta of community patch, but whats increase cost good for? I mean whats the +1 str longsword for, if it would have ILR 10?
               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
is there a way to....?
« Reply #7 on: March 02, 2011, 02:55:37 am »


               sorry lightfoot, didn't see the bottom section of your post for some reason... though i get what your saying, how do i go about changing it without messing things up too bad '<img'>
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
is there a way to....?
« Reply #8 on: March 02, 2011, 04:02:05 am »


               If you want change the ILR for all items, You are just going to create a head ach trying to modify the iProps.  It will be simpler to just edit the ILR levels.  You can find them in itemvalue.2da under the MAXSINGLEITEMVALUE column
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
is there a way to....?
« Reply #9 on: July 14, 2012, 01:43:30 am »


               

Lightfoot8 wrote...

First let me Give the formula for the value of an item.  Oh an I should state that this is all copied and pasted from Documentation: Item Format


ItemCost = [BaseCost + 1000*(Multiplier^2 - NegMultiplier^2) + SpellCosts]*MaxStack*BaseMult +

The [color=blue">Multiplier ]Item Properties[/color] whose costs are positive.
So now we need the formula to find the value of a [color=green">Item Properties. ]Item Properties[/color] values are going to be added together, Squared them multiplied by 1000 before being added to the value of the item.  example an item with only one [color=green">Item Properties with a value of 5. would end up adding ]Item Properties[/color] with values of 5 it would add (5+5)^2 * 1000 = 100,000 to the value of the item.  This is why most number you see for the cost will be low. 

Any way here is the formula :


ItemPropertyCost = PropertyCost + SubtypeCost + CostValue


PropertyCost

In itempropdef.2da, get the floating point value in the Cost column, at the row indexed by the
PropertyName
Field of the ItemProperty Struct. If the Cost column value is ****, treat it as 0. This
floating point value is the PropertyCost




SubtypeCost

If the PropertyCost obtained above from itempropdef.2da was 0, then get the ResRef in the
SubTypeResRef
column of itempropdef.2da, at the row indexed by the 2PropertyName Field of the
ItemProperty Struct. This is the resref of the subtype table 2da.
In the subtype 2da, get the floating point value in the Cost column at the row indexed by the Subtype
Field of the ItemProperty Struct. This floating point value is the SubtypeCost.
Only get the SubtypeCost if the PropertyCost was 0. If the PropertyCost was greater than 0, then the
SubtypeCost is automatically 0 instead.


 
CostValue

In iprp_costtable.2da, get the string in the Name column at the row indexed by the CostTable Field in
the ItemProperty Struct. This is the ResRef of the cost table 2da.
In the cost table, get the floating point value in the Cost column in the row indexed by the CostValue
Field in the ItemProperty Struct. This floating point value is the CostValue.
 
   

I hope that helps.


Sincere apologies if it's way too late to post anything more in this thread(I don't seem to be very lucky with the search engine), but since it's an extremely interesting subject clearly explained by a community senior, I could not resist, mostly considering that I'm currently coding a custom item upgrade system lol, so I would have a few questions, if I may:

1- The additional cost should be added to the final formula result, right?
2- Does the formula work well with ammo and throwing weapons, and should the additional cost be calculated for a single item in the stack or rather the whole stack?
3- What would be the most efficient way to retrieve the additional cost of an item, considering I would need to use vanilla NWN instead of the function defined in nwnx_funcs which does this?

Thanks to L8 for the posted infos + to anyone else who might answer these few questions or provide any additional infos on the subject.

EDIT: Purely as a suggestion for the OP(or maybe for a moderator, respectfully), it might be wise to make the title of this thread a bit more explicit as no doubt that the infos presented here can be very useful for a lot of builders in the community '<img'>

Kato
               
               

               


                     Modifié par Kato_Yang, 14 juillet 2012 - 05:58 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
is there a way to....?
« Reply #10 on: July 15, 2012, 04:37:46 am »


               Never mind my last post, thanks anyway, I have found the answers in the extensive IP researches made by Syrsuro in the Omnibus. The formula described in the Aurora item format is very far from producing the same results as an item upgraded in the toolset, as it contains several imprecisions, reported by many other builders in the past, as an info. A strange twist but then...

Kato
               
               

               


                     Modifié par Kato_Yang, 15 juillet 2012 - 03:45 .