Jump to content

Sonic Frontiers/Internals/GOCRflParameter: Difference between revisions

From HEModdingWiki
Ashrindy (talk | contribs)
No edit summary
Ashrindy (talk | contribs)
Added GOCRflParameter Frontiers
 
Line 1: Line 1:
'''GOCRflParameter''' located in the <code>app_cmn::rfl</code> namespace, is a simple [[Sonic Frontiers/Internals/GOComponent|GOComponent]] for storing and accessing [[Resources/Reflection|Reflection]] parameters through a [[Sonic Frontiers/Internals/Game Object|Game Object]].
'''GOCRflParameter''' located in the <code>app_cmn::rfl</code> namespace, is a simple [[Sonic Frontiers/Internals/GOComponent|GOComponent]] for storing and accessing [[Resources/Reflection|Reflection]] parameters through a [[Sonic Frontiers/Internals/Game Object|Game Object]].
== Usage ==
It follows the same way of creation as every other [[Sonic Frontiers/Internals/GOComponent|GOComponent]].
The struct of the SetupInfo/Description for this component is simple:<syntaxhighlight lang="cpp">
struct SetupInfo {
    unsigned int capacity; // The amount of parameters that are going to be used at first
};
</syntaxhighlight>This leads to the setup in general being primitive, as all that's needed is to provide the amount of parameters that are gonna be stored at first.<syntaxhighlight lang="cpp">
app_cmn::rfl::GOCRflParameter::SetupInfo gocRflParamDesc{}; // Initialize the SetupInfo/Description struct
gocRflParamDesc.capacity = 6; // Specify the amount of parameters that are gonna be used at first
gocRflParam->Setup(gocRflParamDesc); // This sets up the GOComponent for proper usage
</syntaxhighlight>Afterwards, you are able to add your [[Resources/Reflection|Reflection]] parameters.<syntaxhighlight lang="cpp">
hh::fnd::ResReflection* myRefl; // Get or create your Reflection info
gocRflParam->SetParameter(myRefl, 0); // Set the Reflection info to an index, that is then going to be used to access the parameter
</syntaxhighlight>To get the [[Resources/Reflection|Reflection]] parameters.<syntaxhighlight lang="cpp">
MyReflStruct* myRefl = gocRflParam->GetParameter<MyReflStruct>(0); // Get the parameter at index 0 as MyReflStruct
</syntaxhighlight>

Latest revision as of 13:44, 13 December 2025

GOCRflParameter located in the app_cmn::rfl namespace, is a simple GOComponent for storing and accessing Reflection parameters through a Game Object.

Usage[edit | edit source]

It follows the same way of creation as every other GOComponent.

The struct of the SetupInfo/Description for this component is simple:

struct SetupInfo {
    unsigned int capacity; // The amount of parameters that are going to be used at first
};

This leads to the setup in general being primitive, as all that's needed is to provide the amount of parameters that are gonna be stored at first.

app_cmn::rfl::GOCRflParameter::SetupInfo gocRflParamDesc{}; // Initialize the SetupInfo/Description struct

gocRflParamDesc.capacity = 6; // Specify the amount of parameters that are gonna be used at first

gocRflParam->Setup(gocRflParamDesc); // This sets up the GOComponent for proper usage

Afterwards, you are able to add your Reflection parameters.

hh::fnd::ResReflection* myRefl; // Get or create your Reflection info

gocRflParam->SetParameter(myRefl, 0); // Set the Reflection info to an index, that is then going to be used to access the parameter

To get the Reflection parameters.

MyReflStruct* myRefl = gocRflParam->GetParameter<MyReflStruct>(0); // Get the parameter at index 0 as MyReflStruct