Bits of default hell


* Miscellaneous

Tried again to have the Alt Attacks panel stop showing up uninvited on the Simple Edit window.

A certain circumstance could crash GCA when editing an item that might default to another. That has been addressed.

Added a new option to Options, in a new New Character block, that requires GCA to always allow you to select a library for the character when creating a new character. (If you make a lot of characters with various different libraries, this will help you. This is Off by default.)

When using TagItem() to check a trait’s ‘needscheck’ or ‘taboofailed’ GCA will now ensure that they’re returned as the numeric values (-1 or 0) rather than ‘True’ or ‘False’, which aren’t useful in numeric comparisons.

* Windows

Moved the Groups option from the View menu to the Character menu on the main window.

Changed the order of groups displayed in the Groups window to show Character groups first, then Library groups.

The Messages dialog should now respect Tablet Mode.

The Character Tags and the Groups dialogs should now respect Tablet Mode.

The Select X dialogs should now respect Tablet Mode.

* Right-Click Bait

Changed the right-click menu (on Classic and Unified views) sub-menu option “Bonus Granting” to “Active/Inactive” instead.

Added a Loadout sub-menu to the right-click menu (on Classic and Unified view) to allow adding the currently selected items to, or removing them from, the current loadout.

* Library Books and Bins

If you load a character with a library file that doesn’t exist (such as when opening an old GCA4 character), GCA should be a bit smarter about placing a new library file in the correct bin, if you select the option to create a new one with the same files.

GCA will now attempt to use the gcaaliaslist.ini file to find missing library books.

GCA will now attempt to search more diligently through the various bins when trying to find missing library books referenced by libraries. (This is usually a problem when a new library is created based on an old character’s referenced books.)

* Solver

Added a trap for one known type of crash error when bad data is in a Solver expression. GCA will now put a warning in the log, and return a 0 for the expression, since it can’t solve it.

* Defaults

I haven’t touched the code for defaults in a long while, but there were some things I wanted to do with it. Of course, I didn’t want to break it, either. I think I succeeded, but please be warned that I *did* mess with some things (gently, I hope) that may have broken it.

First, parsing the default() tag should now honor quotes, braces, and parens. Before, it only honored quotes, so if you had a trait name that included a comma within the name extension, it would parse on that unless you put quotes around it. Now, you should only need quotes or braces around traits that have commas that aren’t otherwise contained.

Second, I have allowed some non-trait defaults to pass as valid within GCA, primarily for reasons in the next bit. This shouldn’t break anything because such things, on their own, should still evaluate to 0 if they’re nonsense, but if they’re numeric, they allow for defaults from numbers and such. (Any non-trait item gets a deffromid() of 0, since such things obviously have no IDKey.)

Finally, I have added special support for finally allowing a complex expression to be used to set the default level. Doing this requires the use of the @default() specialty function, which isn’t really a function so much as a wrapper around your expression, but anything inside the @default() is sent to the full Solver. The @default() function should be at the end of the default item, while at the beginning of it should be the text that will be shown to the user as the deffrom() text. So, it should look something like this:

default(Some Expression @default(@max(10, 12))

which would give us deffrom(Some Expression) and deflevel(12). That’s a dumb expression, but that’s the idea. Also, the text portion is Text Function enabled, so you could do this kind of thing:

default( $if(1=2 then “Calc 1” else “Calc 2”) @default( @if(1=2 then 10 else 12) ) )

Since 1 <> 2, the user would see “Calc 2” as the deffrom(), and 12 as the deflevel().

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.