Show / Hide Table of Contents

Class MobilePersonAsset

The component that handles graphics for a mobile person.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
MobilePersonAsset
MobilePersonBillboard
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
public abstract class MobilePersonAsset : MonoBehaviour
Remarks

Implementations should be added to a prefab named "MobilePersonAsset" bundled with a mod. This prefab acts as a provider for all custom npcs graphics. This allows mods to replace classic MobilePersonBillboard with 3d models or other alternatives. The actual graphic asset for specific npc should be loaded when requested by SetPerson(Races, Genders, Int32, Boolean, Int32, Int32).

Properties

| Improve this Doc View Source

IsIdle

Gets or sets idle state. Daggerfall NPCs are either in or motion or idle facing player. This only controls animation state, actual motion is handled by MobilePersonMotor.

Declaration
public abstract bool IsIdle { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Trigger

Trigger collider used for interaction with player. The collider should be altered to enclose the entire npc mesh when SetPerson(Races, Genders, Int32, Boolean, Int32, Int32) is called. A sign of badly setup collider is misbehaviour of idle state and talk functionalities.

Declaration
protected CapsuleCollider Trigger { get; }
Property Value
Type Description
CapsuleCollider

Methods

| Improve this Doc View Source

GetLayerMask()

Gets a bitmask that provides all the layers used by this asset.

Declaration
public virtual int GetLayerMask()
Returns
Type Description
Int32

A layer mask.

| Improve this Doc View Source

GetSize()

Gets size of asset used by this person (i.e size of bounds). Used to adjust position on terrain.

Declaration
public abstract Vector3 GetSize()
Returns
Type Description
Vector3

Size of npc.

| Improve this Doc View Source

SetPerson(Races, Genders, Int32, Boolean, Int32, Int32)

Setup this person based on race, gender and outfit variant. Enitities in a npcs pool can be recycled when out of range, meaning that this method can be called more than once with different parameters.

Declaration
public abstract void SetPerson(Races race, Genders gender, int personVariant, bool isGuard, int personFaceVariant, int personFaceRecordId)
Parameters
Type Name Description
Races race

Race of target npc.

Genders gender

Gender of target npc.

Int32 personVariant

Which basic outfit does the person wear.

Boolean isGuard

True if this npc is a city watch guard.

Int32 personFaceVariant
Int32 personFaceRecordId

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX