Cavestory Mod API
|
An interface for the 'PXMOD' file format. More...
#include <ModConfigResource.h>
Public Member Functions | |
ModConfigResource () | |
Constructor. | |
~ModConfigResource () | |
Deconstructor. | |
bool | CreateMod (const char *pModPath, bool bAutoScan=true, const char *pModTitle="My Mod", const char *pModAuthor="Me", PXMOD_VERSION_STRUCT pVersion=PXMOD_VERSION_STRUCT(), bool bUseDefaultAssets=false) |
Create a mod out of a data path. More... | |
bool | Load (const char *pModPath, bool bOnlyValidate=false, bool bForceRelease=false, bool bShowError=true) |
Load a mod from a file on the disc. More... | |
bool | Save (bool bRelease=false) |
Save the mod. More... | |
bool | CreateFromMod (const char *pModPath) |
Create a pxmod file from external formats. More... | |
void | Reset () |
Clear & free all buffers. | |
void | SetTitle (const char *title) |
Set the title of the mod. More... | |
void | SetAuthor (const char *author) |
Set the author of the mod. More... | |
void | SetVersion (const PXMOD_VERSION_STRUCT &pNewVersion) |
Set the version of the mod. More... | |
const char * | GetTitle () |
Get the title of the mod. More... | |
const char * | GetInternalName () |
Get the mod's path name. More... | |
const char * | GetAuthor () |
Get the author of the mod. More... | |
PXMOD_VERSION_STRUCT | GetVersion () |
Get the version of the mod. More... | |
int | AddBackground (const char *pFileName) |
Add a background. More... | |
bool | RemoveBackground (const char *pFileName) |
Remove a background. More... | |
int | FindBackground (const char *pFileName) |
Find the index of a background. More... | |
int | AddTileset (const char *pFileName) |
Add a tileset. More... | |
bool | RemoveTileset (const char *pFileName) |
Remove a tileset. More... | |
int | FindTileset (const char *pFileName) |
Find the index of a tileset. More... | |
int | AddSpritesheet (const char *pFileName) |
Add a spritesheet. More... | |
bool | RemoveSpritesheet (const char *pFileName) |
Remove a spritesheet. More... | |
int | FindSpritesheet (const char *pFileName) |
Find the index of a spritesheet. More... | |
int | AddStage (const char *pFileName, const char *pMapName, const char *pTileset, const char *pNpcSheet, const char *pBossSheet, const char *pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType, unsigned int iInsertIndex=0xFFFFFFFF) |
Add a stage. More... | |
int | SetStage (int iIndex, const char *pFileName, const char *pMapName, const char *pTileset, const char *pNpcSheet, const char *pBossSheet, const char *pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType) |
Set a stage at an index. More... | |
bool | RemoveStage (const char *pFileName) |
Remove a stage. More... | |
int | FindStage (const char *pFileName) |
Find the index of a stage. More... | |
int | AddArea (const char *pAreaName) |
Add an area. More... | |
bool | RemoveArea (const char *pAreaName) |
Remove an area. More... | |
int | FindArea (const char *pAreaName) |
Find the index of an area. More... | |
int | AddMusic (const char *pMusicName, PXMOD_MUSIC_TYPE eMusicType=PXMOD_MUSIC_TYPE::PXMOD_MUSIC_TYPE_INVALID) |
Add music. More... | |
bool | MoveMusic (const char *pMusicName, bool bMoveUp) |
Move music around in the music list. More... | |
bool | RemoveMusic (const char *pMusicName) |
Remove music. More... | |
int | FindMusic (const char *pMusicName) |
Find the index of music. More... | |
int | AddWeapon (const char *pWeaponName) |
Add a weapon. More... | |
bool | RemoveWeapon (const char *pWeaponName) |
Remove a weapon. More... | |
int | FindWeapon (const char *pWeaponName) |
Find the index of a weapon. More... | |
int | AddBullet (const char *pBulletNmae) |
Add a bullet. More... | |
bool | RemoveBullet (const char *pBulletName) |
Remove a bullet. More... | |
int | FindBullet (const char *pBulletName) |
Find the index of a bullet. More... | |
int | AddNPC (const char *pNpcName) |
Add an NPC. More... | |
bool | RemoveNPC (const char *pNpcName) |
Remove an NPC. More... | |
int | FindNPC (const char *pNpcName) |
Find the index of an NPC. More... | |
int | AddNpcAct (int iNpcIndex, int iActNo, const char *pActName, unsigned long long int iNodeFlags, unsigned long long int iTransmitNodeFlags) |
Add an NPC act. More... | |
bool | RemoveNpcAct (int iNpcIndex, int iActNo) |
Remove an NPC act. More... | |
void | DefaultWeapons () |
Reset weapons for this mod to the default Cavestory weapons. | |
Static Public Member Functions | |
static const PXMOD_NPC_STRUCT * | GetDefaultNpc (int iIndex) |
Get the default NPC for slot iIndex. More... | |
static const PXMOD_WEAPON_STRUCT * | GetDefaultWeapon (int iIndex) |
Get the default weapon for slot iIndex. More... | |
static const PXMOD_WEAPON_STRUCT * | GetDefaultTemplateWeapon (PXMOD_WEAPON_TYPE eType) |
Get default weapon info for a template. More... | |
static const PXMOD_BULLET_STRUCT * | GetDefaultBullet (int iIndex) |
Get the default bullet for slot iIndex. More... | |
Public Attributes | |
char | mModPath [260] |
The path of the mod – This has no trailing slash, and should only contain forward slashes! ex: "H:/CaveStory/MyMod". | |
PXMOD_HEADER_STRUCT | mHeader |
The header for this mod. | |
PXMOD_START_CHUNK | mStart |
Game start chunk. | |
PXMOD_TITLE_CHUNK | mTitle |
Titlescreen intro chunk. | |
PXMOD_BACKGROUND_CHUNK | mBackgrounds |
Stores all the backgrounds. | |
PXMOD_SPRITESHEET_CHUNK | mSpritesheets |
Stores all the spritesheets. | |
PXMOD_TILESET_CHUNK | mTilesets |
Stores all the tilesets. | |
PXMOD_STAGE_CHUNK | mStages |
Stores all the stage information. | |
PXMOD_AREA_CHUNK | mAreas |
Stores all the map area information. More... | |
PXMOD_MUSIC_CHUNK | mMusic |
Stores all the music. | |
PXMOD_WEAPON_CHUNK | mWeapons |
Stores all the weapon information. | |
PXMOD_BULLET_CHUNK | mBullets |
Stores all the bullet information. | |
PXMOD_NPC_CHUNK | mNpcs |
Stores all the NPC information. | |
An interface for the 'PXMOD' file format.
Stores all assets for a mod.
int ModConfigResource::AddArea | ( | const char * | pAreaName | ) |
Add an area.
pAreaName | The name of the new area. |
int ModConfigResource::AddBackground | ( | const char * | pFileName | ) |
Add a background.
pFileName | The background's file name. ex: "Green" will be expanded to "{data path}/bkGreen.png". |
int ModConfigResource::AddBullet | ( | const char * | pBulletNmae | ) |
Add a bullet.
pBulletName | The name of the bullet. Not kept in release build. |
int ModConfigResource::AddMusic | ( | const char * | pMusicName, |
PXMOD_MUSIC_TYPE | eMusicType = PXMOD_MUSIC_TYPE::PXMOD_MUSIC_TYPE_INVALID |
||
) |
Add music.
pMusicName | The name of the music to add. |
pMusicType | The type of music we're adding. |
int ModConfigResource::AddNPC | ( | const char * | pNpcName | ) |
Add an NPC.
pNpcName | The name of the NPC. Not kept in release build. |
int ModConfigResource::AddNpcAct | ( | int | iNpcIndex, |
int | iActNo, | ||
const char * | pActName, | ||
unsigned long long int | iNodeFlags, | ||
unsigned long long int | iTransmitNodeFlags | ||
) |
Add an NPC act.
iNpcIndex | The index of the NPC. |
iActNo | The act number. |
pActName | The name of the act. |
iNodeFlags | The node flags to use in this act. |
iTransmitNodeFlags | The transmitnode flags to use in this act. |
int ModConfigResource::AddSpritesheet | ( | const char * | pFileName | ) |
Add a spritesheet.
pFileName | The spritesheet's file name. ex: "Press" will be expanded to "{data path}/Npc/NpcPress.png". |
int ModConfigResource::AddStage | ( | const char * | pFileName, |
const char * | pMapName, | ||
const char * | pTileset, | ||
const char * | pNpcSheet, | ||
const char * | pBossSheet, | ||
const char * | pBackground, | ||
PXMOD_BK_TYPE | iBkType, | ||
PXMOD_BOSS_TYPE | iBossType, | ||
unsigned int | iInsertIndex = 0xFFFFFFFF |
||
) |
Add a stage.
pFileName | The map's file name. ex: "Mimi" |
pMapName | The actual string map name. |
pTileset | The tileset to use for this stage. |
pNpcSheet | The NPC spritesheet for this stage. |
pBossSheet | The boss spritesheet for this stage. |
iBkType | The background type for this stage. |
iBossType | The boss type for this stage. |
iInsertIndex | The index at which the stage should be inserted into the stage list. |
int ModConfigResource::AddTileset | ( | const char * | pFileName | ) |
Add a tileset.
pFileName | The tileset's file name. ex: "Cave" will be expanded to "{data path}/Stage/PrtCave.png". |
int ModConfigResource::AddWeapon | ( | const char * | pWeaponName | ) |
Add a weapon.
pWeaponName | The name of the weapon. |
bool ModConfigResource::CreateFromMod | ( | const char * | pModPath | ) |
Create a pxmod file from external formats.
bool ModConfigResource::CreateMod | ( | const char * | pModPath, |
bool | bAutoScan = true , |
||
const char * | pModTitle = "My Mod" , |
||
const char * | pModAuthor = "Me" , |
||
PXMOD_VERSION_STRUCT | pVersion = PXMOD_VERSION_STRUCT() , |
||
bool | bUseDefaultAssets = false |
||
) |
Create a mod out of a data path.
pModPath | The mod path |
bAutoScan | Scan the mod path for assets |
pModTitle | The title of the mod |
pModAuthor | The author of the mod |
pVersion | The version of the mod |
bUseDefaultAssets | Use vanilla Cavestory assets |
int ModConfigResource::FindArea | ( | const char * | pAreaName | ) |
Find the index of an area.
pAreaName | The name of the area to find. |
int ModConfigResource::FindBackground | ( | const char * | pFileName | ) |
Find the index of a background.
pFileName | The background's file name. ex: "Green" will be expanded to "{data path}/bkGreen.png". |
int ModConfigResource::FindBullet | ( | const char * | pBulletName | ) |
Find the index of a bullet.
pBulletName | The name of the bullet to find. |
int ModConfigResource::FindMusic | ( | const char * | pMusicName | ) |
Find the index of music.
pMusicName | The name of the music to find. |
int ModConfigResource::FindNPC | ( | const char * | pNpcName | ) |
Find the index of an NPC.
pNpcName | The name of the NPC to find. |
int ModConfigResource::FindSpritesheet | ( | const char * | pFileName | ) |
Find the index of a spritesheet.
pFileName | The spritesheet's file name. ex: "Press" will be expanded to "{data path}/Npc/NpcPress.png". |
int ModConfigResource::FindStage | ( | const char * | pFileName | ) |
Find the index of a stage.
pFileName | The stage's file name. ex: "Mimi" |
int ModConfigResource::FindTileset | ( | const char * | pFileName | ) |
Find the index of a tileset.
pFileName | The tileset's file name. ex: "Cave" will be expanded to "{data path}/Stage/PrtCave.png". |
int ModConfigResource::FindWeapon | ( | const char * | pWeaponName | ) |
Find the index of a weapon.
pWeaponName | The name of the weapon to find. |
|
inline |
Get the author of the mod.
|
static |
Get the default bullet for slot iIndex.
Returns NULL if iIndex is out of range.
iIndex | The index of the bullet slot. |
|
static |
Get the default NPC for slot iIndex.
Returns NULL if iIndex is out of range.
iIndex | The index of the NPC slot. |
|
static |
Get default weapon info for a template.
eType | The template type. |
|
static |
Get the default weapon for slot iIndex.
Returns NULL if iIndex is out of range.
iIndex | The index of the weapon slot. |
const char* ModConfigResource::GetInternalName | ( | ) |
Get the mod's path name.
|
inline |
Get the title of the mod.
|
inline |
Get the version of the mod.
bool ModConfigResource::Load | ( | const char * | pModPath, |
bool | bOnlyValidate = false , |
||
bool | bForceRelease = false , |
||
bool | bShowError = true |
||
) |
Load a mod from a file on the disc.
pModPath | The path of the mod's data folder. |
bOnlyValidate | If set to true, then this function will only validate if the mod is valid. |
bForceRelease | If this is set to true, then this will load / validate the release version of mods ONLY. If set to false, it will prefer debug-version of PXMODs over release-versions. |
bShowError | Whether to show errors in console or not. |
bool ModConfigResource::MoveMusic | ( | const char * | pMusicName, |
bool | bMoveUp | ||
) |
Move music around in the music list.
pMusicName | The name of the music to move. |
bMoveUp | Whether to move the entry up or down. |
bool ModConfigResource::RemoveArea | ( | const char * | pAreaName | ) |
Remove an area.
pAreaName | The name of the area to delete. |
bool ModConfigResource::RemoveBackground | ( | const char * | pFileName | ) |
Remove a background.
pFileName | The background's file name. ex: "Green" will be expanded to "{data path}/bkGreen.png". |
bool ModConfigResource::RemoveBullet | ( | const char * | pBulletName | ) |
Remove a bullet.
pBulletName | The name of the bullet to delete. |
bool ModConfigResource::RemoveMusic | ( | const char * | pMusicName | ) |
Remove music.
pMusicName | The name of the music to delete. |
bool ModConfigResource::RemoveNPC | ( | const char * | pNpcName | ) |
Remove an NPC.
pNpcName | The name of the NPC to delete. |
bool ModConfigResource::RemoveNpcAct | ( | int | iNpcIndex, |
int | iActNo | ||
) |
Remove an NPC act.
iNpcIndex | The index of the NPC. |
iActNo | The act number. |
bool ModConfigResource::RemoveSpritesheet | ( | const char * | pFileName | ) |
Remove a spritesheet.
pFileName | The spritesheet's file name. ex: "Press" will be expanded to "{data path}/Npc/NpcPress.png". |
bool ModConfigResource::RemoveStage | ( | const char * | pFileName | ) |
Remove a stage.
pFileName | The map's file name. ex: "Mimi" |
bool ModConfigResource::RemoveTileset | ( | const char * | pFileName | ) |
Remove a tileset.
pFileName | The tileset's file name. ex: "Cave" will be expanded to "{data path}/Stage/PrtCave.png". |
bool ModConfigResource::RemoveWeapon | ( | const char * | pWeaponName | ) |
Remove a weapon.
pWeaponName | The name of the weapon to delete. |
bool ModConfigResource::Save | ( | bool | bRelease = false | ) |
Save the mod.
bRelease | Save the mod as 'release'. |
void ModConfigResource::SetAuthor | ( | const char * | author | ) |
Set the author of the mod.
author | The new author of the mod. |
int ModConfigResource::SetStage | ( | int | iIndex, |
const char * | pFileName, | ||
const char * | pMapName, | ||
const char * | pTileset, | ||
const char * | pNpcSheet, | ||
const char * | pBossSheet, | ||
const char * | pBackground, | ||
PXMOD_BK_TYPE | iBkType, | ||
PXMOD_BOSS_TYPE | iBossType | ||
) |
Set a stage at an index.
iIndex | The index of the stage. |
pFileName | The stage's file name. ex: "Mimi" |
pMapName | The actual string stage name. |
pTileset | The tileset to use for this stage. |
pNpcSheet | The NPC spritesheet for this stage. |
pBossSheet | The boss spritesheet for this stage. |
iBkType | The background type for this stage. |
iBossType | The boss type for this stage. |
void ModConfigResource::SetTitle | ( | const char * | title | ) |
Set the title of the mod.
title | The new title of the mod. |
void ModConfigResource::SetVersion | ( | const PXMOD_VERSION_STRUCT & | pNewVersion | ) |
Set the version of the mod.
pNewVersion | The new version of this mod. |
PXMOD_AREA_CHUNK ModConfigResource::mAreas |
Stores all the map area information.
If a map is in an area and the player saves in it & starts a netlobby with that save file selected, then the netlobby stage assigned to the map we saved in's area will be used in the lobby.