Why don't items feature a "scripts" tab?
Dark_Ansem
Member Posts: 992
I noticed this while digging HotU. Having a script tab would allow us to "bake" unique item powers into the item, rather than having to rely on module properties.
0
Comments
https://nwnlexicon.com/index.php/Grimlar_-_Introduction_To_Tag_Based_Scripting
Basically, the idea is to have one script per item (or one per-item, per-event), and then from the module's OnItemUsed and similar events fire off the correct script based on the tag of the used item. This achieves the exact same result as you'd have with per-item script tab, while keeping the resource usage reasonable.
- OnActivateItem
- OnAcquireItem
- OnUnAcquireItem
- OnPlayerEquipItem
- OnPlayerUnEquipItem
- OnHitCast
- OnSpellCastAt
By having one script that handles all the events, you avoid having to have 7 different scripts per item in the module.