Jump to content

SADX Mod Loader: Difference between revisions

From SA Docs
Adding initial SADX Mod Loader page + documentation.
 
Updating page, adding Character Welds page link
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
[https://github.com/X-Hax/sadx-mod-loader/ Source Code]
You can view the [https://github.com/X-Hax/sadx-mod-loader/ source code] here.




On this page, you'll find documentation on the main API that the SADX Mod Loader exports to every code based mod created for SADX. There are additional features which are documented on other pages. You can follow the below links to find documentation on those features.
[[SADX Mod Loader/Character Welds|Character Welds]]
= HelperFunctions API =
= HelperFunctions API =


== Struct ==
== Struct ==
Below is the initialized version of the HelperFunctions struct. For the definition of the struct, you can find that in [https://github.com/X-Hax/sadx-mod-loader/blob/master/SADXModLoader/include/SADXModInfo.h SADXModInfo.h]  
Below is the initialized version of the HelperFunctions struct. For the definition of the struct, you can find that in [https://github.com/X-Hax/sadx-mod-loader/blob/master/SADXModLoader/include/SADXModInfo.h SADXModInfo.h]
{{DocHeader|header=HelperFunctions|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
HelperFunctions helperFunctions =
HelperFunctions helperFunctions =
{
{
    ModLoaderVer,
ModLoaderVer,
    &RegisterStartPosition,
&RegisterStartPosition,
    &ClearStartPositionList,
&ClearStartPositionList,
    &RegisterFieldStartPosition,
&RegisterFieldStartPosition,
    &ClearFieldStartPositionList,
&ClearFieldStartPositionList,
    &RegisterPathList,
&RegisterPathList,
    &ClearPathListList,
&ClearPathListList,
    &RegisterCharacterPVM,
&RegisterCharacterPVM,
    &ClearCharacterPVMList,
&ClearCharacterPVMList,
    &RegisterCommonObjectPVM,
&RegisterCommonObjectPVM,
    &ClearCommonObjectPVMList,
&ClearCommonObjectPVMList,
    &RegisterTrialLevel,
&RegisterTrialLevel,
    &ClearTrialLevelList,
&ClearTrialLevelList,
    &RegisterTrialSubgame,
&RegisterTrialSubgame,
    &ClearTrialSubgameList,
&ClearTrialSubgameList,
    &GetMainSavePath,
&GetMainSavePath,
    &GetChaoSavePath,
&GetChaoSavePath,
    &GetReplaceablePath,
&GetReplaceablePath,
    &_ReplaceFile,
&_ReplaceFile,
    &SetWindowTitle,
&SetWindowTitle,
    &RegisterSoundList,
&RegisterSoundList,
    &RegisterMusicFile,
&RegisterMusicFile,
    &LoadEXEData,
&LoadEXEData,
    &LoadDLLData,
&LoadDLLData,
    &_ReplaceFileForce,
&_ReplaceFileForce,
    &PushScaleUI,
&PushScaleUI,
    &PopScaleUI,
&PopScaleUI,
    &SetScaleFillMode,
&SetScaleFillMode,
    &GetScaleFillMode,
&GetScaleFillMode,
    &ReplaceTexture,
&ReplaceTexture,
    &MipmapBlacklistGBIX,
&MipmapBlacklistGBIX,
    &RegisterEnglishVoiceDuration,
&RegisterEnglishVoiceDuration,
    &RegisterJapaneseVoiceDuration,
&RegisterJapaneseVoiceDuration,
    &RegisterCharacterWelds,
&RegisterCharacterWelds,
    &loaderSettings,
&loaderSettings,
    &modList,
&modList,
    &weightFuncs,
&weightFuncs,
    &RegisterVoice,
&RegisterVoice,
    &PushInterpolationFix,
&PushInterpolationFix,
    &PopInterpolationFix,
&PopInterpolationFix,
    &RegisterPermanentTexlist,
&RegisterPermanentTexlist,
    &ExpandPVMList,
&ExpandPVMList,
    &UnreplaceFile,
&UnreplaceFile,
&PrintDebugUnicode,
&PrintDebugLocal,
&PrintDebugCodepage,
&GetFileModIndex,
&ReplaceFileAtIndex
};
};
</syntaxhighlight>
</syntaxhighlight>
}}


{{Note|text=Please be aware that all examples on this page will be using <code>helperFunctions</code> which is how the variable is sent to a mod.|type=info}}
== Properties ==
== Properties ==


Line 63: Line 75:


This returns the version of the mod loader. This can be used to check if the user has an old version of the mod loader that may not have functionality your mod requires.
This returns the version of the mod loader. This can be used to check if the user has an old version of the mod loader that may not have functionality your mod requires.
 
{{DocHeader|header=Example|content=
==== Example ====
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
if (globalHelperFunctions.ModLoaderVer <= 10)
if (helperFunctions.ModLoaderVer <= 10)
        PrintDebug("This Mod Loader is way out of date.\n");
    PrintDebug("This Mod Loader is way out of date.\n");
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Mod Loader Settings ===
=== Mod Loader Settings ===
Line 76: Line 87:
</syntaxhighlight>
</syntaxhighlight>


 
{{DocHeader|header=Example|content=
==== Example ====
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Mod List ===
=== Mod List ===
Line 88: Line 98:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Weight Functions ===
=== Weight Functions ===
Line 99: Line 109:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
 
}}
== Functions ==
== Functions ==


Line 112: Line 122:


Registers a new Start Position for the specified character.
Registers a new Start Position for the specified character.
 
{{DocHeader|header=Example|content=
==== Example ====
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
StartPosition myStageStartPos = {  
StartPosition myStageStartPos = {  
Line 125: Line 134:
// and we have specified Sonic, so the level for this ID would now use
// and we have specified Sonic, so the level for this ID would now use
// our StartPosition instead of the original.
// our StartPosition instead of the original.
globalHelperFunctions.RegisterStartPosition(Characters_Sonic, &myStageStartPos);
helperFunctions.RegisterStartPosition(Characters_Sonic, &myStageStartPos);
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Start Position List ===
=== Clear Start Position List ===
Line 135: Line 144:


Clears the Start Positions for the specified character.  
Clears the Start Positions for the specified character.  
 
{{DocHeader|header=Example|content=
==== Example ====
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
// Running this inside of your mod's Init export would
// Running this inside of your mod's Init export would
// clear all of Sonic's Start Positions for his stages.
// clear all of Sonic's Start Positions for his stages.
globalHelperFunctions.ClearStartPositionList(Characters_Sonic);
helperFunctions.ClearStartPositionList(Characters_Sonic);
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Field Position ===
=== Register Field Position ===
Line 149: Line 157:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Field Start Position List ===
=== Clear Field Start Position List ===
Line 160: Line 168:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Path List ===
=== Register Path List ===
Line 171: Line 179:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Path List List ===
=== Clear Path List List ===
Line 182: Line 190:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Character PVM ===
=== Register Character PVM ===
Line 193: Line 201:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Character PVM List ===
=== Clear Character PVM List ===
Line 204: Line 212:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Common Object PVM ===
=== Register Common Object PVM ===
Line 215: Line 223:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Common Object PVM List ===
=== Clear Common Object PVM List ===
Line 226: Line 234:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Trial Level ===
=== Register Trial Level ===
Line 237: Line 245:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Trial Level List ===
=== Clear Trial Level List ===
Line 248: Line 256:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Trial Subgame ===
=== Register Trial Subgame ===
Line 259: Line 267:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Clear Trial Subgame List ===
=== Clear Trial Subgame List ===
Line 270: Line 278:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Get Main Save Path ===
=== Get Main Save Path ===
Line 281: Line 289:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Get Chao Save Path ===
=== Get Chao Save Path ===
Line 292: Line 300:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Get Replaceable Path ===
=== Get Replaceable Path ===
Line 303: Line 311:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Replace File ===
=== Replace File ===
Line 314: Line 322:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Set Window Title ===
=== Set Window Title ===
Line 325: Line 333:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Sound List ===
=== Register Sound List ===
Line 336: Line 344:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Music File ===
=== Register Music File ===
Line 347: Line 355:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Load EXE Data ===
=== Load EXE Data ===
Line 358: Line 366:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Load DLL Data ===
=== Load DLL Data ===
Line 369: Line 377:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Replace File Force ===
=== Replace File Force ===
Line 380: Line 388:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Push Scale UI ===
=== Push Scale UI ===
Line 391: Line 399:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Pop Scale UI ===
=== Pop Scale UI ===
Line 402: Line 410:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Set Scale Fill Mode ===
=== Set Scale Fill Mode ===
Line 413: Line 421:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Get Scale Fill Mode ===
=== Get Scale Fill Mode ===
Line 424: Line 432:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Replace Texture ===
=== Replace Texture ===
Line 435: Line 443:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Mipmap Blacklist GBIX ===
=== Mipmap Blacklist GBIX ===
Line 446: Line 454:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register English Voice Duration ===
=== Register English Voice Duration ===
Line 457: Line 465:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Japanese Voice Duration ===
=== Register Japanese Voice Duration ===
Line 468: Line 476:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Character Welds ===
=== Register Character Welds ===
Line 479: Line 487:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Voice ===
=== Register Voice ===
Line 490: Line 498:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Push Interpolation Fix ===
=== Push Interpolation Fix ===
Line 501: Line 509:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Pop Interpolation Fix ===
=== Pop Interpolation Fix ===
Line 512: Line 520:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
 
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}


=== Register Permanent Texlist ===
=== Register Permanent Texlist ===
Line 523: Line 531:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}


=== Unreplace File ===
<syntaxhighlight lang="cpp">
void UnreplaceFile(const char* file)
</syntaxhighlight>
</syntaxhighlight>
<hr>
 
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}
 
=== Expand PVM List ===
<syntaxhighlight lang="cpp">
TEX_PVMTABLE* ExpandPVMList(TEX_PVMTABLE* sourcepvmlist, const TEX_PVMTABLE &newpvmentry)
</syntaxhighlight>
 
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}


=== Unreplace File ===
=== Unreplace File ===
Line 534: Line 564:
</syntaxhighlight>
</syntaxhighlight>


==== Example ====
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}


=== Print Debug Unicode ===
<syntaxhighlight lang="cpp">
void PrintDebugUnicode(char* utf8)
</syntaxhighlight>
</syntaxhighlight>
<hr>


=== Expand PVM List ===
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}
 
=== Print Debug Local ===
<syntaxhighlight lang="cpp">
void PrintDebugLocal(char* buf)
</syntaxhighlight>
 
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}
 
=== Print Debug Codepage ===
<syntaxhighlight lang="cpp">
void PrintDebugCodepage(char* buf, unsigned int source_cp)
</syntaxhighlight>
 
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
}}
 
=== Get File Mod Index ===
<syntaxhighlight lang="cpp">
int GetFileModIndex(const char* path)
</syntaxhighlight>
 
{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
TEX_PVMTABLE* ExpandPVMList(TEX_PVMTABLE* sourcepvmlist, const TEX_PVMTABLE &newpvmentry)
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
}}


==== Example ====
=== Replace File At Index ===
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
void ReplaceFileAtIndex(const char* src, const char* dst, int modIndex)
</syntaxhighlight>


{{DocHeader|header=Example|content=
<syntaxhighlight lang="cpp">
// TODO: Write example.
</syntaxhighlight>
</syntaxhighlight>
<hr>
}}

Latest revision as of 00:29, 24 August 2026

You can view the source code here.


On this page, you'll find documentation on the main API that the SADX Mod Loader exports to every code based mod created for SADX. There are additional features which are documented on other pages. You can follow the below links to find documentation on those features.

Character Welds

HelperFunctions API

Struct

Below is the initialized version of the HelperFunctions struct. For the definition of the struct, you can find that in SADXModInfo.h

HelperFunctions

HelperFunctions helperFunctions =
{
	ModLoaderVer,
	&RegisterStartPosition,
	&ClearStartPositionList,
	&RegisterFieldStartPosition,
	&ClearFieldStartPositionList,
	&RegisterPathList,
	&ClearPathListList,
	&RegisterCharacterPVM,
	&ClearCharacterPVMList,
	&RegisterCommonObjectPVM,
	&ClearCommonObjectPVMList,
	&RegisterTrialLevel,
	&ClearTrialLevelList,
	&RegisterTrialSubgame,
	&ClearTrialSubgameList,
	&GetMainSavePath,
	&GetChaoSavePath,
	&GetReplaceablePath,
	&_ReplaceFile,
	&SetWindowTitle,
	&RegisterSoundList,
	&RegisterMusicFile,
	&LoadEXEData,
	&LoadDLLData,
	&_ReplaceFileForce,
	&PushScaleUI,
	&PopScaleUI,
	&SetScaleFillMode,
	&GetScaleFillMode,
	&ReplaceTexture,
	&MipmapBlacklistGBIX,
	&RegisterEnglishVoiceDuration,
	&RegisterJapaneseVoiceDuration,
	&RegisterCharacterWelds,
	&loaderSettings,
	&modList,
	&weightFuncs,
	&RegisterVoice,
	&PushInterpolationFix,
	&PopInterpolationFix,
	&RegisterPermanentTexlist,
	&ExpandPVMList,
	&UnreplaceFile,
	&PrintDebugUnicode,
	&PrintDebugLocal,
	&PrintDebugCodepage,
	&GetFileModIndex,
	&ReplaceFileAtIndex
};


  Please be aware that all examples on this page will be using helperFunctions which is how the variable is sent to a mod.

Properties

Mod Loader Version

int ModLoaderVer;

This returns the version of the mod loader. This can be used to check if the user has an old version of the mod loader that may not have functionality your mod requires.

Example

if (helperFunctions.ModLoaderVer <= 10)
    PrintDebug("This Mod Loader is way out of date.\n");


Mod Loader Settings

LoaderSettings loaderSettings;


Example

// TODO: Write example.


Mod List

std::vector<Mod> modlist;


Example

// TODO: Write example.


Weight Functions

BasicWeightFuncs weightFuncs;


Example

// TODO: Write example.

Functions

Register Start Position

static void RegisterStartPosition(unsigned char character, const StartPosition& position)

Registers a new Start Position for the specified character.

Example

StartPosition myStageStartPos = { 
    1,                          // Level ID 
    0,                          // Act ID
    { 100.0f, 200.0f, 100.0f }, // Position
    0                           // Y Rotation
};

// We pass our StagePosition variable as a pointer to this function
// and we have specified Sonic, so the level for this ID would now use
// our StartPosition instead of the original.
helperFunctions.RegisterStartPosition(Characters_Sonic, &myStageStartPos);


Clear Start Position List

static void ClearStartPositionList(unsigned char character)

Clears the Start Positions for the specified character.

Example

// Running this inside of your mod's Init export would
// clear all of Sonic's Start Positions for his stages.
helperFunctions.ClearStartPositionList(Characters_Sonic);


Register Field Position

static void RegisterFieldStartPosition(unsigned char character, const FieldStartPosition& position)


Example

// TODO: Write example.


Clear Field Start Position List

static void ClearFieldStartPositionList(unsigned char character)


Example

// TODO: Write example.


Register Path List

static void RegisterPathList(const PathDataPtr& paths)


Example

// TODO: Write example.


Clear Path List List

static void ClearPathListList()


Example

// TODO: Write example.


Register Character PVM

static void RegisterCharacterPVM(unsigned char character, const PVMEntry& pvm)


Example

// TODO: Write example.


Clear Character PVM List

static void ClearCharacterPVMList(unsigned char character)


Example

// TODO: Write example.


Register Common Object PVM

static void RegisterCommonObjectPVM(const PVMEntry& pvm)


Example

// TODO: Write example.


Clear Common Object PVM List

static void ClearCommonObjectPVMList()


Example

// TODO: Write example.


Register Trial Level

static void RegisterTrialLevel(unsigned char character, const TrialLevelListEntry& level)


Example

// TODO: Write example.


Clear Trial Level List

static void ClearTrialLevelList(unsigned char character)


Example

// TODO: Write example.


Register Trial Subgame

static void RegisterTrialSubgame(unsigned char character, const TrialLevelListEntry& level)


Example

// TODO: Write example.


Clear Trial Subgame List

static void ClearTrialSubgameList(unsigned char character)


Example

// TODO: Write example.


Get Main Save Path

static const char* GetMainSavePath()


Example

// TODO: Write example.


Get Chao Save Path

static const char* GetChaoSavePath()


Example

// TODO: Write example.


Get Replaceable Path

const char* __cdecl GetReplaceablePath(const char* path)


Example

// TODO: Write example.


Replace File

void _ReplaceFile(const char* src, const char* dst)


Example

// TODO: Write example.


Set Window Title

void SetWindowTitle(const char* title)


Example

// TODO: Write example.


Register Sound List

int RegisterSoundList(const SoundList& list)


Example

// TODO: Write example.


Register Music File

int RegisterMusicFile(const MusicInfo& track)


Example

// TODO: Write example.


Load EXE Data

void LoadEXEData(const wchar_t* filename, const wchar_t* mod_dir)


Example

// TODO: Write example.


Load DLL Data

void LoadDLLData(const wchar_t* filename, const wchar_t* mod_dir)


Example

// TODO: Write example.


Replace File Force

void _ReplaceFileForce(const char* src, const char* dst)


Example

// TODO: Write example.


Push Scale UI

void PushScaleUI(uiscale::Align align, bool is_background, float ratio_h, float ratio_v)


Example

// TODO: Write example.


Pop Scale UI

void PopScaleUI()


Example

// TODO: Write example.


Set Scale Fill Mode

void SetScaleFillMode(uiscale::FillMode mode)


Example

// TODO: Write example.


Get Scale Fill Mode

uiscale::FillMode GetScaleFillMode()


Example

// TODO: Write example.


Replace Texture

void ReplaceTexture(const char* pvm_name, const char* tex_name, const char* file_path, uint32_t gbix, uint32_t width, uint32_t height)


Example

// TODO: Write example.


Mipmap Blacklist GBIX

void MipmapBlacklistGBIX(Uint32 index)


Example

// TODO: Write example.


Register English Voice Duration

void RegisterEnglishVoiceDuration(const uint16_t voiceID, const uint16_t duration)


Example

// TODO: Write example.


Register Japanese Voice Duration

void RegisterJapaneseVoiceDuration(const uint16_t voiceID, const uint16_t duration)


Example

// TODO: Write example.


Register Character Welds

void RegisterCharacterWelds(const uint8_t character, const char* iniPath)


Example

// TODO: Write example.


Register Voice

uint16_t RegisterVoice(const char* fileJP, const char* fileEN, uint16_t durationJP, uint16_t durationEN)


Example

// TODO: Write example.


Push Interpolation Fix

void PushInterpolationFix()


Example

// TODO: Write example.


Pop Interpolation Fix

void PopInterpolationFix()


Example

// TODO: Write example.


Register Permanent Texlist

void RegisterPermanentTexlist(NJS_TEXLIST* texlist)


Example

// TODO: Write example.


Unreplace File

void UnreplaceFile(const char* file)


Example

// TODO: Write example.


Expand PVM List

TEX_PVMTABLE* ExpandPVMList(TEX_PVMTABLE* sourcepvmlist, const TEX_PVMTABLE &newpvmentry)


Example

// TODO: Write example.


Unreplace File

void UnreplaceFile(const char* file)


Example

// TODO: Write example.


void PrintDebugUnicode(char* utf8)


Example

// TODO: Write example.


void PrintDebugLocal(char* buf)


Example

// TODO: Write example.


void PrintDebugCodepage(char* buf, unsigned int source_cp)


Example

// TODO: Write example.


Get File Mod Index

int GetFileModIndex(const char* path)


Example

// TODO: Write example.


Replace File At Index

void ReplaceFileAtIndex(const char* src, const char* dst, int modIndex)


Example

// TODO: Write example.