Things Writers of Plugins Should Know

Since release, and as of 5.0.197, there have been some important changes to be aware of:

* Notes/Notes()

As mentioned in the build notes, the purpose of the notes() tag on traits has been pretty muddled over time due to a variety of folks using it in ways that were not intended. That tag was meant to be used in a tiny space to show table notes references such as “[1,2]” for weapon or armor footnotes. Yes, notes() was a bad name for it, but it originated back when GCA did far less.

The notes() tag is now enforced as a mode-specific tag for the original intended purpose (and even that is now discouraged in favor of using itemnotes() instead), and any use of notes() that was intended by a user to be general item-related notes or commentary should be changed to usernotes() or included in the description(), instead.

* Each trait’s Description() and UserNotes() tags are probably RTF formatted strings.

This may not work for you.

The new functions GetNotes(Optional ByVal AsPlainText As Boolean = True) As String and GetDescription(Optional ByVal AsPlainText As Boolean = True) As String allow for retrieving the usernotes() and description() tags of a trait, as normal RTF or as plain-text.

Line breaks (as LF characters) will be preserved.

* The Notes property on GCATrait has been will now return usernotes() as plain-text.

If you set it, it sets usernotes() with that text.

* Character.Settings has an ApplyDBToActiveDefenses property.

When TRUE, all active defense scores (block, parry, dodge) *will* include the DB value for the active shield (one equipped on an arm). When FALSE, those scores won’t include the DB (which is the traditional way GCA has done it).

If your application needs the scores *not* to include the shield DB but this setting is TRUE, you can set the value to FALSE, call RecalculateAll(True, False), do your exporting, then reset things for the user by setting the value back to TRUE and calling RecalculateAll(True, False) before quitting.

You can get the current DB being applied in the DefenseBonus() As Integer or DB() As Integer functions. The applied DB may be 0 if no shield is equipped.

* Each shield will have a charblockscore() tag.

This contains the character’s Block level when using that shield. This will include the DB for the shield, but if ApplyDBToActiveDefenses is TRUE, then the better of the two values (this shield’s DB or equipped shield’s DB) will be included.

* GCA provides the VTTNotes() tag.

This is per-trait as a way for the user to include VTT-specific notes or formulas, such as OTF expressions for Foundry. On an attack-mode level, GCA provides the mode-specific VTTModeNotes() tag for the same purpose.

* I have added Public Function DamageDisplayText() As String to the Mode object.

This function returns a string that represents the standard damage notation including damage, armor divisor, damage type, and radius. Example: 2d+1 (2) cut (2). You can also access this using Item.DamageModeTagItem() with “DamageDisplayText” as the tag, if you’re accessing mode values that way. This should obviate the need for you to build damage strings yourself, and it will correctly show the new comma-separated mini-modes if those are used by a trait.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.