Skip to content

Add support for multi-column defines and additional define files/sheets #176

@nhmkdev

Description

@nhmkdev

Please describe your feature request.
Add support for being able to reference a sub-value of a define id.
Add support for including additional define files for a given project / layout (ideally available on both).

Describe the solution you'd like

For referencing columns:

Example:

define id name movement cost
alpha The Alpha 4 10
beta The Beta 3 6

An element could reference a sub value with: @[alpha.name] and for complicated nested lookups: @[@[character].name]

The delimiter . will not work with JavaScript so in that context __ (double underscore) is used.

Functionality in Beta Build

  • Allow project to reference multiple custom defines files (the old fixed name style is still supported)
  • All define files now support fields (completely optional).
    • This is a bit like introducing objects (for those programmers out there)

Work-in-progress build link: v.1.5.0.0-unstable.v.a4

How To Use

Create defines files (slightly new format)

define name move cost
alpha Alpha Ship 4 25
beta Beta Barge 2 40

Backwards compatibility: Old style define references like @[alpha] will still refer to the second column (in this case the name column)

Add define references to the project

  1. Right-click the Layouts node (or click the Project menu) > Define References...
  2. Add define references the project (can mix and match CSV, Google, and Excel)

Use the define fields

Examples:

  • @[alpha.name]
  • @[alpha.cost]
  • @[alpha] (result will still be the second column, so Alpha Ship )

More complicated example

engines.csv

engine name move cost
slow Slow XL 2 10
turbo Turbo Fast 5 20

ships.csv

ship name engine cost
alpha Alpha Ship slow 25
beta Beta Barge turbo 40

Usage

Now you can reference the move of the ship's engine via: @[@[alpha.engine].move]
You could make this even further nested as necessary based on the context. There are a ton of opportunities using this style of object definition.

The Defines window is also helpful to debug/see what was loaded.

Wait wait wait... what's the difference between a defines file and a reference file?

  • defines file: defines are ALL accessible ALL the time and you can refer to them by @[defineName.subfield] (or the classic @[defineName] )
  • layout reference file: only the current row columns are accessible. There is no sub-field. @[columnName]

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions