Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.2 / NPC / Roles / Intelligent / Aggressive / Trork / Components / Component_Trork_Instruction_Converge.json

Component_Trork_Instruction_Converge

Server/NPC/Roles/Intelligent/Aggressive/Trork/Components/Component_Trork_Instruction_Converge.json, 4.3 KB

Fields

FieldType
Classstring
DefaultStatestring
Parametersobject
Contentobject
Typestring

Source

{
  "Class": "Instruction",
  "DefaultState": ".Default",
  "Parameters": {
    "_ImportStates": [ "Chase", "Search" ],
    "ViewRange": {
      "Value": 15,
      "Description": "View range"
    },
    "HearingRange": {
      "Value": 8,
      "Description": "Hearing range"
    },
    "AlertedRange": {
      "Value": 30,
      "Description": "A range within which the player can be seen/sensed when the NPC is alerted to their presence"
    },
    "CanSee": {
      "Value": true,
      "Description": "Whether this NPC can see"
    }
  },
  "Content": {
    "Instructions": [
      {
        "Sensor": {
          "Type": "State",
          "State": ".Default"
        },
        "Instructions": [
          {
            "$Comment": "Animations",
            "Continue": true,
            "Sensor": {
              "Type": "Any",
              "Once": true
            },
            "Actions": [
              {
                "Type": "PlayAnimation",
                "Slot": "Status",
                "Animation": "Alerted"
              },
              {
                "Type": "SpawnParticles",
                "Offset": [ 0, 2.1, 0 ],
                "ParticleSystem": "Alerted"
              }
            ]
          },
          {
            "Continue": true,
            "Sensor": {
              "Type": "Target",
              "Range": { "Compute": "ViewRange" }
            },
            "HeadMotion": {
              "Type": "Watch"
            }
          },
          {
            "Sensor": {
              "Type": "Any"
            },
            "Actions": [
              {
                "Type": "Timeout",
                "Delay": [ 1, 1 ],
                "Action": {
                  "Type": "State",
                  "State": ".Charge"
                }
              }
            ]
          }
        ]
      },
      {
        "Sensor": {
          "Type": "State",
          "State": ".Charge"
        },
        "Instructions": [
          {
            "Reference": "Component_Instruction_Clear_Status_Animation",
            "Modify": { }
          },
          {
            "Sensor": {
              "Type": "Target",
              "Range": { "Compute": "ViewRange" },
              "Filters": [
                {
                  "Type": "LineOfSight"
                }
              ]
            },
            "Actions": [
              {
                "Type": "ParentState",
                "State": "Chase"
              }
            ]
          },
          {
            "Continue": true,
            "Sensor": {
              "Type": "Any"
            },
            "Instructions": [
              {
                "Sensor": {
                  "Type": "Eval",
                  "Expression": "blocked"
                },
                "BodyMotion": {
                  "Type": "Wander",
                  "MaxHeadingChange": 45,
                  "RelativeSpeed": 1
                }
              },
              {
                "Sensor": {
                  "Type": "Mob",
                  "Range": 1,
                  "ExcludeOwnType": false,
                  "LockOnTarget": false,
                  "Filters": [
                    {
                      "Type": "NPCGroup",
                      "IncludeGroups": [ "Self" ]
                    }
                  ]
                },
                "BodyMotion": {
                  "Type": "Wander",
                  "MaxHeadingChange": 45,
                  "RelativeSpeed": 1
                }
              },
              {
                "Sensor": {
                  "Type": "Target",
                  "Range": { "Compute": "AlertedRange" }
                },
                "BodyMotion": {
                  "Type": "Seek",
                  "SlowDownDistance": 3,
                  "StopDistance": 1.5,
                  "RelativeSpeed": 0.6
                }
              }
            ]
          },
          {
            "Sensor": {
              "Type": "Not",
              "Sensor": {
                "Type": "Target",
                "Range": { "Compute": "AlertedRange" }
              }
            },
            "Actions": [
              {
                "Type": "ParentState",
                "State": "Search"
              }
            ]
          }
        ]
      }
    ]
  },
  "Type": "Component"
}