Table of Contents

Class TimbnObjectAction

Namespace
Timbn.GraveyardKeeperTwo.Core.Framework
Assembly
Timbn.GraveyardKeeperTwo.Core.dll

Something the player can do beside an object in the world that the game gives no interaction for, such as petting a cat on a box. Standing by the object shows a hint, and pressing Interaction walks the player straight to a spot beside it, where they face one way and play an animation for a while. Add it with the plugin's UI.AddObjectAction.

public sealed class TimbnObjectAction
Inheritance
TimbnObjectAction
Inherited Members

Examples

UI.AddObjectAction(new TimbnObjectAction("common_box_08", new Vector3(-104.36f, 0f, -338.20f), "my_mod_pet")
{
    Facing = Direction.Up,
    Animation = AnimationState.WorkHands,
    GameMinutes = 10,
});

Constructors

TimbnObjectAction(string, Vector3, string)

Describes the action.

public TimbnObjectAction(string objectName, Vector3 stand, string hintKey)

Parameters

objectName string

The name the object's GameObject starts with, such as common_box_08. Its parents count too.

stand Vector3

The spot the player stands at to do it. Its y is ignored, since the player keeps the height they have.

hintKey string

A text key added with Text.Add, shown as the hint, such as "Pet".

Properties

Animation

The animation the player plays while they do it. Working with their hands by default.

public AnimationState Animation { get; set; }

Property Value

AnimationState

CanPerform

Asked before the hint shows and the walk starts. Return false to hide the action, such as until a quest is done.

public Func<bool>? CanPerform { get; set; }

Property Value

Func<bool>

Facing

The way the player faces while they do it. Up by default.

public Direction Facing { get; set; }

Property Value

Direction

GameMinutes

How many game minutes it lasts. 10 by default.

public double GameMinutes { get; set; }

Property Value

double

HintKey

The text key of the hint.

public string HintKey { get; }

Property Value

string

ObjectName

The name the object's GameObject starts with.

public string ObjectName { get; }

Property Value

string

OnFinished

Called when the animation runs its full minutes. It is not called when the game takes the controls back first.

public Action? OnFinished { get; set; }

Property Value

Action

OnStarted

Called when the player reaches the spot and starts the animation.

public Action? OnStarted { get; set; }

Property Value

Action

Stand

The spot the player stands at. Its y is ignored.

public Vector3 Stand { get; }

Property Value

Vector3