Difference between revisions of "Aspect"

From Wildermyth Wiki
(Added a lot of common and implicit aspects)
Line 15: Line 15:


Aspect parameters can be used to store a relationship with a particular entity. In this case the entity's id will be used as the parameter content, and be passed down to effects as well. Effects can also target based on aspect relationships.
Aspect parameters can be used to store a relationship with a particular entity. In this case the entity's id will be used as the parameter content, and be passed down to effects as well. Effects can also target based on aspect relationships.
If you're making an [[Effects|effect]] and want to check if an entity has a parameterized aspect without knowing what the parameter is, you can use the star (*) character. i.e. matching "loverWith*" would match any unit with a "loverWith|ENTITY" aspect.
If debugging non-hero aspects (for example, if you want to see aspects on the company, enemies, or sites), you can turn on Options>Interface>DEV[inspectNonHeroes] to allow showing the character sheets for non heroes.


==Hooks==
==Hooks==
[[Hook]]s are a special subcategory of aspects, which are usually designated when a hero is first generated, and are used to trigger [[Event#Opportunity|hook quests]].
[[Hook]]s are a special subcategory of aspects, which are usually designated when a hero is first generated, and are used to trigger [[Event#Opportunity|hook quests]].
==Common Aspects==
There are many aspects that are added automatically by the game that you will likely want to check when making [[Effects]]. Here's a list of some you may want to use. (You can also see all of these in the aspects section of the content editor)
===General===
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| alive || unit || This unit is alive.
|-
| dead || unit || This unit is dead. (Potentially useful if you want to make reference to a dead hero in a comic)
|-
| female || unit || This unit is a woman.
|-
| male || unit || This unit is a man.
|-
| farmer || unit || This unit is a farmer, i.e. not a warrior, hunter, or mystic
|-
| warrior || unit || This unit is a warrior
|-
| hunter || unit || This unit is a hunter
|-
| mystic || unit || This unit is a mystic
|-
| theme_* || unit || Each theme has a corresponding aspect, like theme_crow, theme_wolf, and theme_tree. These can be used to make specific events centered around heroes with themes.
|}
===Relationships and Family===
Note that a lot of these aspects are [[#Aspect Parameters|parameterized]], which means you can use them to get an associated unit.
These aspects tie in closely with the relationship [[Expressions#Variables|variables]] like HAS_LOVER, LOVER_WITH, CHILD_OF, FAMILY_WITH, etc. You will often find that matching those variables based on score or a test is the correct way to match heroes in a relationship.
You'll note that dead heroes are treated slightly differently. This is because once a hero dies, they no longer have any relationships with other heroes. Aspects like "deadLover" are to allow for events that refer to past lovers who are now dead.
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| attractedToMen || unit || This unit is attracted to men.
|-
| attractedToWomen || unit || This unit is attracted to women.
|-
| {{!}}childOf{{!}}HERO || unit || This unit is the child of HERO
|-
| {{!}}parentOf{{!}}HERO || unit || This unit is the parent of HERO
|-
| {{!}}familyWith{{!}}HERO || unit || This unit is family with HERO (parent, child, grandparent, grandchild, etc.)
|-
| {{!}}deadChild{{!}}HERO || unit || This unit had a child that died.
|-
| {{!}}deadParent{{!}}HERO || unit || This unit had a parent that died.
|-
| {{!}}deadShip{{!}}HERO{{!}}TIER || unit || This unit had a relationship (friends, lovers, or rivals) with HERO, who died
|-
| {{!}}deadShipOf{{!}}HERO{{!}}TIER || unit || This unit is the dead hero who had a relationship with HERO
|-
| {{!}}deadFriend{{!}}HERO{{!}}TIER || unit || This unit was friends with HERO, who died
|-
| {{!}}deadFriendOf{{!}}HERO{{!}}TIER || unit || This unit is the dead friend of HERO
|-
| {{!}}deadLover{{!}}HERO{{!}}TIER || unit || This unit loved HERO, who died
|-
| {{!}}deadLoverOf{{!}}HERO{{!}}TIER || unit || This unit is the dead lover of HERO
|-
| {{!}}deadRival{{!}}HERO{{!}}TIER || unit || This unit was rivals with HERO, who died
|-
| {{!}}deadRivalOf{{!}}HERO{{!}}TIER || unit || This unit is the dead rival of HERO
|}
===Company===
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| chapterNumber || company || What chapter are we on?
|-
| {{!}}seenEvent{{!}}TEMPLATE || company || Under the hood, this is how we keep track of which events the company has seen during this campaign, where TEMPLATE is the event id.
|-
| gameIsOver || company || The game is over! Specifically useful to prevent certain tidings from firing in the credits.
|}
===Scenery===
Scenery aspects can be examined using the Scenery Lab > Aspects panel.
Scenery has different aspects that are used to determine how they interact with the world.
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| goodCover || scenery || This scenery will provide good cover to adjacent units. (If neither the goodCover nor the noCover aspects are on scenery, it will provide partial cover)
|-
| noCover || scenery || This scenery will provide no cover to adjacent units.
|-
| flammable || scenery || Fire can spread onto this scenery. (See the "fireSpreadsToScenery" effect)
|-
| immuneToFire || scenery || Fire doesn't damage this scenery. (Right now, this just gives the scenery warding)
|}
Scenery also has different aspects that are primarily used for interfusion abilities. These aspects are as follows:
bone, book, liquid, mechanism, metal, plant, rock, shards, statue, textile, tools, tree, wood
And some more special ones, like:
interactiveLampOn, lampCanFlare, lampIsFireSink, lampIsFireSource
===Abilities===
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| {{!}}numUses{{!}}ABILITY_ID || effect || When you give an ability a specific number of uses per combat via ability.numUses (see hurlaxe_throw for an example), the number that have been used is kept track of under the hood using the {{!}}numUses{{!}}ABILITY_ID aspect. This can be used to do things like make offhands disappear when they're used up.
|}
===Special Cases===
Scenery has different aspects that are primarily used for interfusion abilities.
{| class="wikitable"
|-
! aspect !! entity type !! explanation/usage
|-
| {{!}}npcId{{!}}NAME || individual || When you create an individual via [[Effects#Implications|implications]], you can give that individual an npcId, which can be used to make that npc show up again in a later event. All units with npcIds are always available to get throughout a campaign, including during missions.
|-
| {{!}}largePet{{!}}_ENTITY_ || individual || This individual has a large pet. See [[Outcomes#AddPet]]
|-
| {{!}}isLargePet{{!}}_ENTITY_ || individual || This is a large pet. See [[Outcomes#AddPet]]
|}
==Implicit Aspects==
Some aspects are '''implicit''', meaning they aren't actual aspects on the entity, but are instead determined by checking some criteria when the aspect is checked for. These are also commonly used when making [[Effects]].
{| class="wikitable"
|-
! aspect !! target !! explanation/usage
|-
| ENEMY || unit || Is this unit controlled by the opposite faction of relativeTo?
|-
| HOSTILE_TARGET || unit || Is this unit controlled by the opposite faction of relativeTo, AND relativeTo is able to target them? (i.e. the unit isn't hidden or in stasis, and relativeTo isn't being taunted by someone else)
|-
| ACTIVE || unit || Is this unit currently under a faction's control?
|-
| ALLY || unit || Is this unit controlled by the same faction as relativeTo?
|-
| MAIN_HAND || item || Is this weapon equipped in the MAIN_HAND slot of relativeTo?
|-
| INACTIVE_ITEM || item || Is this item an inactive item of relativeTo?
|-
| SELF || any || Is this target the same as relativeTo?
|-
| NOT_SELF || any || Is this target NOT the same as relativeTo?
|-
| RANGE_EQUIPPED || unit || Does this unit have a weapon equipped with the "ranged" aspect?
|-
| MELEE_EQUIPPED || unit || Does this unit have a weapon equipped with the "melee" aspect?
|-
| MY_TURN || unit || Is it currently the turn of this unit's faction?
|-
| THIS_JOB_NOT_ACTIVE || site || If this effect is a job, this job is not already active on the site.
|-
| NO_JOBS_ACTIVE || site || No job effects are currently active on this site.
|-
| ANY_VISIBLE_ENEMIES || unit || Can this unit's faction see any enemy units?
|-
| HIDDEN_TILE || overland tile || The target tile is hidden to relativeTo. (i.e. unscouted)
|-
| VISIBLE_TILE || overland tile || The target tile is visible to relativeTo. (i.e. scouted)
|-
| TILE_CONDITION_NORMAL || overland tile || The target tile's condition is normal. (Currently, this just means it's not flooded, which happens in the Ulstryx campaign)
|-
| LURKING_AT_SITE || threat || This threat is lurking at (i.e. inhabiting) the relativeTo site.
|-
| UNIT_MAY_STOP_MOVING || unit || It's possible for this unit to stop moving where there are right now (i.e. they're standing on a walkable tile, not scenery or another unit)
|}


[[Category:Character]]
[[Category:Character]]
[[Category:Modding]]
[[Category:Modding]]
[[Category:Modding Reference]]
[[Category:Modding Reference]]

Revision as of 12:03, 5 February 2020

Aspects are named markers tied to entities, usually reflecting their narrative state, that add stats or apply specific effects.

For heroes, aspects are just facts about the hero. Stuff like "human", "female", "attractedToMen", "hunter", "missingLeftArm". Aspects can carry stat modifiers and Effects. Aspects are the workhorse of the dynamic content in the game, almost everything you need to know about a hero, site, anything really, can be accessed as an aspect (other than stat values). Aspects can be queried to find out almost anything about an entity (other than history, but that applies aspects that can be queried).

Aspects can be temporary, like status effects (poisoned) or combat modifiers (combatModifier_buff_courage), or more permanent, like theme pieces (themePiece_fire_leftArm) or class upgrade abilities (hunterDeck_quellingmoss).

(For a more general overview of how aspects relate to other parts of Wildermyth, see the Data Format Overview)

Aspect Parameters

Aspects can be parameterized, which looks like this: "boss_knockbackMelee|6|6+1d3".

Parameterized aspects work by literally doing a find/replace in the aspect json itself, so when creating a parameterized aspect, use a parameter name that's unique, and then define the parameter in the parameters section. You can then use that parameter value to pass the entity id to the effect, and the effect can read it using matchSpecial -> parameter1

The pipe character | delimits parameters for both effects and aspects, parameters need to be defined for aspects in order to be passed on, but they don't need to be explicitly defined for effects.

Aspect parameters can be used to store a relationship with a particular entity. In this case the entity's id will be used as the parameter content, and be passed down to effects as well. Effects can also target based on aspect relationships.

If you're making an effect and want to check if an entity has a parameterized aspect without knowing what the parameter is, you can use the star (*) character. i.e. matching "loverWith*" would match any unit with a "loverWith|ENTITY" aspect.

If debugging non-hero aspects (for example, if you want to see aspects on the company, enemies, or sites), you can turn on Options>Interface>DEV[inspectNonHeroes] to allow showing the character sheets for non heroes.

Hooks

Hooks are a special subcategory of aspects, which are usually designated when a hero is first generated, and are used to trigger hook quests.

Common Aspects

There are many aspects that are added automatically by the game that you will likely want to check when making Effects. Here's a list of some you may want to use. (You can also see all of these in the aspects section of the content editor)

General

aspect entity type explanation/usage
alive unit This unit is alive.
dead unit This unit is dead. (Potentially useful if you want to make reference to a dead hero in a comic)
female unit This unit is a woman.
male unit This unit is a man.
farmer unit This unit is a farmer, i.e. not a warrior, hunter, or mystic
warrior unit This unit is a warrior
hunter unit This unit is a hunter
mystic unit This unit is a mystic
theme_* unit Each theme has a corresponding aspect, like theme_crow, theme_wolf, and theme_tree. These can be used to make specific events centered around heroes with themes.

Relationships and Family

Note that a lot of these aspects are parameterized, which means you can use them to get an associated unit.

These aspects tie in closely with the relationship variables like HAS_LOVER, LOVER_WITH, CHILD_OF, FAMILY_WITH, etc. You will often find that matching those variables based on score or a test is the correct way to match heroes in a relationship.

You'll note that dead heroes are treated slightly differently. This is because once a hero dies, they no longer have any relationships with other heroes. Aspects like "deadLover" are to allow for events that refer to past lovers who are now dead.

aspect entity type explanation/usage
attractedToMen unit This unit is attracted to men.
attractedToWomen unit This unit is attracted to women.
childOf|HERO unit This unit is the child of HERO
parentOf|HERO unit This unit is the parent of HERO
familyWith|HERO unit This unit is family with HERO (parent, child, grandparent, grandchild, etc.)
deadChild|HERO unit This unit had a child that died.
deadParent|HERO unit This unit had a parent that died.
deadShip|HERO|TIER unit This unit had a relationship (friends, lovers, or rivals) with HERO, who died
deadShipOf|HERO|TIER unit This unit is the dead hero who had a relationship with HERO
deadFriend|HERO|TIER unit This unit was friends with HERO, who died
deadFriendOf|HERO|TIER unit This unit is the dead friend of HERO
deadLover|HERO|TIER unit This unit loved HERO, who died
deadLoverOf|HERO|TIER unit This unit is the dead lover of HERO
deadRival|HERO|TIER unit This unit was rivals with HERO, who died
deadRivalOf|HERO|TIER unit This unit is the dead rival of HERO

Company

aspect entity type explanation/usage
chapterNumber company What chapter are we on?
seenEvent|TEMPLATE company Under the hood, this is how we keep track of which events the company has seen during this campaign, where TEMPLATE is the event id.
gameIsOver company The game is over! Specifically useful to prevent certain tidings from firing in the credits.

Scenery

Scenery aspects can be examined using the Scenery Lab > Aspects panel.

Scenery has different aspects that are used to determine how they interact with the world.

aspect entity type explanation/usage
goodCover scenery This scenery will provide good cover to adjacent units. (If neither the goodCover nor the noCover aspects are on scenery, it will provide partial cover)
noCover scenery This scenery will provide no cover to adjacent units.
flammable scenery Fire can spread onto this scenery. (See the "fireSpreadsToScenery" effect)
immuneToFire scenery Fire doesn't damage this scenery. (Right now, this just gives the scenery warding)

Scenery also has different aspects that are primarily used for interfusion abilities. These aspects are as follows: bone, book, liquid, mechanism, metal, plant, rock, shards, statue, textile, tools, tree, wood And some more special ones, like: interactiveLampOn, lampCanFlare, lampIsFireSink, lampIsFireSource

Abilities

aspect entity type explanation/usage
numUses|ABILITY_ID effect numUses|ABILITY_ID aspect. This can be used to do things like make offhands disappear when they're used up.

Special Cases

Scenery has different aspects that are primarily used for interfusion abilities.

aspect entity type explanation/usage
npcId|NAME individual When you create an individual via implications, you can give that individual an npcId, which can be used to make that npc show up again in a later event. All units with npcIds are always available to get throughout a campaign, including during missions.
largePet|_ENTITY_ individual This individual has a large pet. See Outcomes#AddPet
isLargePet|_ENTITY_ individual This is a large pet. See Outcomes#AddPet

Implicit Aspects

Some aspects are implicit, meaning they aren't actual aspects on the entity, but are instead determined by checking some criteria when the aspect is checked for. These are also commonly used when making Effects.

aspect target explanation/usage
ENEMY unit Is this unit controlled by the opposite faction of relativeTo?
HOSTILE_TARGET unit Is this unit controlled by the opposite faction of relativeTo, AND relativeTo is able to target them? (i.e. the unit isn't hidden or in stasis, and relativeTo isn't being taunted by someone else)
ACTIVE unit Is this unit currently under a faction's control?
ALLY unit Is this unit controlled by the same faction as relativeTo?
MAIN_HAND item Is this weapon equipped in the MAIN_HAND slot of relativeTo?
INACTIVE_ITEM item Is this item an inactive item of relativeTo?
SELF any Is this target the same as relativeTo?
NOT_SELF any Is this target NOT the same as relativeTo?
RANGE_EQUIPPED unit Does this unit have a weapon equipped with the "ranged" aspect?
MELEE_EQUIPPED unit Does this unit have a weapon equipped with the "melee" aspect?
MY_TURN unit Is it currently the turn of this unit's faction?
THIS_JOB_NOT_ACTIVE site If this effect is a job, this job is not already active on the site.
NO_JOBS_ACTIVE site No job effects are currently active on this site.
ANY_VISIBLE_ENEMIES unit Can this unit's faction see any enemy units?
HIDDEN_TILE overland tile The target tile is hidden to relativeTo. (i.e. unscouted)
VISIBLE_TILE overland tile The target tile is visible to relativeTo. (i.e. scouted)
TILE_CONDITION_NORMAL overland tile The target tile's condition is normal. (Currently, this just means it's not flooded, which happens in the Ulstryx campaign)
LURKING_AT_SITE threat This threat is lurking at (i.e. inhabiting) the relativeTo site.
UNIT_MAY_STOP_MOVING unit It's possible for this unit to stop moving where there are right now (i.e. they're standing on a walkable tile, not scenery or another unit)