Changes

Jump to navigation Jump to search
→‎Custom machines: update for latest alpha changes
Line 512: Line 512:  
| <samp>OverrideOutputs</samp>
 
| <samp>OverrideOutputs</samp>
 
| ''(Optional)'' The output items produced by this conversion rule. This uses the same format as <samp>Outputs</samp> on the machine itself. Defaults to the machine's <samp>Outputs</samp> field if omitted.
 
| ''(Optional)'' The output items produced by this conversion rule. This uses the same format as <samp>Outputs</samp> on the machine itself. Defaults to the machine's <samp>Outputs</samp> field if omitted.
 +
|-
 +
| <samp>UseFirstValidOutput</samp>
 +
| ''(Optional)'' If multiple <samp>Outputs</samp> or <samp>OverrideOutputs</samp> entries match, whether to use the first match instead of choosing one randomly. Default false.
 
|-
 
|-
 
| <samp>OverrideMinutesUntilReady</samp>
 
| <samp>OverrideMinutesUntilReady</samp>
 
| ''(Optional)'' The number of in-game minutes until the output is ready to collect. Defaults to the machine's <samp>MinutesUntilReady</samp> field if omitted.
 
| ''(Optional)'' The number of in-game minutes until the output is ready to collect. Defaults to the machine's <samp>MinutesUntilReady</samp> field if omitted.
 +
|-
 +
| <samp>InvalidCountMessage</samp>
 +
| ''(Optional)'' If set, overrides the machine's main <samp>InvalidCountMessage</samp> field.
 
|}
 
|}
 
|-
 
|-
Line 537: Line 543:  
|-
 
|-
 
| <samp>Outputs</samp>
 
| <samp>Outputs</samp>
| ''(Optional)'' The items produced by this machine, unless overridden by <samp>OverrideOutputs</samp> under <samp>ItemConversions</samp>. If multiple output entries match, one will be selected randomly. This consists of a list of models with these fields:
+
| ''(Optional)'' The items produced by this machine, unless overridden by <samp>OverrideOutputs</samp> under <samp>ItemConversions</samp>. If multiple output entries match, one will be selected randomly unless you specify <samp>UseFirstValidOutput</samp>. This consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 547: Line 553:  
|-
 
|-
 
| <samp>MinCount</samp><br /><samp>MaxCount</samp>
 
| <samp>MinCount</samp><br /><samp>MaxCount</samp>
| The minimum and maximum number of this item produced. A value in this range will chosen randomly each time it's produced. Both default to 1.
+
| ''(Optional)'' The minimum and maximum number of this item produced. A value in this range will chosen randomly each time it's produced. If the maximum is set to <samp>-1</samp>, it'll match the minimum automatically. Defaults to 1 (minimum) and -1 (maximum).
 +
|-
 +
| <samp>Quality</samp>
 +
| ''(Optional)'' The produced item's quality. The valid values are -1 (inherit from input item), 0 (normal), 1 (silver), 2 (gold), or 4 (iridium). Default normal-quality.
 +
|-
 +
| <samp>PreserveType</samp>
 +
| ''(Optional)'' The produced item's preserved item type, if applicable. This sets the equivalent flag on the output item. The valid values are <samp>Jelly</samp>, <samp>Juice</samp>, <samp>Pickle</samp>, <samp>Roe</samp> or <samp>AgedRoe</samp>, and <samp>Wine</samp>. Defaults to none.
 +
|-
 +
| <samp>PreserveID</samp>
 +
| ''(Optional)'' The produced item's preserved unqualified item ID, if applicable. For example, [[Wine|blueberry wine]] has its preserved item ID set to the [[blueberry]] ID. This can be set to <samp>DROP_IN</samp> to use the input item's ID. Default none.
 +
|-
 +
| <samp>AddPrice</samp><br /><samp>MultiplyPrice</samp>
 +
| ''(Optional)'' Numeric changes applied to the produced item's price, which is calculated as <samp>AddPrice + (MultiplyPrice × normal price)</samp>. These default to 0 (<samp>AddPrice</samp>) and 1 (<samp>MultiplyPrice</samp>).
 
|-
 
|-
 
| <samp>Condition</samp>
 
| <samp>Condition</samp>
 
| ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this output can be produced. Item-only tokens are valid for this check, and will check the ''input'' (not output) item. Defaults to always true.
 
| ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this output can be produced. Item-only tokens are valid for this check, and will check the ''input'' (not output) item. Defaults to always true.
 +
|-
 +
| <samp>CopyColor</samp>
 +
| ''(Optional)'' Whether to inherit the color of the input item if it was a <samp>ColoredObject</samp>. This mainly affects [[roe]]. Default false.
 +
|-
 +
| <samp>IncrementMachineParentSheetIndex</samp>
 +
| ''(Optional)'' Whether to increment the machine's spritesheet index by one while it's processing this output. This stacks with the <smap>ShowNextIndexWhenLoaded</samp> field (''i.e.'' setting both to true will increment the index by two). Default false.
 
|}
 
|}
 
|-
 
|-
Line 556: Line 580:  
| ''(Optional)'' The number of in-game minutes until the output is ready to collect, unless overridden by <samp>OverrideMinutesUntilReady</samp> under <samp>ItemConversions</samp>. If both are omitted, the item will be ready instantly.
 
| ''(Optional)'' The number of in-game minutes until the output is ready to collect, unless overridden by <samp>OverrideMinutesUntilReady</samp> under <samp>ItemConversions</samp>. If both are omitted, the item will be ready instantly.
 
|-
 
|-
| <samp>QuantityModifiers</samp>
+
| <samp>UseFirstValidOutput</samp>
| ''(Optional)'' Changes to apply to the produced output's stack size. If multiple entries match, they'll be applied sequentially (e.g. two matching rules to double output will quadruple it). Note that this doesn't prevent you from setting invalid stack sizes (like negative values), which may cause in-game bugs.
+
| ''(Optional)'' If multiple <samp>Output</samp> entries match, whether to use the first match instead of choosing one randomly. Default false.
 +
 
 +
This has no effect if <samp>ItemConversions</samp> is set; use the separate <samp>UseFirstValidOutput</samp> field on each item conversion entry instead in that case.
 +
|-
 +
| <samp>ReadyTimeModifiers</samp><br /><samp>QualityModifiers</samp><br /><samp>QuantityModifiers</samp>
 +
| ''(Optional)'' Changes to apply to the produced item's processing time, quality, or stack size. If multiple entries match, they'll be applied sequentially (e.g. two matching rules to double output will quadruple it). Note that this doesn't prevent you from setting invalid values (like a negative stack size or a quality beyond iridium), which may cause in-game bugs.
 +
 
 +
For <samp>QualityModifiers</samp>, the operations are performed on the numeric quality values: 0 (normal), 1 (silver), 2 (gold), or 4 (iridium).
    
This consists of a list of models with these fields:
 
This consists of a list of models with these fields:
Line 569: Line 600:  
|-
 
|-
 
| <samp>Amount</samp>
 
| <samp>Amount</samp>
| The operand applied to the item's current stack size (e.g. the multiplier if used with <samp>Multiply</samp>).
+
| The operand applied to the target value (e.g. the multiplier if used with <samp>Multiply</samp>).
 
|-
 
|-
 
| <samp>Condition</samp>
 
| <samp>Condition</samp>
Line 575: Line 606:  
|}
 
|}
 
|-
 
|-
| <samp>QualityModifiers</samp>
+
| <samp>ReloadOnCollect</samp>
| ''(Optional)'' Changes to apply to the produced output's quality. This works exactly like <samp>QuantityModifiers</samp>, but operates on numeric qualities: 0 (normal), 1 (silver), 2 (gold), or 4 (iridium). Note that this doesn't prevent you from setting invalid qualities (like values beyond iridium), which may cause in-game bugs.
+
| ''(Optional)'' Whether to restart the machine with the same input when the player collects the output (''e.g.'' for the [[crystalarium]]). Default false.
 
|}
 
|}
 
</dd>
 
</dd>
Line 608: Line 639:  
|-
 
|-
 
| <samp>ShowNextIndexWhenLoaded</samp>
 
| <samp>ShowNextIndexWhenLoaded</samp>
| ''(Optional)'' Whether to increment the machine's spritesheet index by one while it's processing an item. Default false.
+
| ''(Optional)'' Whether to increment the machine's spritesheet index by one while it's processing an item. Default false.
 
|-
 
|-
 
| <samp>LoadTemporarySprites</samp>
 
| <samp>LoadTemporarySprites</samp>
Line 674: Line 705:  
* This will prevent {{nexus mod|1063|Automate}} from automating the machine, since it has no way to know which items will be accepted by the method. For Automate support, you'd need to [https://github.com/Pathoschild/StardewMods/blob/develop/Automate/docs/technical.md#extensibility-for-modders use Automate's API] to register a custom machine factory to handle it in code.
 
* This will prevent {{nexus mod|1063|Automate}} from automating the machine, since it has no way to know which items will be accepted by the method. For Automate support, you'd need to [https://github.com/Pathoschild/StardewMods/blob/develop/Automate/docs/technical.md#extensibility-for-modders use Automate's API] to register a custom machine factory to handle it in code.
 
* This should ''only'' perform conversion logic. Don't handle interaction logic like animations, sounds, or UI messages in this method, since that'll interfere with [[hopper]]s and other machine mods. See the other fields instead for that.
 
* This should ''only'' perform conversion logic. Don't handle interaction logic like animations, sounds, or UI messages in this method, since that'll interfere with [[hopper]]s and other machine mods. See the other fields instead for that.
 +
|-
 +
| <samp>ResetBuildingIncubatorFlag</samp>
 +
| ''(Optional)'' When the machine is placed in a [[barn]] or [[coop]], whether to reset the 'has shown incubator building full message' flag on the building when an item is placed in the machine. Default false.
 +
 +
This is used by the [[incubator]] and [[Ostrich Incubator|ostrich incubator]]. The game logic assumes there's only one such machine in each building, so this generally shouldn't be used by custom machines.
 +
|-
 +
| <samp>StatToIncrementWhenLoaded</samp>
 +
| ''(Optional)'' The name of the field on <samp>Game1.stats</samp> to increment when an item is added to this machine. Default none.
 +
 +
It's fine to use this with custom machines, but you can only increment built-in stats so it won't be applicable for most custom machines. The vanilla game increments <samp>PiecesOfTrashRecycled</samp> for the [[Recycling Machine|recycling machine]] and <samp>GeodesCracked</samp> for the [[Geode Crusher|geode crusher]].
 
|}
 
|}
 
</dd>
 
</dd>
translators
8,447

edits

Navigation menu