Custom preset animations setup
The following guide explains how to create your own custom preset animations for the nss_emotes resource. You can create your own animations by using the available functions in LUA and make them available in your JavaScript config files to show them in the emote menu.
We do not provide support for creating custom preset animations, but this guide should help you to get started.
Use on your own risk!
Basics
To create your own custom preset animations there are two important things to consider:
First, you need to create the actual animation setup in LUA using the available functions.
Second, you need to make the newly created animations available in your JavaScript config files.
It is helpful to have an idea how animations in REDM work. You can find more information about that in the animation presets.
Steps to create custom preset animations
Create a new file in the folder
nss_emotes/animations/named e.g.my_custom_animations.lua.Add your custom animations using the available functions (see below) to the newly created file. See animation presets for available preset animations.
Make the new animations available in your JavaScript config file (e.g.
nss_emotes/html_nss_emotes/config.js) to show them in the emote menu.Restart the resource or your server to apply the changes.
Test your new custom animations in-game.
Enjoy your custom animations!
Simple example
Create a new file (if not allready exists)
nss_emotes/animations/my_custom_animations.luawith the following content:Add the new animation to your JavaScript config file (e.g.
nss_emotes/html_nss_emotes/config.js):Restart the resource or your server to apply the changes.
You can now trigger the animation by using the command
act mywaveor by selecting it in the emote menu.Enjoy your custom animation!
Working with prefixes
It is recommended to use a prefix for your custom animation commands to avoid conflicts.
For example, if you set Config.AnimationEmotePrefix to emote-, you can define your custom animation command as emote-mywave instead of just mywave.
There are some prefixes you can choose from, e.g.:
All these prefixes are used in the base command act <command> to trigger the animation. For example, if you use the emote- prefix, the full command to trigger the animation would be act emote-mywave.
Example:
Resources & path references
animation presets (often used in
animDictandanimNameparameters)flags documentation (often used in
flagsparameter)Custom icons for JavaScript config (e.g.
nss_emotes/html_nss_emotes/config.js) must be placed innss_emotes/html_nss_emotes/icons/and subfolders. Consider the correct path when adding the icon in the config. If an icon is in a subfolder, the path must include the subfolder, e.g.subfolder/icon.png.
addSimpleAnimation
addSimpleAnimationThis function works like a wrapper for TaskPlayAnim native function to easily add simple animations.
addSimpleEmoteAnimation
addSimpleEmoteAnimationWorks like the native TaskPlayEmoteWithHash.
addActionEmote
addActionEmoteAdds a simple animation of type action emote (emote class 1, see emote class types for more information).
addTauntEmote
addTauntEmoteAdds a simple animation of type taunt emote (emote class 2, see emote class types for more information).
addGreetEmote
addGreetEmoteAdds a simple animation of type greet emote (emote class 3, see emote class types for more information).
addReactionEmote
addReactionEmoteAdds a simple animation of type reaction emote (emote class 0, see emote class types for more information).
addScenarioInPlaceHash
addScenarioInPlaceHashAdds a scenario and uses the native TaskStartScenarioInPlaceHash to start it. With TaskStartScenarioInPlaceHash smoother transitions can be achieved compared to TaskStartScenarioInPlace.
The loop prefix is recommended for scenarios that are intended to be looped.
addScenarioInPlace
addScenarioInPlaceAdds a scenario and uses the native TaskStartScenarioInPlace to start it.
The loop prefix is recommended for scenarios that are intended to be looped.
Complex animations with steps
addGenderedAnimation
addGenderedAnimationAdds a gendered animation with different animation steps for male and female characters.
It is possible that some animations are only available for one gender. In that case, you can provide only the animation steps for the available gender.
The animation steps can be different types of animation steps. Animation steps are special functions that can be chained.
The loop prefix is recommended for scenarios that are intended to be looped.
addMultipleAnimations
addMultipleAnimationsLike addGenderedAnimation but without gender distinction.
addPartnerAnimation
addPartnerAnimationAdds a partner animation with different animation steps for two players.
createSimplePartnerAnimation
createSimplePartnerAnimationShortcut for addPartnerAnimation for simple partner animations with only one animation step.
Important:
This function always uses
Config.AnimationPartnerPrefixas prefix for the command.To use this function your lua file must have to be loaded after
partner_animations.luafile. You can ensure this by naming your lua file with a prefix that comes alphabetically afterp, e.g.z_my_partner_animations.lua.
Step creation functions
Important: These functions are only usable in Complex animations with steps functions.
createAnimScenarioInPlaceHashStep
createAnimScenarioInPlaceHashStepCreates an animation step like addScenarioInPlaceHash but without command and returns the step.
createAnimScenarioInPlaceStep
createAnimScenarioInPlaceStepCreates an animation step like addScenarioInPlace but without command and returns the step.
createAnimStep
createAnimStepCreates an animation step like addSimpleAnimation but without command and returns the step.
createEmoteHashAnimStep
createEmoteHashAnimStepCreates an animation step like addSimpleEmoteAnimation but without command and returns the step.
Last updated
Was this helpful?