Modding:Variants: Difference between revisions

From Vintage Story Wiki
m
no edit summary
(Updates... still in progress.)
mNo edit summary
Line 24: Line 24:
</syntaxhighlight>Seashells have two variant groups: t''ype'' and ''color''. For each state in ''type'', there exists every state in ''color'', giving a total of 42 different sea shells. Every sea shell in game has a code of "''seashell-{type}-{color}''".
</syntaxhighlight>Seashells have two variant groups: t''ype'' and ''color''. For each state in ''type'', there exists every state in ''color'', giving a total of 42 different sea shells. Every sea shell in game has a code of "''seashell-{type}-{color}''".


==== SkipVariants ====
On occasion, a combination of variant groups can cause the creation of unwanted objects. Say, for example, that turquoise clams were unrealistic and shouldn't be in the game. To remove variants, you can use the '<nowiki/>''SkipVariants''' property. The seashell variants would now look like this:<syntaxhighlight lang="json">
On occasion, a combination of variant groups can cause the creation of unwanted objects. Say, for example, that turquoise clams were unrealistic and shouldn't be in the game. To remove variants, you can use the '<nowiki/>''SkipVariants''' property. The seashell variants would now look like this:<syntaxhighlight lang="json">
variantgroups: [
variantgroups: [
Line 34: Line 35:
</syntaxhighlight>Any code within skipVariants will not be created in game.
</syntaxhighlight>Any code within skipVariants will not be created in game.


==== AllowVariants ====
Sometimes, you may want to specifically choose which variants should be created in game. For example, you may only want a specific selection of seashells to be created in the game for testing purposes. To only allow specific variants, you can use the '<nowiki/>''AllowedVariants''' property. The seashell variants would now look like this:<syntaxhighlight lang="json">
Sometimes, you may want to specifically choose which variants should be created in game. For example, you may only want a specific selection of seashells to be created in the game for testing purposes. To only allow specific variants, you can use the '<nowiki/>''AllowedVariants''' property. The seashell variants would now look like this:<syntaxhighlight lang="json">
variantgroups: [
variantgroups: [
Line 49: Line 51:
It is important to remember that skipVariants takes presedence over allowedVariants - If an element exists in both the allowed and skip list, it will be skipped.
It is important to remember that skipVariants takes presedence over allowedVariants - If an element exists in both the allowed and skip list, it will be skipped.


''SkipVariants'' and ''AllowedVariants'' both accept wildcard parameters, which will be spoke about soon.
''SkipVariants'' and ''AllowedVariants'' both accept wildcard parameters.


=== ByType Properties ===
=== Wildcards ===
Wildcards are very important when using variants, and they can be used to reference collections of objects easily.
 
Technically, wildcards use a "''matching''" system, rather than creating a collection of objects.
 
Some examples of wildcards are:
 
* '''hammer-*''' - This will


=== {Variant Groups} ===
=== {Variant Groups} ===


=== Wildcards ===
=== ByType Properties ===


== Detailed Understanding ==
== Detailed Understanding ==
Confirmedusers
566

edits