Difference between revisions of "Aspect"

From Wildermyth Wiki
(→‎Aspect Parameters: $param can be used to display dynamic.properties text)
(→‎Aspect Parameters: Added $abilityNameParam0 and $aspectNameParam0)
 
Line 20: Line 20:
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.
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.


In aspect and effect names, blurbs, and formulas, you can use '''$param0''', '''$param1''', etc. to show a certain parameter to the player. For example, in very specific scenarios with parameterized damage amounts, you may want to display something like "Deals $param0 damage". If the parameter referenced matches a text key in the dynamic.properties file, it will instead show the related text. For example, the aspect potencyBonus|111|REASON has the name "$param1 Potency Bonus". When the aspect is added to the Bone Bow in the form potencyBonus|2|item.bowBone, the aspect name shows up as "Bone Bow Potency Bonus"
In aspect and effect names, blurbs, and formulas, you can use '''$param0''', '''$param1''', etc. to show a certain parameter to the player. For example, in very specific scenarios with parameterized damage amounts, you may want to display something like "Deals $param0 damage". If the parameter referenced matches a text key in the dynamic.properties file, it will instead show the related text. For example, the aspect potencyBonus|111|REASON has the name "$param1 Potency Bonus". When the aspect is added to the Bone Bow in the form potencyBonus|2|item.bowBone, the aspect name shows up as "Bone Bow Potency Bonus". You can also use '''$abilityNameParam0''' to show the name of the ability with the given id, and '''$aspectNameParam0''' to show the name of the aspect with the given id. (Doesn't currently work if the given id has parameters)


==Hooks==
==Hooks==

Latest revision as of 20:20, 8 February 2022

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.

In aspect and effect names, blurbs, and formulas, you can use $param0, $param1, etc. to show a certain parameter to the player. For example, in very specific scenarios with parameterized damage amounts, you may want to display something like "Deals $param0 damage". If the parameter referenced matches a text key in the dynamic.properties file, it will instead show the related text. For example, the aspect potencyBonus|111|REASON has the name "$param1 Potency Bonus". When the aspect is added to the Bone Bow in the form potencyBonus|2|item.bowBone, the aspect name shows up as "Bone Bow Potency Bonus". You can also use $abilityNameParam0 to show the name of the ability with the given id, and $aspectNameParam0 to show the name of the aspect with the given id. (Doesn't currently work if the given id has parameters)

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

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
recruitCostAdjustment|REASON|AMOUNT individual Adjust the cost to recruit this individual by a certain amount. Specifically useful if you want to increase the cost of a legacy hero, which you could do with an AddHistory Outcome that persists over the legacy, with an associated aspect like recruitCostAdjustment|myReason|1

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)
SPELL_DAMAGE unit Amount of interfusion spell damage from relevant weapons (wands and staves, most notably)