Changes

Jump to navigation Jump to search
→‎Game state queries: update for recent changes
Line 1,122: Line 1,122:     
====Conditions====
 
====Conditions====
; World
+
; Date
 
:{| class="wikitable"
 
:{| class="wikitable"
 
|-
 
|-
Line 1,133: Line 1,133:  
| <samp>DAY_OF_WEEK {{t|day}}</samp>
 
| <samp>DAY_OF_WEEK {{t|day}}</samp>
 
| Check the day of week, formatted as an integer between 0 (Sunday) through 6 (Saturday).
 
| Check the day of week, formatted as an integer between 0 (Sunday) through 6 (Saturday).
 +
|-
 +
| <samp>IS_FESTIVAL_DAY {{o|day offset}}</samp>
 +
| Get whether there's a festival today, with an optional {{o|day offset}} (e.g. 1 for tomorrow).
 +
 +
'''Note:''' negative offsets aren't supported yet.
 +
|-
 +
| <samp>SEASON {{t|season}}</samp>
 +
| Check the season (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>).
 +
|-
 +
| <samp>YEAR</samp>
 +
| Check if the year is equal '''or more than''' the given value. For example, <code>YEAR 2</code> is true in year 2 and all later years.
 +
|}
 +
 +
; World
 +
:{| class="wikitable"
 +
|-
 +
! Condition
 +
! effect
 
|-
 
|-
 
| <samp>FARM_CAVE {{t|type}}</samp>
 
| <samp>FARM_CAVE {{t|type}}</samp>
Line 1,150: Line 1,168:  
| <samp>IS_CUSTOM_FARM_TYPE</samp>
 
| <samp>IS_CUSTOM_FARM_TYPE</samp>
 
| Check whether the [[Farm Maps|farm type]] is a custom one created by a mod. (This returns false for mods which edit/replace a vanilla farm type.)
 
| Check whether the [[Farm Maps|farm type]] is a custom one created by a mod. (This returns false for mods which edit/replace a vanilla farm type.)
|-
  −
| <samp>SEASON {{t|season}}</samp>
  −
| Check the season (one of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, or <samp>winter</samp>).
   
|-
 
|-
 
| <samp>LOCATION_ACCESSIBLE {{t|name}}</samp>
 
| <samp>LOCATION_ACCESSIBLE {{t|name}}</samp>
Line 1,158: Line 1,173:  
|-
 
|-
 
| <samp>WEATHER {{t|location}} {{t|weather}}</samp>
 
| <samp>WEATHER {{t|location}} {{t|weather}}</samp>
| Check whether the weather in the given location (one of <samp>Here</samp> or an internal location name) is <samp>Rainy</samp> or <samp>Sunny</samp>.
+
| Check the weather ID in the given location. The weather can be one of <samp>Festival</samp>, <samp>Rain</samp>, <samp>Snow</samp>, <samp>Storm</samp>, <samp>Sun</samp>, <samp>Wind</samp>, or a [[#Custom weather|custom weather ID]]. The location can be <samp>Here</samp> or an internal location name.
 
|-
 
|-
 
| <samp>WORLD_STATE {{t|id}}</samp>
 
| <samp>WORLD_STATE {{t|id}}</samp>
 
| Check whether any world state flag with the given {{t|id}} is set.
 
| Check whether any world state flag with the given {{t|id}} is set.
|-
  −
| <samp>YEAR</samp>
  −
| Check if the year is equal '''or more than''' the given value. For example, <code>YEAR 2</code> is true in year 2 and all later years.
   
|}
 
|}
   Line 1,292: Line 1,304:  
This always choose the same value for the current tick (if <samp>PICKED_VALUE_TICK</samp>) or in-game day (if <samp>PICKED_VALUE_DAYS</samp>). To have a different synchronized value, specify {{o|seed offset}} with an offset number (e.g. three options in a list would use offset 0, 1, and 2).
 
This always choose the same value for the current tick (if <samp>PICKED_VALUE_TICK</samp>) or in-game day (if <samp>PICKED_VALUE_DAYS</samp>). To have a different synchronized value, specify {{o|seed offset}} with an offset number (e.g. three options in a list would use offset 0, 1, and 2).
 
|-
 
|-
| <samp>PICKED_VALUE {{t|min}} {{t|max}} {{t|value}}</samp>
+
| <samp>PICKED_VALUE {{t|min}} {{t|max}} {{t|value}}</samp><br /><samp>PICKED_VALUE_CHANCE {{t|chance}}</samp><br /><samp>PICKED_VALUE_SUMMER_RAIN_CHANCE {{t|chance}}</samp>
| '''Not recommended for content packs, except in shop dialogues.'''<br />Equivalent to <samp>PICKED_VALUE_TICK</samp>, but checks the value selected by calling the <code>GameStateQuery.PickRandomValue(random)</code> method in code. The game only calls this method when opening a shop menu for [[#Custom shops|shop data with dialogue]].
+
| '''Not recommended for mods, except in shop dialogue and weather conditions.'''<br />These are specialized to to replicate older vanilla behavior, and depend on <code>GameStateQuery.PickRandomValue(random)</code> being called first. The game only calls that method when opening a shop menu for [[#Custom shops|shop data with dialogue]] or when checking [[#Custom weather|weather conditions]].
 
|}
 
|}
  
translators
8,447

edits

Navigation menu