Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.1.1 / NPC / Roles / Intelligent / Neutral / Kweebec / Component_Kweebec_Instruction_Panic.json

Component_Kweebec_Instruction_Panic

Server/NPC/Roles/Intelligent/Neutral/Kweebec/Component_Kweebec_Instruction_Panic.json, 2.7 KB

Fields

FieldType
Classstring
Parametersobject
Contentobject
Typestring

Source

{
  "Class": "Instruction",
  "Parameters": {
    "_ImportStates": [ "Alerted", "Flee", "Panic", "Idle" ],
    "ViewRange": {
      "Value": 15,
      "Description": "View range"
    },
    "ViewSector": {
      "Value": 180,
      "Description": "View sector"
    },
    "HearingRange": {
      "Value": 10,
      "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"
          }
        ]
      },
      {
        "Reference": "Component_Instruction_Damage_Check",
        "Modify": {
          "_ExportStates": [ "Flee", "Panic" ],
          "AlertedRange": { "Compute": "AlertedRange" }
        }
      },
      {
        "Sensor": {
          "Type": "Or",
          "Sensors": [
            {
              "Reference": "Component_Sensor_Sight_By_Attitude",
              "Modify": {
                "ViewRange": { "Compute": "AlertedRange" },
                "ViewSector": { "Compute": "ViewSector" },
                "Attitudes": [ "Hostile", "Neutral" ]
              }
            },
            {
              "Reference": "Component_Sensor_Sound_By_Attitude",
              "Modify": {
                "HearingRange": { "Compute": "HearingRange" },
                "Attitudes": [ "Hostile", "Neutral" ]
              }
            }
          ]
        },
        "Actions": [
          {
            "Type": "ParentState",
            "State": "Alerted"
          }
        ]
      },
      {
        "ActionsAtomic": true,
        "Actions": [
          {
            "Type": "Timeout",
            "Delay": [ 7, 10 ]
          },
          {
            "Type": "ParentState",
            "State": "Idle"
          }
        ],
        "BodyMotion": {
          "Type": "Sequence",
          "Motions": [
            {
              "Type": "Timer",
              "Time": [ 2, 3 ],
              "Motion": {
                "Type": "Wander",
                "MaxHeadingChange": 180,
                "RelativeSpeed": 0.8
              }
            },
            {
              "Type": "Timer",
              "Time": [ 1, 2 ],
              "Motion": {
                "Type": "WanderInCircle",
                "Radius": 5,
                "MaxHeadingChange": 180,
                "RelativeSpeed": 0.8
              }
            }
          ]
        }
      }
    ]
  },
  "Type": "Component"
}