Functionally more bits (b201)

b201

You can now check if the character is currently processing a randomized template by checking char::random or char::randomized. It will return “1” if it is and “0” if it is not.

* Book Processing

I found a number of checks for duplicate values that were being done inside the check for Verbose status for error reporting. Those checks needed to happen outside that check since only the reporting matters for Verbose, not the safety of the data and avoiding a crash. Fixed the ones I found, which were related to duplicate hit location tables or duplicate notes within those tables.

* TL

GCA did not assign a TL to equipment items. These items had a techlvl() tag showing when they typically became available, but GCA didn’t create a TL tag for them when taken by the character. Now it does. The tl() assigned will be the techlvl() if its higher than the character’s TL, or the character’s TL if it’s higher than the techlvl() (as it is assumed to be a product of the character’s TL). This shouldn’t affect much of anything within GCA itself, but may affect malf numbers for a small number of items where GCA calculates those. (If the character’s TL is easily determinable as a numeric value, that numeric value is used for comparison, if not, it’s simply assigned to the tl() because GCA can’t do any of the other checks.)

With the change to always try to generate TL for equipment items, this would also result in the default Display Name routine always appending /TLx to every equipment item. That’s likely far more annoying than useful, since most characters use items manufactured for their TL. I have therefore added an option to show the /TLx appendix on equipment names, and it is Off by default. You can turn it on in Options on the Lists panel of the the Program Options tab.

* Bonuses

Gains bonuses (+X to me from Y) had an issue where any ‘from’ reference that didn’t use a prefix type and was not found, such as “+1 to me from hell”, would result in a bonus of +1. That should now be fixed.

I have added support to Gains bonuses for ‘from’ references of ‘char’ for the character itself, and of ‘parent’ for children and/or template components.

Gains bonuses should now be able to gain bonuses from the tags of ‘from’ references, such as points, level, or whatever. For example: gives(+1 to me from char::example) would give a bonus equal to the value of the ‘example’ tag on the character (or 1 if it is not a numeric tag value, while a char:: tag that is empty or doesn’t exist would result in a bonus of 0). You can also use this with traits, such as gives(+1 to me from SK:Acrobatics::points), which would give a bonus of +1 per point spent in the Acrobatics skill to the trait. Same for using a ‘from parent’ construction, such as gives(+1 to me from parent::points) which would give +1 per point spent on the parent trait.

* Functions

GCA will now remember the last value returned for the @Roll, @Random, and $RollValues functions. Bear in mind that these saved results will change each time these functions are called, so they’re only really useful inside the same operation, such as in an @if, and only reliable even then if you only use one of that function in the evaluation.

Note that all of these saved values are universal to GCA, *not* to the character or the trait.

To get the last returned value, use one of these functions. Note that they don’t have parameters, but you still must include the ().

@LastRoll()

Returns the last value returned by the @Roll() function.

@LastRandom()

Returns the last value returned by the @Random() function.

$LastRollValues()

Returns the last value returned by the $RollValues() function.

@NamedRandom(name, value1 [, value2] )
@NamedRoll(name, number [, sides] )
$NamedRollValues(name, number [, sides] )

These functions each work the same as their unnamed counterparts. The only difference is that you can name the roll by specifying the name as the first parameter. By using these functions and specifying unique names, you can retrieve them later by name and be less concerned that another use of the unnamed functions will overwrite the values.

These named versions do *not* place their results into the the LastX values used by the unnamed functions, so you can’t retrieve a value generated here with the LastX() functions (but you can with the LastNamedX functions). This allows you to use named results for longer storage and unnamed ones for transitory values without one messing up the other.

Note that all of these named results and their stored values are universal to GCA, *not* to the character or the trait.

@LastNamedRoll( name )

Returns the last stored/returned result for the given name. Returns 0 if there is no such name.

@LastNamedRandom( name )

Returns the last stored/returned result for the given name. Returns 0 if there is no such name.

$LastNamedRollValues( name )

Returns the last stored/returned result for the given name. Returns “0” if there is no such name.

@HasModIncludesText( text )

Searches the item’s modifiers (name and name extesion only, and each is checked separately) for all those that include the text specified, and returns the highest level among those that include it. Returns 0 if none found.

@HasModIncludesTextMin( text )

Searches the item’s modifiers (name and name extesion only, and each is checked separately) for all those that include the text specified, and returns the lowest level among those that include it. Returns 0 if none found.

@HasModWithTag( tagname [, tagvalue] )

Searches the item’s modifiers for all those that include the tag specified, and returns the highest level among those that match the tagvalue given (ignoring case as usual). If no tagvalue is given, any value for the tag counts as a match. Returns 0 if none found. (This performs text matching, so “0” matches “0” but does *not* match “0.0” or any other variation that would match numerically. See also @HasModWithTagValue.)

@HasModWithTagMin( tagname [, tagvalue] )

Searches the item’s modifiers for all those that include the tag specified, and returns the lowest level among those that match the tagvalue given (ignoring case as usual). If no tagvalue is given, any value for the tag counts as a match. Returns 0 if none found. (This performs text matching, so “0” matches “0” but does *not* match “0.0” or any other variation that would match numerically. See also @HasModWithTagValueMin.)

@HasModWithTagValue( tagname [, tagvalue] )

Searches the item’s modifiers for all those that include the tag specified, and returns the highest level among those that match the tagvalue given. If no tagvalue is given, any non-zero value for the tag counts as a match. Returns 0 if none found. (This matches tagvalue with candidate tag values numerically, so all values will be converted to numbers before comparisons are made. Tags with non-numerical values will evaluate to zero. This is a direct conversion, not a math-enabled Solver evaluation. See also @HasModWithTag.)

@HasModWithTagValueMin( tagname [, tagvalue] )

Searches the item’s modifiers for all those that include the tag specified, and returns the lowest level among those that match the tagvalue given. If no tagvalue is given, any non-zero value for the tag counts as a match. Returns 0 if none found. (This matches tagvalue with candidate tag values numerically, so all values will be converted to numbers before comparisons are made. Tags with non-numerical values will evaluate to zero. This is a direct conversion, not a math-enabled Solver evaluation. See also @HasModWithTagMin.)

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.