Display Names and Totals from Children

This preview is of something a bit more esoteric than the previews we’ve done so far, and also covers two different things that I can show the results of in one image:

gca5_totalchildrentag

Here on the right side, you can see the use of the new displaynameformula() tag to create a custom name for each of the grimoire items, which includes the number of pages contained in that chunk. And the pages are totaled up using the new @totalchildrentag() function, coupled with custom pages() and pages#() tags.

This combination of features allows you to customize things a bit more, although it’s definitely not the easiest of things to do. The data file code for the three items above looks like this:

Grimoire Book, basecost(1000), baseweight(10), pages(0), pages#(me::pages + @totalchildrentag(pages#)), isparent(yes), displaynameformula($val(me::basedisplayname) ($eval(me::pages#) pages))

Grimoire Chapter, basecost(100),baseweight(1), pages(12), pages#(me::pages + @totalchildrentag(pages#)), displaynameformula($val(me::basedisplayname) ($eval(me::pages#) pages))

Grimoire Signature, basecost(50),baseweight(0.5), pages(6), pages#(me::pages + @totalchildrentag(pages#)), displaynameformula($val(me::basedisplayname) ($eval(me::pages#) pages))

The pages() tags include the number of pages each individual item contains.

The pages#() tag is a separate tag from pages(), but is auto-calculated by GCA when referenced (as denoted by the # in the name), and returns the total pages for the chunk and all children.

The displaynameformula() tag defines the display name as the default display name, plus the number of pages in parens after that. It determines the number of pages using the pages#() tag, so that children and nested children will all be included automatically.

As I said, this particular thing isn’t the easiest to deal with, but perhaps we can improve on that in the future.

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.