Class SeekShelterState
- Namespace
- FishMMO.Server.Implementation.World.SceneServer.AI
- Assembly
- FishMMO.Server.dll
Walks to the nearest cover and waits there until the weather passes.
[CreateAssetMenu(fileName = "New AI Seek Shelter State", menuName = "FishMMO/Character/NPC/AI/Seek Shelter State", order = 0)]
public class SeekShelterState : BaseAIState, ICachedObject
- Inheritance
-
ObjectScriptableObjectSeekShelterState
- Implements
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.MemberwiseClone()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Entered by AIController when the archetype's AIShelterSettings says the weather at the NPC's own position is worth walking away from, and left again when it is not. The state does the walking; the archetype decides whether it ever happens (Q15).
A shelter is a WeatherVolume of kind Shelter (the World Simulation module; read through ShelterQuery) — the same volumes that keep the rain off a player standing in them. So an NPC that has reached one is genuinely sheltered by the same measure the player's exposure uses, and is not merely standing somewhere a designer once labelled dry.
Fields
DepthIntoShelter
[Tooltip("How far into the volume to aim, 0 its edge and 1 its centre. Short of the centre so a crowd does not pile onto one point.")]
[Range(0, 1)]
public float DepthIntoShelter
Field Value
Spread
[Tooltip("Metres of scatter around the chosen spot, so several NPCs sheltering together do not stack.")]
[Min(0)]
public float Spread
Field Value
Methods
Enter(AIController)
Sets off toward the nearest cover. With none in reach, gives up at once.
public override void Enter(AIController controller)
Parameters
controllerAIController
Exit(AIController)
Called when the state is exited. Implement cleanup logic here.
public override void Exit(AIController controller)
Parameters
controllerAIControllerThe AI controller managing this NPC.
UpdateState(AIController, float)
Keeps walking; once there, stands still and lets the controller decide when to leave.
public override void UpdateState(AIController controller, float deltaTime)
Parameters
controllerAIControllerdeltaTimefloat