NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
action.hpp File Reference

Contains structures and functions for working with game actions. More...

#include <map>
#include <set>
#include "NNL/common/fixed_type.hpp"
#include "NNL/common/io.hpp"
#include "NNL/game_asset/behavior/action_common.hpp"
#include "NNL/utility/math.hpp"
#include "tsl/ordered_map.h"

Go to the source code of this file.

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...

Namespaces

namespace  nnl
namespace  nnl::action
 Contains structures and functions for working with game actions.

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.
std::map< u16, std::set< std::string > > nnl::action::GetAnimationNames (const ActionConfig &action_config)
 Returns a map of animation IDs and names of all actions in which those animations were used.
template<class... Ts, class Node>
std::tuple< Ts... > nnl::action::ReadArgs (std::size_t main_node_ind, const std::vector< Node > &nodes)
 Extracts arguments from a series of nodes.
template<class... Ts, class Node>
void nnl::action::WriteArgs (std::size_t main_node_ind, std::vector< Node > &nodes, const Ts &&... args)
 Converts arguments to a series of nodes.
template<class Node>
std::size_t nnl::action::NextNodeInd (std::size_t main_node_ind, const std::vector< Node > &nodes)
 Calculates the absolute index of the next main node in a vector.

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

Contains structures and functions for working with game actions.

See also
nnl::action::ActionConfig
nnl::action::IsOfType
nnl::action::Import
nnl::action::Export