Aller au contenu

Photo

How to create a custom sheild - (and overcome the hardcoded limitations)


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

#1
0100010

0100010
  • Members
  • 87 messages
Currently it is not possible to create a custom sheild entry in BaseItems.2da If you do so, and try to equip that sheild you will not be able to do so. You will get a message stated "that item is too large for you to equip" or something like that.

The reason is because the BaseItems.2da lines for Small, Large, and Tower Sheild are hardcoded. The stat rules for those sheild on those rows will always be used for them. Therefore you can't create variations on these sheilds such as Masterwork or Mithril version which have reduced or improved values.

What you can do, is zero out the sheild values for those default rows. Set the base AC to 0, the Armor check penalty to 0 and the arcane spell failure chance to 0. Do the same for its corresponding row in Armorrulesets.2da

If you then equip such a sheild you will see as expected no change to AC, Arcane Spell failure, or Armor Check Penalty.  This is now our new template. Note that it doesn't even matter, which sheild type is being use (large or small, hwever tower still has tower sheild feat requirements)

In fact since you have 3 rows of shiled templates to work from, ideal one row would be just for those sheild which require Sheild proficiency only. ONe row which requires tower sheild proficiency, and the last row which might
require some new exotic sheild proficiency.

So now you need to make blueprints for you sheild which represent all the flavors you want to support.
You wil have to add ItemPropertyACBonus(X) to create the real shiled AC bonus that this sheild provides (be in from 1 to whatever number you want).   You will then need to add ItemPropertyArcaneSpellFailurePenalty in whatever amount is called for for this version of the sheild you are making.

Lastly you will need to edit the OnEquip and OnUnEquip scritpts or use tag based scripting to IDentify the sheild that the player just equipped or unequipped. In OnEquip you will add the EffectArmorCheckPenaltyIncrease to the PC in the amount that is appropriate. In the OnUnequip, you will find and remove this effect.  Make the Effect Extraordinary to make it persist over resting.

Column BaseItemStatRef in both baseitems.2da and armorrulesets.2da is the TLK value which points to the standard stat text which is seen when the sheild is examined. (where it shows the Sheild AC bonus, check penalry, spell failure etc) This value can be set to a TLK value of an empty string, since the exsting info will be incorrect.  Now just edit the description of your blueprint directly to emulate the Stat text with the proper numbers that you have customized. Note that the item properties will give the AC bonus and arcane spell failure info on their own so only the other parts of the stat text need be shown.

Now you can create custom sheild without needing any new baseitem rows or any armorruleset rows to enable them.

Disadvantages to this method:  If some other effect gives you an additional sheild AC bonus, it might not stack, I have not tested this. Likewise for the Armorcheckpenalty increase effect or the arcane spell failure effect. (however it does seem to stack just fine with ASF from armor)

This technique is compatible with Player Skins.

Modifié par 0100010, 21 novembre 2010 - 07:58 .


#2
Bonzoli

Bonzoli
  • Members
  • 7 messages
Nice, do we have to make scripts for all the existing shields?

#3
0100010

0100010
  • Members
  • 87 messages
Not necessarily, you could make one universal script for all of them and set the AC, ACP, and ASF values on the blueprint as a variable that the script looks up. In fact during my testing I used the equip script to add the ItemProperties themselves, then set a flag so that next time it was equipped it would not try to add them a second time.

#4
MasterChanger

MasterChanger
  • Members
  • 686 messages
Thanks very much for providing this info, 0100010!

One very minor nitpick: I believe the effect should be made Supernatural rather than Extraordinary. Extraordinary would not allowed it to be dispelled (since it's not magical) but would still make it fade on resting. Supernatural should make it persist through both dispels and resting.

#5
The Fred

The Fred
  • Members
  • 2 516 messages
Is the problem with custom shields something to do with the shield properties? In NWN1 at least you could create off-hand items (like torches or shields) which worked just fine, though they wouldn't give AC bonuses etc like shields do. Still, you could surely just create an item like this and then add the effects to the player with the methods you've described, but only do it for your custom shield(s) and not have to change the existing ones?

#6
0100010

0100010
  • Members
  • 87 messages
You can make an off-hand equipped which uses a shield model and has all the properties so described (actually you'd need to test if the item properties are viable, as not all item properties can be placed on all object types) However, if you leave the original shields in place, and make them avail;available in game you will still run into the skill check penalty bug if you use player skins.



If they are made as a weapon, you could possible try to implement bashable shields, but must also be aware that they will cause the two-weapon fighting penalties by default as well.