Class TimbnObjectAction
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
objectNamestringThe name the object's GameObject starts with, such as common_box_08. Its parents count too.
standVector3The spot the player stands at to do it. Its y is ignored, since the player keeps the height they have.
hintKeystringA 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
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
HintKey
The text key of the hint.
public string HintKey { get; }
Property Value
ObjectName
The name the object's GameObject starts with.
public string ObjectName { get; }
Property Value
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
OnStarted
Called when the player reaches the spot and starts the animation.
public Action? OnStarted { get; set; }
Property Value
Stand
The spot the player stands at. Its y is ignored.
public Vector3 Stand { get; }
Property Value
- Vector3