How to add new Emotes

Borrie BoBaka

Local Bothan
Staff member
Super Moderator
Joined
Mar 16, 2014
Messages
91
Location
Dark Rebellion RP
Hello everyone! As I'm working on a new project, I thought that one of the most important things to add was new emotes for the players to use to help immerse themselves in a story driven world. Since no one has seemed to do this yet or explained how, I thought I'd type up a small guide. 

I want to give a special thanks and shout out to Mezzanine on Discord for helping me discover what files to find when doing this edit.

Identifying the Files


There are four files you'll be referring to for emotes. 
1. appearance/lat/all_m.lat (or) appearance/lat/all_f.lat
This is the entire library of animations associated with a player character model for males and females respectively. Inside of this file is the string name of an animation file, which is used by the game to determine what animation to use. If you use SIE to open up the file, you can use the Find function to find an animation's reference. The INFO node of that animation's tree will contain the needed string for the animation file you're looking for. 

2. An animation ANS file for all_b
You can easily see a reference to all animations available to a player appearance model by opening SIE, selecting appearance/ackbar.sat, and using the lower right hand menu to select and view animations for that skeleton. The name of the ANS file is the name you'll want to search for in the LAT file. This will also let you preview the animation before you put it into an emote. 
NOTE: As of this writing, it appears that all emotes must have a lat reference name of "emt_" prefixed to their name, or it doesn't work. This significantly cuts back the available animations you can add, until a solution is found. 

3. datatables/chat/social_types.iff
This is a pretty simple file and straightforward to edit. To add an emote, you have to have a reference for the server when it is called. This file is that reference. Simply create a new line at the very end of the table, and add the string you want the command to take. For now it is advised you keep it entirely lowercase like all the others. It is alright (thus far) to put new lines after the FALSE statement at the very end of the list. I have thus far personally prefixed new emotes with "r" so that my new names won't conflict with any other emotes or commands that I am not aware of. (such as /rwave)

4. string/en/socials.stf
Again, special thanks to Mezzanine for finding this. This is the heart of what you see when it comes to emotes. It is also the most brutally unforgiving file when it comes to adding them. All of the references to the command, animation, and text for an emote is handled in a single string. In order to edit this string, you'll want to copy and paste the content of the line into a program such as notepad, or notepad++. You'll find that it goes from a single line to a formatted list of tildes, commands, and words. Here is a breakdown of that


Code:
yawn (name of the command. this must match the entry in the datatable exactly)
yawn (animation when simply doing the command with no arguments, i.e. /yawn)
yawn (animation when you do it with yourself, i.e. /yawn self)
yawn (animation when you do it with a target, i.e. /yawn bob)
~
YAAAWWWNN! (No arguments, what you'll see in chat)
~
~
%TU yawns. (What everyone else sees, when no arguments are present)
~
~
You try to hide a yawn. (What you'll see when you use it on self)
~
~
%TU tries to hide a yawn. (What everyone else will see when you use it on self)
~
~
You yawn at %OT. (What you see when used on a target)
~
~
~
~
~
~
~
~
%TU yawns at %TT. (What everyone else sees when used on a target)
~
~
~
~
~
~
~
~
%TU yawns at you. (What your target will see when used on)
~
~
~
~
~
~
~
~
Now, there are a few things to note:
1. When adding the animations, do not include the emt_ part of the name. emt_yawn becomes yawn.
2. You can skip out on an animation by replacing that line with a tilde.
3. I am uncertain what the number of tildes between each entry mean.
4. Sometimes the strings will lose their endings, or not copy paste right. When this happens, you'll find your character will emote, but not animate, or you'll see the wrong message. I am unsure why this happens, but the solution tends to be just keep copy pasting until it does work. 
5. With the single exception of the datatable file, emotes are handled entirely client side. The server processes the command, and the client performs whatever it thinks it needs to do. This means that you can test new emotes without having to upload the files to the server every time. You will only need to update the server if you've added a new emote entirely, as it requires the datatable to know that the command you're using is an emote. This will help you quickly test and correct bugs.
6. I do not know what causes the new emotes to be played when speaking. I've had a few custom emotes already be displayed when using spatial chat, but they were not using keywords from the emote's name. Just know that it can end up being performed inadvertently for whatever reason (though rare)

Things to discover:
1. How to add new emote animations based on combat and non emote animations. All emotes seem to require the emt_ preface. I do not know where the server or client interprets this. 
2. How to alter the LAT file to possibly include animations from other sources or turn combat animations into emt animations
3. What does the chat look for when wanting to play an emote (like how you belly laugh if you say 'lol')
4. Lastly, emoting while sitting. There are several idles (such as crouching/sneaking, social drink in hand, and sitting) that are not used by players, but NPCs. I want to discover how to readd these as features.

Thanks for reading, and happy emoting!
 
Top Bottom