Skip to main content

InteractionObject

class ThaumielMapEditor.API.Blocks.ServerObjects

Overview​

Properties​

NameTypeAccessDescription
AllowedRolesList<RoleTypeId>get setGets or sets the PlayerRoles.RoleTypeIds that are allowed to interact with this.
BaseInvisibleInteractableToygetThe runtime instance of the underlying AdminToys.InvisibleInteractableToy.
CanSearchboolgetReturns true if the underlying interactable toy can currently be searched by players.
InteractionDurationfloatget setHow long (in seconds) a player must hold the interaction for held interactions.
IsLockedboolget setWhether the interactable is locked and cannot be searched by players.
ObjectTypeObjectTypeget setThe type of this server object. Always ThaumielMapEditor.API.Enums.ObjectType.Interactable.
PermissionsDoorPermissionFlagsget setThe permissions required to interact with this ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject instance.
ScaleVector3get setNo description
ShapeColliderShapeget setThe collider shape used by the interactable toy.

Methods​

SignatureReturnsDescription
ParseValues(SerializableObject)voidParses configuration values from a `ThaumielMapEditor.API.Serialization.Serializ…
SpawnObject(SchematicData, SerializableObject)voidSpawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server…
SpawnObject(SchematicData)voidNo description
TryGetInteractionObject(InvisibleInteractableToy, InteractionObject&)boolTries to get a ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject fr…

Properties​

AllowedRoles​

Type: List<RoleTypeId> Access: get set

Gets or sets the PlayerRoles.RoleTypeIds that are allowed to interact with this.


Base​

Type: InvisibleInteractableToy Access: get

The runtime instance of the underlying AdminToys.InvisibleInteractableToy.


CanSearch​

Type: bool Access: get

Returns true if the underlying interactable toy can currently be searched by players.


InteractionDuration​

Type: float Access: get set

How long (in seconds) a player must hold the interaction for held interactions.

note

Setting this property updates the underlying AdminToys.InvisibleInteractableToy.InteractionDuration. A value of 0 represents an instant interaction and will trigger ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject.OnInteracted.


IsLocked​

Type: bool Access: get set

Whether the interactable is locked and cannot be searched by players.

note

Setting this property updates the underlying AdminToys.InvisibleInteractableToy.IsLocked.


ObjectType​

Type: ObjectType Access: get set

The type of this server object. Always ThaumielMapEditor.API.Enums.ObjectType.Interactable.


Permissions​

Type: DoorPermissionFlags Access: get set

The permissions required to interact with this ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject instance.


Scale​

Type: Vector3 Access: get set


Shape​

Type: ColliderShape Access: get set

The collider shape used by the interactable toy.

note

Setting this property updates the underlying AdminToys.InvisibleInteractableToy.Shape.


Methods​

ParseValues​

ParseValues
public void ParseValues(SerializableObject serializable)

Parses configuration values from a ThaumielMapEditor.API.Serialization.SerializableObject into this instance.

Remarks

If the ThaumielMapEditor.API.Serialization.SerializableObject.ObjectType is not ThaumielMapEditor.API.Enums.ObjectType.Interactable, the method logs a warning. Each individual value is parsed via ThaumielMapEditor.API.Extensions.DictionaryExtensions.TryConvertValue``1(System.Collections.Generic.Dictionary{System.String,System.Object},System.String,``0@) and will log a warning and abort on failure to parse any expected value.

Parameters​

NameTypeDescription
serializableSerializableObjectSerializable object expected to have ObjectType = ThaumielMapEditor.API.Enums.ObjectType.Interactable and values for "Shape", "Duration", and "Locked".

SpawnObject​

SpawnObject
public void SpawnObject(
SchematicData schematic,
SerializableObject serializable
)

Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server and adds it to the provided ThaumielMapEditor.API.Data.SchematicData's ThaumielMapEditor.API.Data.SchematicData.SpawnedServerObjects list.

Parameters​

NameTypeDescription
schematicSchematicData
serializableSerializableObject

SpawnObject​

SpawnObject
public void SpawnObject(SchematicData schematic)

Parameters​

NameTypeDescription
schematicSchematicData

TryGetInteractionObject​

TryGetInteractionObject
public bool TryGetInteractionObject(
InvisibleInteractableToy toy,
InteractionObject& interactionobj
)

Tries to get a ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject from a AdminToys.InvisibleInteractableToy

Parameters​

NameTypeDescription
toyInvisibleInteractableToyThe AdminToys.InvisibleInteractableToy to check for ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject
interactionobjInteractionObject&The ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject if found.

Returns​

bool β€” true if found else returns false if not found