New Game State Queries

This page goes through the newly added GSQs and Triggers/Actions as part of this mod for content patcher mods to take advantage of.

Here are two examples! (1.2.8)

         {
/// This trigger action makes a SmallGrassYellowButterfly spawn when
/// a natural common butterfly spawns in the forest.
            "Action": "EditData",
            "Target": "Data/TriggerActions",
            "Entries": {
               "NaNITVTEST_Trigger_0": {
                  "Id": "NiTV_Test_TriggerAction_0",
                  "Trigger": "NAT_NIV_Spawned",
                  "Condition": "LOCATION_Name Target Forest, NAT_NIV_TriggerNameCheck Target CommonButterfly, NAT_NIV_TriggerNaturalCheck Target",
                  "Action": "NAT_NIV_InstantiateSpecificNearTriggered SmallGrassYellowButterfly 2",
                  "MarkActionApplied": false
               }
            }
         },
         {
/// This trigger action makes a SmallGrassYellowButterfly replace a
/// a MonarchButterfly 50% of the time.
            "Action": "EditData",
            "Target": "Data/TriggerActions",
            "Entries": {
               "NaNITVTEST_Trigger_1": {
                  "Id": "NiTV_Test_TriggerAction_1",
                  "Trigger": "NAT_NIV_Spawned",
                  "Condition": "NAT_NIV_TriggerNameCheck Target MonarchButterfly, Random 0.5",
                  "Actions": [
                     "NAT_NIV_InstantiateSpecificNearTriggered SmallGrassYellowButterfly 0",
                     "NAT_NIV_RemoveSpecific MonarchButterfly 1"
                  ],
                  "MarkActionApplied": false
               }
            }
         }

This mod adds in 4 additional GSQs (See Game State Query Documentation Here)

  • NAT_NIV_DonatedTotalPercent <float> - returns true if atleast <float> percent of creatures have been donated.

  • NAT_NIV_DonatedSpecific <string> - returns true if a creature with name <string> has been donated.

  • NAT_NIV_CaughtSpecific <string> -returns true if a creature with name <string> has been caught.

  • NAT_NIV_SpawnedSpecific <string> - returns true if a creature with name <string> is currently spawned somewhere.

  • (1.2.7) NAT_NIV_Exists <string> - returns true if a creature with name <string> exists in creature data / is loaded

  • (1.2.8) NAT_NIV_TriggerNameCheck <string> - must be given the Target item as given from the NAT_NIV_Spawned or NAT_NIV_Caught trigger, and a creature name. Compares the spawned/caught creature's name with the given name.

  • (1.2.8) NAT_NIV_TriggerTileCheck <float> <float> - must be given the Target item as given from the NAT_NIV_Spawned trigger, and two arguments (Tile X, Tile Y). Compares the spawned creature's tile with the given tile.

  • (1.2.8) NAT_NIV_TriggerNaturalCheck - must be given the Target item as given from the NAT_NIV_Spawned trigger. Returns true if the creature was spawned naturally (Not through trigger action).

  • (1.2.8) NAT_NIV_TriggerArbitraryCheck <int> <whatever> - must be given the Target item as given from the NAT_NIV_Spawned trigger. Returns true if the data in creature model position <int> is the same as <whatever> with commas replaced by ' marks.

This mod adds in two trigger action actions (See Trigger Action Documentation Here)

  • NAT_NIV_ClearCreatures - clears the list of spawned creatures.

  • NAT_NIV_InstantiateSpecificCreature <string> <x tile> <y tile> - spawns creature with name <string> at tile <x tile> <y tile>.

  • (1.2.7) NAT_NIV_TryCatch <x position> <y position> - tries to catch a creature at a given position (NOT TILE, POSITION)

  • (1.2.8) NAT_NIV_RemoveSpecific <string> <count>- clears spawned creature(s) with name <string>. <count> is an optional argument to clear only a specific number of creatures with name <string>. Clears from newest to oldest.

  • (1.2.8) NAT_NIV_InstantiateSpecificNearTriggered <string> <int> - must be called from the NAT_NIV_Spawned trigger, spawns an additional creature with name <string> at a random tile in range <int> from that creature. set <int> to 0 to spawn it on top.

This mod adds in one trigger action trigger (See Trigger Action Documentation Here)

  • NAT_NIV_Spawned - is called when a creature is spawned, and contains as an argument the name of the creature spawned. (1.2.8 - adds two additional arguments for the tile it spawned on, Includes a target item with moddata "NAT_NIV_NAME" for the creature's name, and moddata "NAT_NIV_TILEX"/"NAT_NIV_TILEY" for the tile it spawned on.)

  • (1.2.7) NAT_NIV_Caught - is called when a creature is caught, and contains the name of the creature caught as an argument. (1.2.8 - Includes a target item with moddata "NAT_NIV_NAME" for the creature's name)

Last updated