Hard coded limit?
#1
Posté 07 mai 2011 - 06:22
It might have been just the graphic file as opposed to the list category. i.e only so many pictures of gems or potion bottles etc.
I'm looking to add some more custom content, but I'm afraid that if this is true we may be approaching critical mass.
#2
Posté 07 mai 2011 - 07:17
Three-part/layer icons can have up to 246 icons for each part/layer (numbers 010-255). These are shown in the toolset as model (1-25), with colors for more varients (0-9 possible, except 0-5 on model 25). This goes for things like potions, and weapons (and Project Q items split into multiple parts). Weapons need models for every part/layer, and every weapon model needs an associated icon part.
I think that #255 limit goes for almost every item type. Maybe for armor, too, but not sure on that, since that's one item type I've not messed with over the years.
As far as a limit to the number you can have in each section of the game palette...I'm not sure if there is one or not. I've never hit one myself. There's just the 16k limit on total blueprints (monstes/items/triggers/etc....pass that one and players can still play, but the DM client freezes/crashes).
#3
Posté 07 mai 2011 - 07:27
One question. On the "adding simple misc. item types to baseitems.2da" Does that mean I could add another say.."Potions2" categore to get another 256 potions available? Or is it just "misc."?
#4
Posté 07 mai 2011 - 02:07
Three-part/layer icons can have up to 246 icons for each part/layer (numbers 010-255).
I've always been told it was 1-25 - I'm totally confused now!
#5
Posté 07 mai 2011 - 02:52
In the toolset, you have 25 different options in the dropdown. However, using color variants, you can add more. You see, there is nothing preventing you from adding completely different models as color variants for a specific model. You just have to do a little more work in the toolset when setting the appearance for an item.Rubies wrote...
Three-part/layer icons can have up to 246 icons for each part/layer (numbers 010-255).
I've always been told it was 1-25 - I'm totally confused now!
#6
Posté 07 mai 2011 - 08:59
#7
Posté 07 mai 2011 - 11:01
You can add a "potions 2" item type, but it won't get the drinking animation when used...that's hardcoded for regular potions (the same goes for scrolls and the reading animation, shields and proper equipping to the left forearm node, torches and the "torch holding" animations, etc.). Pretty much any item type that has a special animation/pose associated with it's use won't have those if you try to add a similar item type.Eagles Talon wrote...
One question. On the "adding simple misc. item types to baseitems.2da" Does that mean I could add another say.."Potions2" categore to get another 256 potions available? Or is it just "misc."?
New miscellaneous items that just use an inventory icon you can add as many as you want to the baseitems.2da file. I suggest doing a copy & paste of the type of item you want, then alter what's needed after that in the entry.
Note: New item types after a certain line number in the 2da (probably around 128 or so) will work fine in-game, but when unidentified and picked up by a PC, the combat info/log window will show the acquired item type as a "bad strref"...this is just a limit to the game engine and isn't cause for alarm. The proper item type will display both in the inventory screen normally and in the description when examined.
As far as the 3-part/layer items go, it's set up like this:
Example: default longsword
In the toolset, you'll see a "part number" and a "color number" for the top, middle, and bottom. Part numbers start with 1 and can go up to 25 (if models get added via hak file). Color numbers are usually 1, 2, 3, or 4 (with the different colors simply variants on the same shape as color 1.
That Part 1, Color 1 item is actually using model and icon number 011...the 1st two digits of the file names are the part number, the last digit is the color. Part 3, Color 2 is model and icon number 032.
Example 2: default longsword with custom content additions
By adding icons and models, you can greatly expand on available appearances. Still using the longsword, in the hak you can add new part numbers and "colors". Just make sure to add the "color variants" to "part 1" first, otherwise you can't access those "colors" in the higher "part" numbers.
So, if we want to be able to fully expand on possibilities for blade appearances, we need to add both models and icons for colors 0, 5, 6, 7, 8 and 9 to top part number 1.
*_t_010
*_t_015
*_t_016
*_t_017
*_t_018
*_t_019
With the upper limit on this being #255, that mean "part 25" is limited to "colors" 0 to 5.
*_t_250
*_t_251
*_t_252
*_t_253
*_t_254
*_t_255
This works for any of the 3-part/layer item types...weapons, potions, wands, rods, staves, and any new such items you decide to add.
Any such item types that don't have an equipable 3D model associated with them (rods, wands, potions, any misc. items) don't need new models, just the icons. You do need new models if your module uses a hak that makes wands and rods equipable, otherwise you'll end up with PCs holding plain brown sacks.
Technically, I think you might even be able to make new 3-part "misc." item types that just use inventory icons. You'd loose the spots for icons numbered 0-9, but be able to have a single item type with 3 layers of 246 appearances...just make sure each section (top, middle, and bottom) has one appearance that's just black with a solid black alpha channel in the icon (for a "blank"), and you could have up to 735 (245 * 3) different misc. icon appearances with a single item type.
Modifié par The Amethyst Dragon, 07 mai 2011 - 11:04 .
#8
Posté 11 mai 2011 - 10:04
Is there something I am missing in the explanation above that would account for my problem? 5t is driving me to yank hair, the fact that some weapons can get to that number, but others cannot.
#9
Posté 11 mai 2011 - 11:53
To anyone: From a couple of threads like this one (starting here) I've noticed that people have mentioned that some hardcoded 2DA functionality might "wrap around" after line 256.
In the thread I link to, the issue is just the "acquired item" message when picking up an unidentified item which is a new base item on line 257 or greater, I believe. I take Khuzadrepa's post as an indication that one might be able to truly extend the selection of existing base items lower than row 256 (a large shield, for instance) by taking the row of the original base item, padding out to 255/256 (?) rows beyond it and having the "extended" entry in that 2DA row.
I'm sure sometime before I die I'll try to get around to testing the idea out but I wanted to throw the question out there and see if anyone has tried this before/would be interested in trying it. I would much rather somebody find out if this idea has a payoff rather than sitting on it until I can test it myself.
Has anyone ever tried this sort of thing before and can offer up what their experiences were? Any takers?
#10
Posté 12 mai 2011 - 02:41
This is a REALLY interesting idea. I never got the time to go beyond confirming what tdonadio was asking, however, Ben Harrison (I think) had played around with the armor 2da and had gotten some similar properties when wrapping like this. There is a thread about that on the old forum somewhere, when I get a chance I'll try to dig it up.OldTimeRadio wrote...
To anyone: From a couple of threads like this one (starting here) I've noticed that people have mentioned that some hardcoded 2DA functionality might "wrap around" after line 256.
In the thread I link to, the issue is just the "acquired item" message when picking up an unidentified item which is a new base item on line 257 or greater, I believe. I take Khuzadrepa's post as an indication that one might be able to truly extend the selection of existing base items lower than row 256 (a large shield, for instance) by taking the row of the original base item, padding out to 255/256 (?) rows beyond it and having the "extended" entry in that 2DA row.
I'm sure sometime before I die I'll try to get around to testing the idea out but I wanted to throw the question out there and see if anyone has tried this before/would be interested in trying it. I would much rather somebody find out if this idea has a payoff rather than sitting on it until I can test it myself.
Has anyone ever tried this sort of thing before and can offer up what their experiences were? Any takers?
I might take a swing at playing with this tomorrow. Maybe I'll test potions to start. Good thought OTR!!
#11
Posté 12 mai 2011 - 01:54
#12
Posté 12 mai 2011 - 02:38
I tested by taking the vanilla torch and creating a new item type with it in a baseitems.2da from 1.69 that I padded out to line 269, and added the new type as line 270 (which I verified using the unidentified acquire bug mentioned earlier to be the correctly displaced 'torch' line.) The character/item would not hold up the item like a torch from line 15.
AmethystDragon appears to be right, it doesn't look like any other line can assume those animation properties.
I was wondering if things like weapon feats and stuff would correspond, but my guess is that's a no.
#13
Posté 12 mai 2011 - 06:13
You might also try making a new shield (which is just one below torch, I think) and see if it gives you the "You are too large to equip this item." message when trying to equip it. Or, if you still have your test module laying around, feel free to kick it to me. One of the things I've had a bit of fun with is searching for "hardcoded" in the NWN Omnibus and then seeing just how hardcoded (whatever) winds up being. It's not a perfect method but I dig a bit in the strings of NWMain.exe (and sometimes others) to see if I can get a "clue" what's hardcoded and what's not or, sometimes, undocumented functions.
Modifié par OldTimeRadio, 12 mai 2011 - 06:15 .
#14
Posté 16 mai 2011 - 12:25
I'll give the shields a whirl, too. Then I'll probably forward you my test hak and module, so you can poke around if you like.





Retour en haut






