NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Classes

union  nnl::action::AnimationNode
 A union that represents a function or argument node within an animation playback chain. More...
union  nnl::action::EffectNode
 A union that represents a function or argument node within an auxiliary effect playback chain. More...
struct  nnl::action::Action
 Represents an action. More...

Typedefs

using nnl::action::ActionConfig = tsl::ordered_map<action::Id, Action>
 Represents a collection of actions associated with an entity.

Enumerations

enum class  nnl::action::AnimationFunction : u16 {
  nnl::action::AnimationFunction::kEnd = 0 , nnl::action::AnimationFunction::kNext = 1 , nnl::action::AnimationFunction::kGoto = 2 , nnl::action::AnimationFunction::kTransitionToAnimation5 = 5 ,
  nnl::action::AnimationFunction::kTransitionToAnimation6 = 6 , nnl::action::AnimationFunction::kEndAnimationPlayback = 7 , nnl::action::AnimationFunction::kInitAnimationPlayback = 8 , nnl::action::AnimationFunction::kSetFlags = 9 ,
  nnl::action::AnimationFunction::kInitCountdown = 0xA , nnl::action::AnimationFunction::kCheckCountdown = 0xB , nnl::action::AnimationFunction::kSetBossHitTarget = 0xC , nnl::action::AnimationFunction::kUnkD = 0xD ,
  nnl::action::AnimationFunction::kSetAnimSpeed = 0xE , nnl::action::AnimationFunction::kPlayAnimation = 0xF , nnl::action::AnimationFunction::kSetAnimStartFrame = 0x10 , nnl::action::AnimationFunction::kUnk11 = 0x11 ,
  nnl::action::AnimationFunction::kUnk12 = 0x12 , nnl::action::AnimationFunction::kUnk13 = 0x13 , nnl::action::AnimationFunction::kSetMeshGroupVisib = 0x14 , nnl::action::AnimationFunction::kWaitAfter = 0x15 ,
  nnl::action::AnimationFunction::kWaitBefore = 0x16 , nnl::action::AnimationFunction::kEnableTextureSwap = 0x17 , nnl::action::AnimationFunction::kDisableTextureSwap = 0x18 , nnl::action::AnimationFunction::kEnableEffect = 0x19 ,
  nnl::action::AnimationFunction::kUnk1A = 0x1A , nnl::action::AnimationFunction::kSetComboTransitFrames = 0x1B
}
 Enumeration for different animation functions. More...
enum class  nnl::action::EffectFunction : u8 {
  nnl::action::EffectFunction::kEnd = 0 , nnl::action::EffectFunction::kSetFlags1 = 1 , nnl::action::EffectFunction::kEnableEffect = 2 , nnl::action::EffectFunction::kOpacityTransition3 = 3 ,
  nnl::action::EffectFunction::kOpacityTransition4 = 4 , nnl::action::EffectFunction::kOpacityTransition6 = 6 , nnl::action::EffectFunction::kPlaySFX = 7 , nnl::action::EffectFunction::kPlaySFXRND = 8 ,
  nnl::action::EffectFunction::kPlayUVAnim = 0xA , nnl::action::EffectFunction::kOpacityTransitionB = 0xB , nnl::action::EffectFunction::kUnkC = 0xC , nnl::action::EffectFunction::kNextD = 0xD ,
  nnl::action::EffectFunction::kNextE = 0xE , nnl::action::EffectFunction::kNextF = 0xF , nnl::action::EffectFunction::kUnk10 = 0x10 , nnl::action::EffectFunction::kUnk11 = 0x11 ,
  nnl::action::EffectFunction::kUnk12 = 0x12 , nnl::action::EffectFunction::kSetFlags13 = 0x13 , nnl::action::EffectFunction::kEnableEffect14 = 0x14 , nnl::action::EffectFunction::kSetFlags15 = 0x15 ,
  nnl::action::EffectFunction::kSetFlags16 = 0x16 , nnl::action::EffectFunction::kUnk17 = 0x17 , nnl::action::EffectFunction::kUnk18 = 0x18 , nnl::action::EffectFunction::kSlowdown = 0x19 ,
  nnl::action::EffectFunction::kEnableDisplayEffect = 0x1A , nnl::action::EffectFunction::kEnableEffect1B = 0x1B , nnl::action::EffectFunction::kUnk1C = 0x1C , nnl::action::EffectFunction::kAnimateCamera = 0x1D ,
  nnl::action::EffectFunction::kMoveRootBone = 0x1E , nnl::action::EffectFunction::kAnimateCamera1F = 0x1F , nnl::action::EffectFunction::kSetMeshGroupVisib = 0x20 , nnl::action::EffectFunction::kEnableJutsuEffect = 0x21 ,
  nnl::action::EffectFunction::kSetTextureSwapStat = 0x22 , nnl::action::EffectFunction::kSetFlags23 = 0x23 , kUnk24 = 0x24 , nnl::action::EffectFunction::kUnk25 = 0x25
}
 Enumeration for different effect functions. More...

Functions

bool nnl::action::IsOfType (BufferView buffer)
 Tests if the provided file is an action config.
ActionConfig nnl::action::Import (BufferView buffer)
 Parses a binary file and converts it to ActionConfig.
Buffer nnl::action::Export (const ActionConfig &action_config)
 Converts ActionConfig to a binary file representation.

Variables

constexpr u16 nnl::action::kNumAnimFuncNSUNI = 0x1C
constexpr u16 nnl::action::kNumEffectFuncNSUNI = 0x26
constexpr u16 nnl::action::kNumAnimFuncNSLAR = 0x14
constexpr u16 nnl::action::kNumEffectFuncNSLAR = 0xC

Detailed Description


Class Documentation

◆ nnl::action::AnimationNode

union nnl::action::AnimationNode

A union that represents a function or argument node within an animation playback chain.

Note
When next_main_node is > 1, nodes that immediately follow store arguments for the function and may be reinterpreted as various numeric types.
See also
nnl::action::AnimationFunction
nnl::action::ReadArgs
nnl::action::EffectNode
nnl::action::Action

Public Member Functions

 NNL_PACK (struct { AnimationFunction function;u8 next_main_node;bool flag;}) main
 Layout of a main node.

Public Attributes

u8 args [4]
 Raw memory for storing argument values in argument nodes.

Member Function Documentation

◆ NNL_PACK()

nnl::action::AnimationNode::NNL_PACK ( struct { AnimationFunction function;u8 next_main_node;bool flag;} )

Layout of a main node.

Member Data Documentation

◆ args

u8 nnl::action::AnimationNode::args[4]

Raw memory for storing argument values in argument nodes.

◆ nnl::action::EffectNode

union nnl::action::EffectNode

A union that represents a function or argument node within an auxiliary effect playback chain.

Effect nodes trigger additional visual and sound effects during the playback of a main animation chain.

Note
When next_main_node is > 1, nodes that immediately follow store arguments for the function and may be reinterpreted as various numeric types.
See also
nnl::action::EffectFunction
nnl::action::AnimationNode
nnl::action::Action

Public Attributes

u8 args [4]
 Array for storing argument values (in argument nodes)

Member Data Documentation

◆ args

u8 nnl::action::EffectNode::args[4]

Array for storing argument values (in argument nodes)

◆ nnl::action::Action

struct nnl::action::Action

Represents an action.

An action is a behavior that an entity can perform, such as running, jumping, or attacking. It may consist of multiple animations accompanied by various visual and sound effects.

See also
nnl::action::ActionConfig

Public Attributes

std::string name = ""
 The name of the action. It does not affect anything.
std::vector< AnimationNodeanimation_nodes
std::vector< EffectNodeeffect_nodes

Member Data Documentation

◆ animation_nodes

std::vector<AnimationNode> nnl::action::Action::animation_nodes

A series of nodes that configure what animations are played during the action and how they are played.

◆ effect_nodes

std::vector<EffectNode> nnl::action::Action::effect_nodes

A series of nodes that can trigger additional effects during the animation playback.

◆ name

std::string nnl::action::Action::name = ""

The name of the action. It does not affect anything.

Typedef Documentation

◆ ActionConfig

using nnl::action::ActionConfig = tsl::ordered_map<action::Id, Action>

Represents a collection of actions associated with an entity.

Note
The specific actions and their usage within the games are partially hardcoded.
This object stores only a portion of the data that may be required by a 3D asset to function properly. Its binary representation must be used as part of a larger container that may also include models, animations, and other data.
See also
nnl::action::Action
nnl::action::Import
nnl::asset::Asset3D

Enumeration Type Documentation

◆ AnimationFunction

enum class nnl::action::AnimationFunction : u16
strong

Enumeration for different animation functions.

This enum defines various functions that can be used in animation nodes to control animation playback.

Function used in NSLAR (0x14 in total): 0, 2, 5, 6, 7, 8, a, b, c, e, f, 0x10, 0x13

Functions used in NSUNI (0x1C in total): 0, 2, 6, 7, 8, 9, a, b, c, e, f, 0x10, 0x13, 0x14, 0x16, 0x19, 1a, 1b

Syntax notes:
[] - represents a list of argument nodes expected by the function
{} - a single 4 byte node with different layouts.
a - an argument

See also
nnl::action::AnimationNode
Enumerator
kEnd 

Mark the end of a node sequence; [].

kNext 

Jump to the next specified node; [].

kGoto 

Go to a node; a0 - a relative index of the node to go back or forward to: current index + index*4; [{i32}]

kTransitionToAnimation5 

Seems to be almost the same as 0x6; [{i16,i16}].

kTransitionToAnimation6 

Transition into another animation from the current pose; a0 - animation id, a1 - num of frames the transition takes; [{i16,i16}]

kEndAnimationPlayback 

This is used after 0xF, 0x6, 0x5; [].

kInitAnimationPlayback 

This is used before 0xF (sometimes 0x6); [].

kSetFlags 

Writes some flags at the offset, used when jumping, getting hit; a0 - offset, a1 flag, a2 flag [{u16,i8,u8}]

kInitCountdown 

Init a countdown; a0 - time?, a1 ? [{u16,u16}].

kCheckCountdown 

Check if the countdown is 0; [].

kSetBossHitTarget 

Something related to a hit circle on bosses; [{i16,i16}].

kUnkD 

Might call a function; [{i32}].

kSetAnimSpeed 

Changes the animation playback speed; a0 - speed (4096 is the default) [{i16,_}]

kPlayAnimation 

Play an animation; a0 - animation id (from an AnimationContainer); [{i16,_}]

kSetAnimStartFrame 

Play the animation from a frame; a0 - frame to start playback from; [{u16,_}]

kUnk11 

Might call a function; [{u16,_},{u32}].

kUnk12 

?; if a0 == 0 animation gets stuck; [{u16,_}]

kUnk13 

Might call a function; [{unused}].

kSetMeshGroupVisib 

Change visibility of a mesh group; a0 - mesh group, a1 - visibility status; [{u16,u16}]

kWaitAfter 

Pause after executing animation and before going to the next node; a0 - time in frames; [{u16,_}]

kWaitBefore 

Pause before executing animation and before going to the next node; a0 - time; [{u16,_}]

kEnableTextureSwap 

Activate a texture swap; a0 - texture swap id; [{u16,_}].

kDisableTextureSwap 

Disable a texture swap; a0 - texture swap id; [{u16,_}].

kEnableEffect 

Trigger an effect; a0 effect id (e.g. 0xF shakes the camera); [{u16,u16},{u16,u16}]

kUnk1A 

Might call a function; [{u16,u16},{u16,u16},{f32},{f32},{f32},{f32}]

kSetComboTransitFrames 

Set combo animation transition frames: a0 - action id ,a1 = -1; a0 cooldown, a1 time frame to trigger the next attack; [{i16,i16},{i16,i16},{i16,i16}]

◆ EffectFunction

enum class nnl::action::EffectFunction : u8
strong

Enumeration for different effect functions.

This enum defines various functions that can be used during animation playback that is controlled by animation nodes.

Functions used in NSLAR (0xC in total): 0, 1, 2, 3, 4, 6, 7, a, b;

Functions used in NSUNI (0x26 in total): 0, 1, 2, 3, 6, 7, a, b, 0x14, 0x17, 0x19, 1a, 1b, 1d, 1e, 1f, 0x20, 0x21, 0x22, 0x23;

Syntax notes:
[] - represents a list of argument nodes expected by the function
{} - a single 4 byte node with different layouts
<{}> - an optional node

See also
nnl::action::EffectNode
Enumerator
kEnd 

Mark the end of a node sequence; [].

kSetFlags1 

Set some flags [<{u16,u16}>, <{i16,_}>]; 0-2 args in NSUNI, 0-3 in NSLAR [<{u16,i8,u8}>];

kEnableEffect 

Change the effect that appears from footsteps (?); a0 effect id [{u16, i16}];

kOpacityTransition3 

? a0 - type, a1 - num frames, a2 - ? [{u16, i16}, {f32}]

kOpacityTransition4 

? [{u16, i16},{f32}]

kOpacityTransition6 

? [{u16,i16},{i16,i16}]

kPlaySFX 

Play a sound from a sound bank; a0 - sound id, a1 - ?, a2 - ? [{u16,u8,__},{f32}]

kPlaySFXRND 

Play one of the 2 sounds from a sound bank; a0, a1 - sound id [{u16, u16},{u8 = 1, u8 = 1,__}]

kPlayUVAnim 

a0 - uv anim id, a1 - u_shift, a2 - v_shift [{u16,i16},{i16,_}]

kOpacityTransitionB 

a0 - unk, a1 - vfx group id, [{u8, u8, u16}, {f32}]

kUnkC 

?

kNextD 

Does nothing?; [].

kNextE 

Does nothing?; [].

kNextF 

Does nothing?; [].

kUnk10 

?

kUnk11 

?

kUnk12 

?

kSetFlags13 

?

kEnableEffect14 

a0 - effect id [{u16,i16}]

kSetFlags15 

? [{u32},{u16,u16}]

kSetFlags16 

[{u32},{u16,u16}]

kUnk17 

? [{u16,i16},{f32},{f32},{f32},{f32}];

kUnk18 

?

kSlowdown 

?

kEnableDisplayEffect 

Enable a display effect. The num of args may vary [{u16 - effect id, u16},...];
[{u16 = 3,u16 = time}, {unused}] transition to a white screen;
[{u16 = 4, u16 = time},{unused}] transition from a white/black screen
[{u16 = 7,??},{}] light camera shake
[{u16 = 9,__},{}] mid camera shake
[{u16 = a,__},{}] strong camera shake
[{u16 = b,__},{}] extreme camera shake
[{u16 = C,__},{},{f32 = scale},{f32 = scale},{f32 = scale},{u32 = duration},{__,_u8 = intensity}] motion blur
[{u16 = D, u16 time},{},{f32 x},{f32 y}] camera shake in the x, y range

kEnableEffect1B 

a0 effect group, a1 effect id, a2 repeat interval (if 0 - play once) [{u16,__}, {u16, u16}]

kUnk1C 

?

kAnimateCamera 

[{u16 num extra args,u16 - play time num frames},{u16 - transition to default camera,u16 - fps to transition back in start pos},{f32 = x start},{f32 = y start},{f32 = x shift},{f32 = y shift},{f32 pitch},{f32 yaw },{f32 roll},{f32 pitch shift},{f32 yaw shift},{f32 roll shift},{f32 fov (extra)},{f32 pan(extra)},{f32 pan shift},{f32}]

kMoveRootBone 

a0 - mode, a1 num frames, a2, a3, a4 x,y,z [{u16,u16},{f32},{f32},{f32},{f32},{u16,u16},{u16,u16}]

kAnimateCamera1F 

Almost the same as 0x1D but more arg nodes are used (17 - 19) [...]

kSetMeshGroupVisib 

a0 - group id, a1 - enabled/disabled [{u16, u16}]

kEnableJutsuEffect 

The num of args may vary.

kSetTextureSwapStat 

a0 - swap id, a1 - enabled/disabled [{u16, u16}]

kSetFlags23 

Set some character flags (?) [{i16,i16},{i16,i16},{i16,i16}].

kUnk25 

? Used in "Scene" action configs [{}, {}]

Function Documentation

◆ Export()

Buffer nnl::action::Export ( const ActionConfig & action_config)
nodiscard

Converts ActionConfig to a binary file representation.

This function takes an ActionConfig object and converts it into its binary format.

Parameters
action_configThe ActionConfig object to be converted into the binary format.
Returns
A buffer containing the binary representation of the action configuration.

◆ Import()

ActionConfig nnl::action::Import ( BufferView buffer)

Parses a binary file and converts it to ActionConfig.

This function takes a binary representation of an action config, parses its contents, and converts them into an ActionConfig object for easier access and manipulation.

Parameters
bufferThe binary file buffer to be processed.
Returns
An ActionConfig object representing the converted data.
See also
nnl::action::IsOfType
nnl::action::Export

◆ IsOfType()

bool nnl::action::IsOfType ( BufferView buffer)

Tests if the provided file is an action config.

This function takes a file buffer and checks whether it corresponds to the in-game action config format.

Parameters
bufferThe file buffer to be tested.
Returns
Returns true if the file is identified as an action config
See also
nnl::action::Import

Variable Documentation

◆ kNumAnimFuncNSLAR

u16 nnl::action::kNumAnimFuncNSLAR = 0x14
constexpr

The number of functions available for use in animation nodes in NSLAR

◆ kNumAnimFuncNSUNI

u16 nnl::action::kNumAnimFuncNSUNI = 0x1C
constexpr

The number of functions available for use in animation nodes in NSUNI

◆ kNumEffectFuncNSLAR

u16 nnl::action::kNumEffectFuncNSLAR = 0xC
constexpr

The number of functions available for use in effect nodes in NSLAR

◆ kNumEffectFuncNSUNI

u16 nnl::action::kNumEffectFuncNSUNI = 0x26
constexpr

The number of functions available for use in effect nodes in NSUNI