Bits of conditional fencing

b76

* Various

Trying out copies of the TL/Speed/Dodge/damage blocks from Classic Attributes on the General Information box in Unified.

Changed output of Windows version in the startup log.

If GCA finds gca5.prefs in its home folder, it will run in “portable” mode.

Added UI for changing User Folders (aka the various Bins) to Options.

Added an option to Options to allow/disallow auto-setting of Tablet mode when GCA starts up.

Added an option to the main window’s View menu to force Tablet Mode on or off. If on, auto-setting on startup is ignored.

Fixed a bug in the code that sets up trickle-thru calculations.

Updated the error messages related to plugins.

* Fencing Weapon

Added support for a fencingweapon() tag. (Maybe it should be lightweapon() instead?) The value for this tag, for current testing purposes, should be ‘char::enclevel’ such as fencingweapon(char::enclevel) because that will force GCA to create an association between the character and the trait, to ensure it’s recalculated when GCA’s encumbrance level changes. The given value of the tag is not used.

When this tag exists, and the character’s encumbrance level is above 0, GCA will create a charfencingpenalty(-X) tag, and add an item to the bonus list for encumbrance level affecting fencing weapon attacks and parries.

GCA will then use the charfencingpenalty() value to reduce the charskillscore() for the weapon. It then adds that value *back* before calculating the charparryscore() based on charskillscore(), and then reduces charparryscore() by that amount.

Net result: charskillscore() is reduced by EncLevel for the attack tables, and charparryscore() is reduced by EncLevel for the attack tables, and charparryscore() is not affected by ‘double dipping’ the encumbrance penalty.

* Conditional Select()

Added support for the new conditional() tag in the Select() structure. The conditional(), if it exists, must evaluate to True (a non-zero result) in order for the Select() to be processed.

	triggers(_
		select(_
			text("Select with Conditional. You'll never see this one."),
			conditional(@sametext("alpha", "bravo")),
			itemswanted(atleast 1),
			list(_
				DI:Alcoholism, 
				DI:Stubbornness, 
				DI:Workaholic_
				)_
			)_
		)

In this example, @sametext(“alpha”, “bravo”) evaluates to 0, so it would not be shown. Conditional() is, obviously, math enabled, so it supports the full Solver functionality to determine if the conditional() applies.

4 thoughts on “Bits of conditional fencing

  1. MrGadget

    I really wish you’d convert the library data to XML for GCA5 and abandon the home-grown text tag format you have. They’d be so much easier to create and edit with any standard XML editor and a tight XSD set.

    Reply
    1. Armin Post author

      Converting to XML for the book data is on my list of things I’d like to do. However, having already converted character files, I know it’s going to be a significant task, so it’s going to take some time before I tackle that.

      Reply
      1. MrGadget

        I’m a VB.Net code slinger too. Since you already have the parser for your current format, I wouldn’t think it would be that hard to either write the data back out in XML, or define a set of classes you can serialize with the XMLSerializer of .Net, and use the XML to produce a starter set of XSD’s.

        If you’d like to share your VB.net parser, perhaps I could help.

        Reply
        1. Armin Post author

          It’s not that hard to directly transfer from my tagged format to XML, no. That’s not really the hard part. The hard part is doing a conversion that’s actually meaningful, so that the XML format and the XSD are actually helpful in writing and reading the new files.

          For example, right now a lot of the data is in tags, and within those tags is data contained within more tags. The inner data isn’t processed up front, or saved in an object, it stays in tagged format until GCA uses it (usually when adding the trait to a character). So, in order to make it good and useful XML, this inner data should also be in XML format, which means that GCA would need to process it during loading–and there’s no structures for that. I have to create something for it, either to put it back into the current tagged format to use the existing processing, or a new object structure and new methods for processing those new objects. That takes a fair bit of time and effort completely aside from the obvious up-front XML work.

          Similar situations exist in a lot of places in the book data, as well as the various data file commands that work on that data.

          Reply

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.