Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.8.1 / NPC / Roles / _Core / Templates / Template_Birds_Passive.json

Template_Birds_Passive

Server/NPC/Roles/_Core/Templates/Template_Birds_Passive.json, 15.7 KB

Fields

FieldType
Typestring
StartStatestring
Parametersobject
IsMemoryobject
MemoriesCategoryobject
MemoriesNameOverrideobject
DropListobject
FlockSpawnTypesobject
DisableDamageGroupsarray[1]
Appearanceobject
KnockbackScalenumber
DeathParticlesobject
DropDeathItemsInstantlyobject
DeathAnimationTimeobject
MotionControllerListarray[1]
MaxHealthobject
Instructionsarray[2]
NameTranslationKeyobject

Source

{
  "Type": "Abstract",
  "StartState": "Idle",
  "Parameters": {
    "Appearance": {
      "Value": "Bluebird",
      "Description": "Model to be used"
    },
    "DropList": {
      "Value": "Empty",
      "Description": "Drop Items"
    },
    "FlockArray": {
      "Value": [ "Template_Birds_Passive" ],
      "Description": "Array containing NPCs for this flock type"
    },
    "WanderRadius": {
      "Value": 15,
      "Description": "The radius used for wandering and leashing"
    },
    "MinHeightOverGround": {
      "Value": 15,
      "Description": "Min Height over ground"
    },
    "MaxHeightOverGround": {
      "Value": 35,
      "Description": "Max Height over ground"
    },
    "MaxHealth": {
      "Value": 100,
      "Description": "Max health for the NPC"
    },
    "DeathParticles": {
      "Value": "Effect_Death_Feathers",
      "Description": "The particle system that spawns when the NPC's corpse disappears."
    },
    "DropDeathItemsInstantly": {
      "Value": false,
      "Description": "Whether the NPC's drop list should be executed when the NPC dies. If set to false, items drop when the corpse disappears."
    },
    "DeathAnimationTime": {
      "Value": 1.5,
      "Description": "The time it takes for this NPC's corpse to disappear."
    },
    "IsMemory": {
      "Value": false,
      "Description": "Defines if the NPC is a memory"
    },
    "MemoriesCategory": {
      "Value": "Other",
      "Description": "Defines the category of the memory"
    },
    "MemoriesNameOverride": {
      "Value": "",
      "Description": "Overrides the memory name if set"
    },
    "NameTranslationKey": {
      "Value": "server.npcRoles.Template.name",
      "Description": "Translation key for NPC name display"
    }
  },
  "IsMemory": { "Compute": "IsMemory" },
  "MemoriesCategory": { "Compute": "MemoriesCategory" },
  "MemoriesNameOverride": { "Compute": "MemoriesNameOverride" },
  "DropList": { "Compute": "DropList" },
  "FlockSpawnTypes": { "Compute": "FlockArray" },
  "DisableDamageGroups": [ "Self" ],
  "Appearance": { "Compute": "Appearance" },
  "KnockbackScale": 0.5,
  "DeathParticles": { "Compute": "DeathParticles" },
  "DropDeathItemsInstantly": { "Compute": "DropDeathItemsInstantly" },
  "DeathAnimationTime": { "Compute": "DeathAnimationTime" },
  "MotionControllerList": [
    {
      "Type": "Fly",
      "MaxHorizontalSpeed": 20,
      "MaxSinkSpeed": 3,
      "MaxClimbSpeed": 10,
      "MinAirSpeed": 4,
      "Acceleration": 5,
      "MinHeightOverGround": { "Compute": "MinHeightOverGround" },
      "MaxHeightOverGround": { "Compute": "MaxHeightOverGround" },
      "MaxRollAngle": 180,
      "MaxTurnSpeed": 360
    }
  ],
  "MaxHealth": { "Compute": "MaxHealth" },
  "Instructions": [
    {
      "Continue": true,
      "Instructions": [
        {
          "$Comment": "This is a separate Instruction so we are always open to receiving beacon messages",
          "Sensor": {
            "Type": "Beacon",
            "Message": "Flock_Pos"
          },
          "Actions": [
            {
              "Type": "SetLeashPosition",
              "ToTarget": true
            }
          ]
        }
      ]
    },
    {
      "Instructions": [
        {
          "Sensor": {
            "Type": "State",
            "State": "Idle"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "State",
                "State": ".Default"
              },
              "Actions": [
                {
                  "Type": "PlayAnimation",
                  "Slot": "Status"
                },
                {
                  "Type": "State",
                  "State": ".Fly"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "State",
                "State": ".Fly"
              },
              "Instructions": [
                {
                  "Sensor": {
                    "Type": "Eval",
                    "Expression": "blocked"
                  },
                  "Actions": [
                    {
                      "Type": "State",
                      "State": ".Blocked"
                    }
                  ]
                },
                {
                  "$Comment": "Motions",
                  "Continue": true,
                  "Sensor": {
                    "Type": "Any"
                  },
                  "Instructions": [
                    {
                      "Reference": "Component_Instruction_Spread_Out",
                      "Modify": {
                        "Range": 1
                      }
                    },
                    {
                      "Sensor": {
                        "Type": "Leash",
                        "Range": { "Compute": "WanderRadius" }
                      },
                      "BodyMotion": {
                        "Type": "Seek",
                        "SlowDownDistance": 1.5,
                        "StopDistance": 1,
                        "RelativeSpeed": 0.25
                      }
                    },
                    {
                      "Sensor": {
                        "Type": "Any"
                      },
                      "BodyMotion": {
                        "Type": "WanderInCircle",
                        "Radius": { "Compute": "WanderRadius" },
                        "MaxHeadingChange": 60,
                        "RelativeSpeed": 0.25
                      }
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "And",
                    "Sensors": [
                      {
                        "Type": "Or",
                        "Sensors": [
                          {
                            "Type": "Self",
                            "Filters": [
                              {
                                "Type": "Flock",
                                "FlockStatus": "NotMember"
                              }
                            ]
                          },
                          {
                            "Type": "And",
                            "Sensors": [
                              {
                                "Type": "FlockLeader"
                              },
                              {
                                "Type": "Self",
                                "Filters": [
                                  {
                                    "Type": "Flock",
                                    "FlockStatus": "Leader"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "Type": "Leash",
                        "Range": { "Compute": "WanderRadius + 1" }
                      }
                    ]
                  },
                  "Actions": [
                    {
                      "Type": "FlockBeacon",
                      "Message": "Flock_Pos",
                      "SendToSelf": false,
                      "ExpirationTime": 0.5
                    },
                    {
                      "Type": "SetLeashPosition",
                      "ToCurrent": true
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "Damage",
                    "Combat": true,
                    "TargetSlot": "LockedTarget"
                  },
                  "Actions": [
                    {
                      "Type": "State",
                      "State": "Panic"
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "Damage",
                    "Combat": false,
                    "Other": true
                  },
                  "Actions": [
                    {
                      "Type": "State",
                      "State": "Panic"
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "Player",
                    "Range": { "Compute": "WanderRadius + 1" },
                    "Filters": [
                      {
                        "Type": "LineOfSight"
                      }
                    ]
                  },
                  "Actions": [
                    {
                      "Type": "State",
                      "State": "Flee"
                    }
                  ]
                }
              ]
            },
            {
              "Sensor": {
                "$TODO": "Remove this state and its references when there's a better way to handle being blocked",
                "Type": "State",
                "State": ".Blocked"
              },
              "Instructions": [
                {
                  "$Comment": "Fake walking when stuck",
                  "Continue": true,
                  "Sensor": {
                    "Type": "Any",
                    "Once": true
                  },
                  "Actions": [
                    {
                      "Type": "PlayAnimation",
                      "Slot": "Status",
                      "Animation": "Walk"
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "Not",
                    "Sensor": {
                      "Type": "Eval",
                      "Expression": "blocked"
                    }
                  },
                  "Actions": [
                    {
                      "Type": "State",
                      "State": ".Default"
                    }
                  ]
                },
                {
                  "Sensor": {
                    "Type": "Any"
                  },
                  "BodyMotion": {
                    "Type": "Wander",
                    "MinHeadingChange": 150,
                    "MaxHeadingChange": 180,
                    "RelativeSpeed": 1
                  }
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Flee"
          },
          "Instructions": [
            {
              "$Comment": "Animations",
              "Continue": true,
              "Sensor": {
                "Type": "Any",
                "Once": true
              },
              "Actions": [
                {
                  "Type": "PlayAnimation",
                  "Slot": "Status"
                }
              ]
            },
            {
              "$Comment": "Motions",
              "Continue": true,
              "Sensor": {
                "Type": "Any"
              },
              "Instructions": [
                {
                  "Sensor": {
                    "Type": "Eval",
                    "Expression": "blocked"
                  },
                  "BodyMotion": {
                    "Type": "Wander",
                    "MinHeadingChange": 150,
                    "MaxHeadingChange": 180,
                    "RelativeSpeed": 1
                  }
                },
                {
                  "Reference": "Component_Instruction_Spread_Out",
                  "Modify": {
                    "Range": 1
                  }
                },
                {
                  "Sensor": {
                    "Type": "Player",
                    "Range": 10,
                    "LockOnTarget": true
                  },
                  "BodyMotion": {
                    "Type": "Flee",
                    "SlowDownDistance": 9,
                    "StopDistance": 12,
                    "RelativeSpeed": 0.75
                  }
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Damage",
                "Combat": true,
                "TargetSlot": "LockedTarget"
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Panic"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Damage",
                "Combat": false,
                "Other": true
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Panic"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Not",
                "Sensor": {
                  "Type": "Player",
                  "Range": { "Compute": "WanderRadius + 1" },
                  "Filters": [
                    {
                      "Type": "LineOfSight"
                    }
                  ]
                }
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Idle"
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Panic"
          },
          "Instructions": [
            {
              "$Comment": "Animations",
              "Continue": true,
              "Sensor": {
                "Type": "Any",
                "Once": true
              },
              "Actions": [
                {
                  "Type": "PlayAnimation",
                  "Slot": "Status",
                  "Animation": "FlyFast"
                }
              ]
            },
            {
              "$Comment": "Motions",
              "Continue": true,
              "Sensor": {
                "Type": "Any"
              },
              "Instructions": [
                {
                  "Sensor": {
                    "Type": "Eval",
                    "Expression": "blocked"
                  },
                  "BodyMotion": {
                    "Type": "Timer",
                    "Time": [ 1, 3 ],
                    "Motion": {
                      "Type": "Wander",
                      "MaxHeadingChange": 45,
                      "RelativeSpeed": 1
                    }
                  }
                },
                {
                  "Reference": "Component_Instruction_Spread_Out",
                  "Modify": {
                    "Range": 1,
                    "RelativeSpeed": 1
                  }
                },
                {
                  "Sensor": {
                    "Type": "Any"
                  },
                  "BodyMotion": {
                    "Type": "Sequence",
                    "Looped": true,
                    "Motions": [
                      {
                        "Type": "Timer",
                        "Time": [ 1, 2 ],
                        "Motion": {
                          "Type": "WanderInCircle",
                          "Radius": 10,
                          "MaxHeadingChange": 45,
                          "RelativeSpeed": 1
                        }
                      },
                      {
                        "Type": "Timer",
                        "Time": [ 0.5, 1 ],
                        "Motion": {
                          "Type": "WanderInCircle",
                          "Radius": 10,
                          "MaxHeadingChange": 90,
                          "RelativeSpeed": 1
                        }
                      }
                    ]
                  }
                }
              ]
            },
            {
              "Reference": "Component_Instruction_State_Timeout",
              "Modify": {
                "_ExportStates": [ "Idle" ],
                "Delay": [ 3, 6 ]
              }
            }
          ]
        }
      ]
    }
  ],
  "NameTranslationKey": { "Compute": "NameTranslationKey" }
}