Versions / 0.6.0-pre.1.1 / NPC / Roles / Intelligent / Aggressive / Goblin / Components / Component_Goblin_Instruction_Alerted.json
Component_Goblin_Instruction_Alerted
Server/NPC/Roles/Intelligent/Aggressive/Goblin/Components/Component_Goblin_Instruction_Alerted.json, 3.8 KB
Fields
| Field | Type |
|---|---|
Class | string |
Parameters | object |
Content | object |
Type | string |
Source
{
"Class": "Instruction",
"Parameters": {
"_ImportStates": [ "Idle", "Search", "Chase" ],
"ViewRange": {
"Value": 15,
"Description": "View range"
},
"ViewSector": {
"Value": 180,
"Description": "View sector"
},
"HearingRange": {
"Value": 8,
"Description": "Hearing range"
},
"SmellRange": {
"Value": 8,
"Description": "Smell range"
},
"AlertedRange": {
"Value": 30,
"Description": "A range within which the player can be seen/sensed when the NPC is alerted to their presence"
},
"AlertedTime": {
"Value": [ 1, 1 ],
"Description": "The duration for which the NPC is alert before switching to attack"
},
"TargetGroups": {
"Value": [ "Goblin" ]
}
},
"Content": {
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "Any",
"Once": true
},
"Actions": [
{
"Type": "PlayAnimation",
"Slot": "Status",
"Animation": "Alerted"
},
{
"Type": "SpawnParticles",
"Offset": [ 0, 2.1, 0 ],
"ParticleSystem": "Alerted"
},
{
"Type": "Beacon",
"Range": 10,
"Message": "GoblinAlert",
"TargetGroups": { "Compute": "TargetGroups" },
"SendCount": -1
}
]
},
{
"Continue": true,
"Instructions": [
{
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AlertedRange" },
"Filters": [
{
"Type": "LineOfSight"
}
]
},
"HeadMotion": {
"Type": "Watch"
}
}
]
},
{
"Sensor": {
"Reference": "Component_Sensor_Target_Hidden_Nearby",
"Modify": {
"IntuitionRange": { "Compute": "AlertedRange" },
"HearingRange": { "Compute": "HearingRange + 1" },
"ViewRange": { "Compute": "ViewRange + 1" },
"SmellRange": { "Compute": "SmellRange" },
"ViewSector": { "Compute": "ViewSector" }
}
},
"Actions": [
{
"Type": "ParentState",
"State": "Search"
}
]
},
{
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Reference": "Component_Sensor_Sight_By_Attitude",
"Modify": {
"ViewRange": { "Compute": "AlertedRange" },
"ViewSector": { "Compute": "ViewSector" },
"Attitudes": [ "Hostile" ]
}
},
{
"Reference": "Component_Sensor_Sound_By_Attitude",
"Modify": {
"HearingRange": { "Compute": "HearingRange" },
"Attitudes": [ "Hostile" ]
}
},
{
"Reference": "Component_Sensor_Scent_By_Attitude",
"Modify": {
"SmellRange": { "Compute": "SmellRange" },
"Attitudes": [ "Hostile" ]
}
}
]
},
"Actions": [
{
"Type": "Timeout",
"Delay": { "Compute": "AlertedTime" },
"Action": {
"Type": "ParentState",
"State": "Chase"
}
}
]
},
{
"Continue": true,
"Actions": [
{
"Type": "Timeout",
"Delay": [ 1, 1 ],
"Action": {
"Type": "ParentState",
"State": "Idle"
}
}
]
}
]
},
"Type": "Component"
}