Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.1 / NPC / Roles / _Core / Tests / Interaction / Test_Interaction.json

Test_Interaction

Server/NPC/Roles/_Core/Tests/Interaction/Test_Interaction.json, 4.6 KB

Fields

FieldType
StartStatestring
Debugstring
Typestring
Appearancestring
BusyStatesarray[1]
DefaultPlayerAttitudestring
MotionControllerListarray[1]
TestTypestring
MaxHealthobject
Parametersobject
Instructionsarray[1]
InteractionInstructionobject
NameTranslationKeystring

Source

{
  "StartState": "Idle",
  "Debug": "DisplayState",
  "Type": "Generic",
  "Appearance": "Kweebec_Sapling_Orange",
  "BusyStates": [ "Idle.Combat" ],
  "DefaultPlayerAttitude": "Neutral",
  "MotionControllerList": [
    {
      "Type": "Walk",
      "MaxWalkSpeed": 3,
      "Gravity": 10,
      "MaxFallSpeed": 20,
      "Acceleration": 10
    }
  ],
  "TestType": "Normal",
  "MaxHealth": { "Compute": "MaxHealth" },
  "Parameters": {
    "MaxHealth": {
      "Value": 100,
      "Description": "Max health for the NPC"
    }
  },
  "Instructions": [
    {
      "Instructions": [
        {
          "Sensor": {
            "Type": "State",
            "State": "Idle"
          },
          "Instructions": [
            {
              "Reference": "Component_Instruction_Clear_Status_Animation",
              "Modify": { }
            },
            {
              "Sensor": {
                "Type": "State",
                "State": ".Combat"
              },
              "Instructions": [
                {
                  "Sensor": {
                    "Type": "Any"
                  },
                  "Actions": [
                    {
                      "Type": "Timeout",
                      "Delay": [ 5, 5 ],
                      "Action": {
                        "Type": "State",
                        "State": "Idle"
                      }
                    }
                  ]
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Damage",
                "Combat": true
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": ".Combat"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Any"
              },
              "BodyMotion": {
                "Type": "Nothing"
              }
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "$Interaction"
          },
          "Instructions": [
            {
              "Sensor": {
                "Once": true,
                "Type": "Target",
                "Range": 10
              },
              "Actions": [
                {
                  "Type": "PlayAnimation",
                  "Slot": "Status",
                  "Animation": "Wave"
                }
              ]
            },
            {
              "Continue": true,
              "Sensor": {
                "Type": "Target",
                "Range": 10
              },
              "HeadMotion": {
                "Type": "Watch"
              }
            },
            {
              "Sensor": {
                "Type": "Any"
              },
              "Actions": [
                {
                  "Type": "Timeout",
                  "Delay": [ 2, 2 ],
                  "Action": {
                    "Type": "Sequence",
                    "Actions": [
                      {
                        "Type": "ReleaseTarget"
                      },
                      {
                        "Type": "State",
                        "State": "Idle"
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "InteractionInstruction": {
    "Instructions": [
      {
        "Sensor": {
          "Type": "Not",
          "Sensor": {
            "$Comment": "Check the negative first so we can exit early and avoid the rest of the logic",
            "Type": "CanInteract",
            "ViewSector": 90
          }
        },
        "Actions": [
          {
            "Type": "SetInteractable",
            "Interactable": false
          }
        ]
      },
      {
        "Continue": true,
        "Sensor": {
          "Type": "Any"
        },
        "Actions": [
          {
            "Type": "SetInteractable",
            "Interactable": true
          }
        ]
      },
      {
        "Sensor": {
          "Type": "HasInteracted"
        },
        "Instructions": [
          {
            "Sensor": {
              "Type": "Not",
              "Sensor": {
                "Type": "State",
                "State": "$Interaction"
              }
            },
            "Actions": [
              {
                "Type": "LockOnInteractionTarget"
              },
              {
                "Type": "State",
                "State": "$Interaction"
              }
            ]
          }
        ]
      }
    ]
  },
  "NameTranslationKey": "server.npcRoles.Test_Interaction.name"
}