Author Topic: New Base Items - how do I create one?  (Read 567 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
New Base Items - how do I create one?
« on: October 06, 2011, 09:25:14 pm »


               I'm having some trouble understanding the process of adding new Base Items.  In creating a new base item in baseitems.2da several of the fields are unclear - at least in the sense that I do not understand where they are defined.

For example in the baseitems.2da in the CEP top hak:
Line 388      
Name: 16967250
Label: stacksmall2
Description: 1726
BaseItemStatRef: 5448

Where do the Name, Description, and BaseItemStatRef get defined?  What does the BaseItemStatRef do?  If it's in the cep23_v1 tlk file, where can I find it?  Stackable Small 2 has a strref of 190034 in the tlk file and that doesn't seem to be referenced in the baseitem.2da at all.

If I wish to create another base item with the above as a template, how do I give it a different name?
               
               

               


                     Modifié par 3RavensMore, 06 octobre 2011 - 08:25 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #1 on: October 06, 2011, 10:04:22 pm »


               <dashing off a note...>

The numbers you list are references to the tlk file. The huge number is to a custom tlk and the lower numbers - 1726 & 5448 refer to text strings in the bioware .tlk file. 

Edit: (reedit: Ahh... Thanks U)...  Drat, I feel so crippled without my laptop or the Vault :-(

(Just discovered the place I volunteer at has blocked the vault; Can't give links...  :-( This board is probably next. :-P )

<...and sounding sour>
               
               

               


                     Modifié par Rolo Kipp, 06 octobre 2011 - 09:24 .
                     
                  


            

Legacy_gutwrench66kg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #2 on: October 06, 2011, 10:06:37 pm »


               the "real" strref for an anything in a custom TLK is actually 16777216 higher than what you entered.

So if my entry on the custom TLK is "1", then it's actually 16777217 for purposes of 2da entries and scripts.

BaseItemStatRef gives you the basic information about that object.. so if I opened a 2da file and decided that longswords needed to do 2d20 damage instead of 1d8, I could easily do so. However upon examining the weapon, it would only list as being a 1d8.
The BaseItemStatRef in this case is in the actual NWN Dialog.tlk rather than a custom one.

If you'd like to create a new StatRef, simply create a new entry in your own custom TLK while adding 16777216 to that # when you enter it into your baseitems.2da
               
               

               
            

Legacy_gutwrench66kg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #3 on: October 06, 2011, 10:19:56 pm »


               as for giving it another name... you simply need to add a new entry into the TLK for a name as well.. again, adding 16777216 to it.

If I were making my own custom TLK for a yo-y0, I could enter as follows

Name:16777217 (Name of the item type.. e.g. yo-yo. which would display when item is unidentified or created in the toolset. If I pick up an unidentfied "Halfling Vorpal Yo-yo +5", I will simply get "Yo-yo (unidentified)" This would appear on custom TLK line 1)

Label: yoyo

Description: 16777218 (Custom TLK line #2. Will give the base description of this item type.."The yo-yo in its simplest form is a toy consisting of an axle connected to two disks, and a length of twine (usually called a string) looped around the axle, similar to a slender spool. "  Unless an custom description of a particular yo-yo is given, this is what will display for each of them

BaseItemStatRef: 16777219 (Custom TLK line 3) This will give the stats for the yo-yo as a weapon.. I can enter information such as damage, crit range, weight, proficiency required, etc. so that players can read about it. If I initially write down that it requires the exotic proficiency, it will read like that on examine in game.  But in my baseitems2da, under required feats, I entered the rogue proficiency as well. The item description will indicate that only exotic can equip it, however anyone with the rogue proficiency could equip it as well. I would need to update the tlk to indicate that the rogue proficiency also works.
               
               

               
            

Legacy_gutwrench66kg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #4 on: October 06, 2011, 10:21:40 pm »


               
               
               

               


                     Modifié par usagreco66kg, 06 octobre 2011 - 09:22 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #5 on: October 06, 2011, 10:45:53 pm »


               The Lable is just a Refferance for someone reading the 2da.  It is not uses for anything other then that.  Unless of course you want to script a use for it. discriptions for all of the 2da line are in the wiki. 

http://nwn.wikia.com...i/Baseitems.2da


For talk table refferance I guess it is best to just quote the FileFormat.  
And this is just for another way of saying it since it has already been said above. 

Bioware_Aurora_TalkTable_Format.pdf...

...Valid StrRefs can have values of up to 0x00FFFFFF, or 16777215. Any higher values will have
the upper 2 bytes masked off and set to 0, so 0x01000001, or 16777217, for example, will be
treated as StrRef 1.
Under certain conditions, the upper 2 bytes of a StrRef may have special meaning. Refer to Section 2.4 for details....



2.4. Alternate Talk Tables
A module may specify that it uses an alternative talk table besides dialog.tlk.
If a module uses an alternate talk table, then bit 0x01000000 of a StrRef specifies whether the
StrRef should be fetched from the normal dialog.tlk or from the alternate tlk file, If the bit is 0, the
StrRef is fetched as normal from dialog.tlk. If the bit is 1, then the StrRef is fetched from the
alternative talk table.
If the alternate tlk file does not exist, could not be loaded, or does not contain the requested
StrRef, then the StrRef is fetched as normal from the standard dialog.tlk file.
Example: StrRef 0x00000005 refers to StrRef 5 in dialog.tlk, but 0x01000005 refers to
StrRef 5 in the alternate tlk file. If the Alternate StrRef 5 could not be fetched, then fetch
the Normal StrRef 5 instead.
The filename and location of the alternate talk table is not part of the definition of TLK file
format. However, if a feminine talk table is required, then the feminine version of the alternate talk
table must be located in the same directory as the masculine/neutral one.
Example: If a non-English module uses an alternate talk table called "customspells", then
there should be a customspells.tlk and customspellsF.tlk file.

 
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #6 on: October 06, 2011, 10:53:46 pm »


               <dropping non-sequitors...>

Oh, cool. I can still access the wiki... Thanks LF.

<... on his way past>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #7 on: October 06, 2011, 11:47:47 pm »


               Something to note - some base item types have hard coded limitations. Things like shields for example can not be mimicked with an additional base item entry. I have created some custom weapons however. The trick with these was to pick a similar weapon and add 256 to it. I did this for a Maul. I added 256 to the index for warhammers and put the maul at that index in my base items. I also modified the spears in base items to act as one handed short spears. And then created an entry for long spears by putting them at an index equal to the index of spears + 256. Nevertheless this trick does not work for shields.
               
               

               


                     Modifié par henesua, 06 octobre 2011 - 10:48 .
                     
                  


            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
New Base Items - how do I create one?
« Reply #8 on: October 07, 2011, 03:41:07 pm »


               Valid StrRefs can have values of up to 0x00FFFFFF, or 16777215. Any higher values will have
the upper 2 bytes masked off and set to 0, so 0x01000001, or 16777217


Ahh, now it works.  That actually should have been - while not obvious -- something not too hard to puzzle out.  Alas, my memory hasn't focused on programming in many moons.  Many, many moons.  My thanks to everyone that responded.

Be Well.