CardMaker Tutorial: References: Defines

This guide covers the creation and usage of defines. They are not very complex so there is not much to this! Be sure you have a decent understanding of references before you work with defines.

  1. A define is a value that is available across your entire reference. Usually anything referenced with @[column name] must exist in the current row of your reference.

    With a define you can create values that can be referenced independent of the row. Maybe there are a number of constant values in your game that you want to easily tweak across multiple cards...

    This functionality is best used to save you a lot of trouble when working with FormattedText Elements. They can be very bulky and contain a lot of duplicated information to embed graphics.

  2. Creating a defines file is fairly easy. Name it the same as your reference file with _defines appended to the name -- Example:
    Reference File: data.csv
    Define File: data_defines.csv
  3. The file should be located in the same folder as your reference.
  4. The content of the define file (also a CSV like the reference) is as follows:
    1. Column 1: Define Name
    2. Column 2: Define Value
    3. Row 1: You can name the columns whatever but I recommend: Define and Value
  5. As with references you can even nest a define to reference other defines. (see the fourth row)

  6. That is just about all there is to defines. You can use them just like a reference value with @[column name].
    Other Ideas / Uses
  1. Reduce FormattedText Clutter
    DefineValue
    factionImg<img=images\faction_empire.bmp;.90;0;3>
    With this you can easily reference the icon in any FormattedText element with just @[factionImg]. If you reference factionImg in multiple places you can tweak its configuration in just a single spot.

  2. Reduce Clutter Overall + Nesting
    DefineValue
    tokenActionCost3 tokens
    tokenActionMessageEach Action you take costs @[tokenActionCost].

    Sometimes you need to repeat extensive information/instructions. Centralizing this into a single spot means future tweaks are controlled by a single entity. You can further simplify this with nesting of values.

  3. Defines Referencing Columns
    DefineValue
    factionImg<img=@[image];.90;0;3>
    Remember that values are processed based on the defines combined with the current row of your reference file. You can create a hybrid define that can pull from the reference as indicated in the above sample.

    Obviously you can be a lot more creative than these samples but hopefully you get the idea. The goal of defines is to cut down repetition and centralize your core variable values.
    There are also project wide defines for use across all layouts/references. See the manual for details.


© Copyright NHMK 2018    e-mail: nhmkamv at gmail
(Pages on this site use Javascript so if you do not see content you have Javascript disabled!)