Hytale Asset ReferenceUnofficial
Versions / 0.4.0 / NPC / Roles / Intelligent / Aggressive / Trork / Components / Component_Trork_Instruction_Panic.json

Component_Trork_Instruction_Panic

Server/NPC/Roles/Intelligent/Aggressive/Trork/Components/Component_Trork_Instruction_Panic.json, 4.5 KB

Fields

FieldType
Classstring
Parametersobject
Contentobject
Typestring

Source

{
  "Class": "Instruction",
  "Parameters": {
    "_ImportStates": [ "Idle", "Alerted", "Search" ],
    "ViewRange": {
      "Value": 15,
      "Description": "View range"
    },
    "ViewSector": {
      "Value": 180,
      "Description": "View sector"
    },
    "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"
    }
  },
  "Content": {
    "Instructions": [
      {
        "$Comment": "Animations",
        "Continue": true,
        "Sensor": {
          "Type": "Any",
          "Once": true
        },
        "Actions": [
          {
            "Type": "PlayAnimation",
            "Slot": "Status"
          },
          {
            "Type": "SpawnParticles",
            "Offset": [ 0, 2.1, 0 ],
            "ParticleSystem": "Alerted"
          }
        ]
      },
      {
        "Continue": true,
        "Sensor": {
          "Type": "Any"
        },
        "Instructions": [
          {
            "Sensor": {
              "Type": "Eval",
              "Expression": "blocked"
            },
            "BodyMotion": {
              "Type": "Timer",
              "Time": [ 2, 3 ],
              "Motion": {
                "Type": "Wander",
                "MaxHeadingChange": 45,
                "RelativeSpeed": 1
              }
            }
          },
          {
            "Sensor": {
              "Type": "Mob",
              "Range": 1,
              "ExcludeOwnType": false,
              "LockOnTarget": false,
              "Filters": [
                {
                  "Type": "NPCGroup",
                  "IncludeGroups": [ "Self" ]
                },
                {
                  "Type": "ViewSector",
                  "ViewSector": { "Compute": "ViewSector" }
                }
              ]
            },
            "BodyMotion": {
              "Type": "Wander",
              "MaxHeadingChange": 45,
              "RelativeSpeed": 1
            }
          },
          {
            "Sensor": {
              "Type": "Any"
            },
            "BodyMotion": {
              "Type": "Timer",
              "Time": [ 2, 3 ],
              "Motion": {
                "Type": "Wander",
                "MaxHeadingChange": 45,
                "RelativeSpeed": 1
              }
            }
          }
        ]
      },
      {
        "Reference": "Component_Instruction_Damage_Check",
        "Modify": {
          "_ExportStates": [ "Alerted", "Search" ],
          "AlertedRange": { "Compute": "AlertedRange" }
        }
      },
      {
        "Sensor": {
          "Type": "Player",
          "Range": { "Compute": "AlertedRange" },
          "Filters": [
            {
              "Type": "LineOfSight"
            }
          ]
        },
        "Actions": [
          {
            "Type": "ParentState",
            "State": "Alerted"
          }
        ]
      },
      {
        "Sensor": {
          "Type": "Or",
          "Sensors": [
            {
              "Type": "Mob",
              "Range": 2,
              "LockOnTarget": true,
              "Filters": [
                {
                  "Type": "LineOfSight"
                }
              ],
              "Prioritiser": {
                "Type": "Attitude",
                "AttitudesByPriority": [ "Hostile" ]
              },
              "GetPlayers": true,
              "GetNPCs": false
            },
            {
              "Reference": "Component_Sensor_Sight_By_Attitude",
              "Modify": {
                "ViewRange": { "Compute": "ViewRange" },
                "ViewSector": { "Compute": "ViewSector" },
                "Attitudes": [ "Hostile" ]
              }
            },
            {
              "Reference": "Component_Sensor_Sound_By_Attitude",
              "Modify": {
                "HearingRange": { "Compute": "HearingRange" },
                "Attitudes": [ "Hostile" ]
              }
            }
          ]
        },
        "Actions": [
          {
            "Type": "ParentState",
            "State": "Alerted"
          }
        ]
      },
      {
        "Sensor": {
          "Type": "Any"
        },
        "Actions": [
          {
            "Type": "Timeout",
            "Delay": [ 2, 3 ],
            "Action": {
              "Type": "ParentState",
              "State": "Idle"
            }
          }
        ]
      }
    ]
  },
  "Type": "Component"
}