description |
---|
How suffixes and substitutions work |
Published: ??? by manavortex
Last documented update: Feb 18 2024 by manavortex
This page will teach you about conditional appearance switching in Cyberpunk and give you an overview of existing suffixes and substitutions.
{% hint style="info" %} ArchiveXL did not invent suffixes. In fact, they are CDPR's solution to a problem, and they are annoying to use.
psiberx has found ways to make this less painful. This page documents these ways. {% endhint %}
- For a hands-on guide to adding-new-items, check the corresponding pages in the Modding Guides section
- Dynamic appearances have their own guide (see archivexl-dynamic-variants)
- There is an own page for influencing-other-items.md
- To conditionally hide items or parts of items, check influencing-other-items.md or archivexl-tags.md (especially the section about #root-entity-tags)
Sometimes, you want to load different meshes/appearances under different circumstances. Before ArchiveXL 1.5, the only way to do that were suffixes — registering them in the .yaml
, then adding one appearance for each variation in the root entity (so for 2 suffixes, you'd have 4 entries, for 3 suffixes, you'd have 8…).
{% hint style="warning" %} Suffixes are outdated! Do yourself a favour and use dynamic appearances! {% endhint %}
Since 1.5, psiberx has made it possible to use conditionals via dynamic appearances, which require a lot less of an overhead. (Personally, I've gone from 96 entries in the root entity down to 9!)
But while the solution has changed (and improved), the problems remain and require handling.
There are two body genders with different proportions, and you can't make them wear the same shirt (at least not without clipping). To solve that, you can do what CDPR did and have one variant per rig.
The suffix for the body is Male
/ Female
, the ArchiveXL string substitution is {gender}
and resolves to m
or w
.
ArchiveXL allows body modders to register a custom body tag, which can then be used for suffixes and for substitutions in dynamic variants. To learn more about this, check archivexl-body-mods-and-refits.
{% hint style="info" %} You can check the current foot state by running the following command from CET:
print(Game.GetScriptableSystemsContainer():Get("PuppetStateSystem"):GetBodyTypeSuffix(ItemID.new(), GetPlayer(), nil))
{% endhint %}
Sometimes, you need to hide parts of the item in first person. – for example helmets, since you don't want to have half a helmet floating in front of your face (unless you consider that immersive; most people don't).
Camera mode | Suffix | Substitution | Condition |
---|---|---|---|
First Person Perspective | &FPP | fpp | &camera=fpp |
Third Person Perspective | &TPP | tpp | &camera=tpp |
The arm states represent the different cyberware. For example, since you can't hire the forearms for mantis blades, you can roll up the sleeves just for this. The definitions are:
Cyberware | Suffix | Substitution | Conditional |
---|---|---|---|
None | &BaseArms |
base_arms |
&arms=base_arms |
Mantis Blades | &MantisBlades |
mantis_blades |
&arms=mantis_blades |
Monowire | &Monowire |
monowire |
&arms=monowire |
Projectile Launcher | &ProjectileLauncher |
projectile_launcher |
&arms=projectile_launcher |
If the arm states aren't working as expected, check if the table above is outdated by comparing the names with the source code.
{% hint style="info" %} You can check the current foot state by running the following command from CET:
print(Game.GetScriptableSystemsContainer():Get("PuppetStateSystem"):GetArmsStateSuffix(ItemID.new(), GetPlayer(), nil))
{% endhint %}
To achieve gender equality in regard to foot states, you need to use Toggleable Feet. The substitution key for dynamic appearances is feet
.
{% hint style="warning" %} Feet states for male-rigged V are not supported by the base game. You need to install either a body mod, or Toggleable Feet. {% endhint %}
Character | Footwear | Suffix/Tag | Substitution | Condition |
---|---|---|---|---|
Female | Unequipped | &Flat | flat | &feet=flat |
Female | Equipped (default) | &Lifted | lifted | &feet=lifted |
Female | Equipped with HighHeels tag | &HighHeels | high_heels | &feet=high_heels |
Female | Equipped with FlatShoes tag | &FlatShoes | flat_shoes | &feet=flat_shoes |
Male | Any | (empty) |
If the foot states aren't working as expected, check if the table above is outdated by comparing the names with the source code.
{% hint style="info" %} You can check the current foot state by running the following command from CET:
print(Game.GetScriptableSystemsContainer():Get("PuppetStateSystem"):GetFeetStateSuffix(ItemID.new(), GetPlayer(), nil))
{% endhint %}
Conditions are a feature of dynamic appearances . They can be used in two places:
Inside your .app
file for appearanceAppearanceDefinition.name
:
This lets you to select a different appearance based on body gender, camera state... (see the tables above).
By using conditional appearances, you can still make use of partsOverrides
to use chunkmask hiding.
{% hint style="info" %} For a hands-on example, see archivexl-dynamic-conversion-guide.md -> #step-2-the-.app {% endhint %}
Inside your mesh_entity.ent
for component.name
:
{% hint style="info" %} For a hands-on example, see archivexl-dynamic-conversion-guide.md -> #method-1-conditional-components {% endhint %}
Substitutions are a feature of dynamic appearances . They can only be used inside your mesh_entity.ent
.
Substitutions allow ArchiveXL to load a different mesh based on different circumstances.
{% hint style="info" %} For a hands-on example, see archivexl-dynamic-conversion-guide.md -> #method-2-component-substitution {% endhint %}
{% hint style="warning" %} Do yourself a favour and don't use suffixes! They are outdated - use dynamic item additions instead. {% endhint %}
For a list of active suffixes, check the tables above.
Suffix | Explanation |
---|---|
itemsFactoryAppearanceSuffix.Gender | This item is gendered When resolving the appearance name via rootentity.ent , the game will look for appearanceName&Female and appearanceName&Male . |
itemsFactoryAppearanceSuffix.Camera | This item has special rules for first and third person camera When resolving the appearance name via rootentity.ent , the game will look for appearanceName&FPP and appearanceName&TPP . |
itemsFactoryAppearanceSuffix.Partial | If the current item has hide_T1part part and slot OuterChest is not hidden, will search rootentity.ent for&Full or &Part |
itemsFactoryAppearanceSuffix.HairType | Defines how your item will look if a certain hair type is loaded (e.g., hide the back half of a bandana for long hair). When resolving the appearance name via rootentity.ent , the game will look for &Short , &Long , &Dreads , &Buzz , &Bald |
You can disable suffixes by adding the following line to your .yaml entry:
appearanceSuffixes: []
- the base appearance (with no suffix)
- the most specific suffix collection it can find
V has a female body gender and you're in photo mode (third person camera). Your base appearance is called appearance_
.
full appearance name | |
---|---|
appearance_ |
Found first, then ignored because a more specific appearance exists. |
|
Ignored: V's body gender isn't male |
appearance_&Female |
ignored: a better match exists |
appearance_&Female&FPP |
ignored: you are not in first person camera |
appearance_&Female&TPP |
best match! The game will use this one! |
Since 1.8.0, ArchiveXL supports substitutions for #dynamic-appearances. You can use them in two places:
- inside
mesh entity
components in the fieldsname
,depotPath
andappearance
- in the
.app
appearances for the fieldname
{% hint style="success" %} For a tutorial about this, check archivexl-dynamic-variants
If you are a mod user and want to dynamically recolour an item, check the recolours-and-refits guide -> sub-page Emissive -> #switching-existing-colours {% endhint %}
Any placeholders will be interpolated at run-time (replaced with the correct value for your current state)!
If any of the placeholders aren't working the way you expect them, check if the table below is outdated by referring directly to the source. (Please update the wiki if that happens!)
{% hint style="info" %}
Substitution will only become active if the property name starts with an asterisk (*
).
{% endhint %}
Placeholder | Substitution |
---|---|
{camera} |
fpp or tpp |
{gender} |
m or w |
{body} |
base_body or body mod name in snake case |
{arms} |
base_arms , mantis_blades , monowire , projectile_launcher |
{feet} |
flat , lifted , high_heels , flat_shoes (empty for mascV!) |
{sleeves} |
full , part |
{skin_color} |
skin color name from customization, e.g. 03_senna |
{hair_color} |
hair color name from customization. e.g. black_liquorice |
For #dynamic-appearances, you can conditionally switch out components or entire appearances by name. You can switch use any of the entries from #which-substitutions-exist
The order works as follows:
Appearance/Component | Priority | Description |
---|---|---|
my_item!variant&camera=tpp | 1 | Has the highest priority because it requires a specific variant and one state condition. |
my_item!variant | 2 | Has second priority because it requires a specific variant. |
my_item&gender=w&camera=tpp | 3 | Has third priority because it has two state conditions. |
my_item&camera=tpp | 4 | Has fourth priority because it has one state condition. |
my_item | 5 | Has the lowest priority and will be used when no other elements match the criteria. |