EmoteDefinition ​
Inherits: DatabaseResource < Resource
An emote: a command the player types (/wave) and a library that the lines of NPCs, events and objects can pick from. It has an animation, a sound and one text for each way the line is read. The texts use the tokens <user> (who does it) and <target name> (the other): "<user> waves to <target name>." See docs: Chat.
Properties ​
String | command | "" |
PackedStringArray | aliases | PackedStringArray() |
AnimationSelectionSocial | animation | |
SFXSelection | sound | |
TargetMode | target_mode | TargetMode.NONE |
float | target_range | 10.0 |
float | audience_range | 0.0 |
String | text_others | "": |
String | text_self | "": |
String | text_others_target | "": |
String | text_self_target | "": |
String | text_target | "": |
Methods ​
PackedStringArray | get_commands() |
bool | matches( word: String ) |
String | pick_text( is_actor: bool, is_target: bool, has_target: bool ) |
Enumerations ​
enum TargetMode ​
Whether the emote uses a target
- NONE =
0- The emote never uses a target - OPTIONAL =
1- The target texts are used when there is a target, else the others - REQUIRED =
2- With no target the player gets "You need a target"
Property descriptions ​
String command = "" ​
The word the player types after the slash: "wave" for /wave
PackedStringArray aliases = PackedStringArray() ​
Other words for the same emote (a translated game adds its own: "saluer")
AnimationSelectionSocial animation ​
The animation the character plays (optional)
SFXSelection sound ​
The sound (optional): played at the one who does the emote
TargetMode target_mode = TargetMode.NONE ​
Whether the emote uses a target
float target_range = 10.0 ​
How far the target can be, in metres
float audience_range = 0.0 ​
How far the line is heard, in metres. 0 = the range of the Emote channel
String text_others = "": ​
What everyone else reads when there is no target: "<user> waves."
String text_self = "": ​
What the one who does it reads when there is no target: "You wave."
String text_others_target = "": ​
What everyone else reads when there is a target: "<user> waves to <target name>."
String text_self_target = "": ​
What the one who does it reads when there is a target: "You wave to <target name>."
String text_target = "": ​
What the target reads: "<user> waves to you." Empty = the text of everyone else
Method descriptions ​
PackedStringArray get_commands() ​
The words that run the emote: the command and the aliases, lower case
bool matches( word: String ) ​
Is this word one of the emote's?
String pick_text( is_actor: bool, is_target: bool, has_target: bool ) ​
The text for one reader. is_actor: the one who does it. is_target: the one it is done to. has_target: the emote has a target. The first-person text falls back to the third-person one