Cavestory Mod API
Typedefs | Functions
Hooks

Function Hooking. More...

Typedefs

typedef void(* CSM_HOOK_OnPostDrawFunc) ()
 Called after the game is finished drawing gameplay elements to the screen, but before it draws GUI elements (excluding HUD).
 
typedef void(* CSM_HOOK_OnDrawHUDFunc) (BOOL bFlash)
 Called after the game is finished drawing everything. More...
 
typedef void(* CSM_HOOK_OnDrawMapBackFunc) ()
 Called before the map's background tiles are rendered.
 
typedef void(* CSM_HOOK_OnDrawMapFrontFunc) ()
 Called before the map's foreground tiles are rendered.
 
typedef void(* CSM_HOOK_OnPreDrawHUDFunc) ()
 Called after all gameplay elements are drawn, but before the HUD is drawn.
 
typedef BOOL(* CSM_HOOK_OnDrawItemFunc) (GUI_RECT pDrawRect, MYCHAR *pMC, ITEM *pItem, int iItemIndex)
 Called when an item is drawn in the inventory menu. More...
 
typedef void(* CSM_HOOK_OnClientDisconnectedFunc) (CaveNet::DataStructures::NetClient *pClient)
 Called before a client is deleted after leaving. More...
 
typedef void(* CSM_HOOK_OnClientConnectedFunc) (CaveNet::DataStructures::NetClient *pClient)
 Called when a client has connected to the server. More...
 
typedef void(* CSM_HOOK_OnClientSpawnFunc) (CaveNet::DataStructures::NetClient *pClient)
 Called every time a client spawns. More...
 
typedef BOOL(* CSM_HOOK_OnGetTeamSpawnPointFunc) (CaveNet::DataStructures::NetTeam *pTeam, int *pSpawnX, int *pSpawnY)
 Called every time a team tries to find a valid player spawn point. More...
 
typedef void(* CSM_HOOK_OnClientDieFunc) (CaveNet::DataStructures::NetClient *pClient, PlayerDeathType iDeathType, NPCHAR *pKillerNpc, CaveNet::DataStructures::NetClient *pKillerClient)
 Called every time a client dies. More...
 
typedef void(* CSM_HOOK_OnClientReviveFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pSavior)
 Called every time a client is revived. More...
 
typedef void(* CSM_HOOK_OnStageChangeFunc) (const char *pStageName, int iAreaIndex)
 Called every time the stage changes. More...
 
typedef BOOL(* CSM_HOOK_OnPlayerPickupHeartFunc) (NPCHAR *pHeart, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iHealth)
 Called every time a player picks up a heart. More...
 
typedef BOOL(* CSM_HOOK_OnPlayerPickupMissileFunc) (NPCHAR *pMissile, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iAmmo)
 Called every time a player picks up a missile. More...
 
typedef BOOL(* CSM_HOOK_OnPlayerPickupExperienceFunc) (NPCHAR *pExp, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iExp)
 Called every time a player picks up experience. More...
 
typedef void(* CSM_HOOK_OnServerTickFunc) ()
 Called every time the server ticks.
 
typedef void(* CSM_HOOK_OnClientTickFunc) ()
 Called every time the client ticks.
 
typedef void(* CSM_HOOK_OnTeamAddMemberFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)
 Called when a client is added to a team. More...
 
typedef void(* CSM_HOOK_OnTeamRemoveMemberFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)
 Called when a client is removed from a team. More...
 
typedef void(* CSM_HOOK_OnPlayerPickupNpcFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, MYCHAR *pMC, NPCHAR *pNpc)
 Called when an NPCHAR with a whitelisted code_char can be picked up by the player. More...
 
typedef BOOL(* CSM_HOOK_OnHitBulletMapFunc) (BULLET *pBullet)
 Called when a bullet is tested for collision against the map. More...
 
typedef BOOL(* CSM_HOOK_OnHitMyCharNpCharFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)
 Called when a player is being checked for collision with NPCs. More...
 
typedef BOOL(* CSM_HOOK_OnMyCharCollisionTest_NpChar) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, NPCHAR *pNpc, BOOL bNoclip, BOOL &bCallAgain)
 Called when a player needs to test collision against a whitelisted NPC. More...
 
typedef BOOL(* CSM_HOOK_OnHitMyCharMapTileFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iTileX, int iTileY, int iTileAttrib, bool bNoclip)
 Called when a player is being checked for map collision against a specific map tile. More...
 
typedef BOOL(* CSM_HOOK_OnHitMyCharMapFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)
 Called when a player is being checked for map collision. More...
 
typedef void(* CSM_HOOK_OnProcessAIFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, CaveNet::DataStructures::NetTeam *pTeam)
 Called when an AI-controlled player is thinking. More...
 
typedef BOOL(* CSM_HOOK_OnMessageSentFunc) (CaveNet::DataStructures::NetClient *pClient, const char *pMessage)
 Called when a client says something. More...
 
typedef void(* CSM_HOOK_OnReceiveUserCmdFromClientFunc) (CaveNet::DataStructures::NetClient *pClient, int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)
 Called when a mod user command is received from a client. More...
 
typedef void(* CSM_HOOK_OnReceiveUserCmdFromServerFunc) (int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)
 Called when a mod user command is received from the server we're connected to. More...
 

Functions

CAVESTORY_MOD_API void CSM_SetHook_OnPostDraw (CSM_HOOK_OnPostDrawFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnDrawHUD (CSM_HOOK_OnDrawHUDFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapBack (CSM_HOOK_OnDrawMapBackFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapFront (CSM_HOOK_OnDrawMapFrontFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnPreDrawHUD (CSM_HOOK_OnPreDrawHUDFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnDrawItem (CSM_HOOK_OnDrawItemFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientDisconnected (CSM_HOOK_OnClientDisconnectedFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientConnected (CSM_HOOK_OnClientConnectedFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientSpawn (CSM_HOOK_OnClientSpawnFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnGetTeamSpawnPoint (CSM_HOOK_OnGetTeamSpawnPointFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientDie (CSM_HOOK_OnClientDieFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientRevive (CSM_HOOK_OnClientReviveFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnStageChange (CSM_HOOK_OnStageChangeFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupHeart (CSM_HOOK_OnPlayerPickupHeartFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupMissile (CSM_HOOK_OnPlayerPickupMissileFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupExperience (CSM_HOOK_OnPlayerPickupExperienceFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnServerTick (CSM_HOOK_OnServerTickFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnClientTick (CSM_HOOK_OnClientTickFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnTeamAddMember (CSM_HOOK_OnTeamAddMemberFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnTeamRemoveMember (CSM_HOOK_OnTeamRemoveMemberFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupNpc (CSM_HOOK_OnPlayerPickupNpcFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetNpcCodeCharWhitelisted (int iCodeChar, bool bWhitelisted)
 Set whether a specific code_char is whitelisted or not. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnHitBulletMap (CSM_HOOK_OnHitBulletMapFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharNpChar (CSM_HOOK_OnHitMyCharNpCharFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnMyCharCollisionTest_NpChar (int iNpcId, CSM_HOOK_OnMyCharCollisionTest_NpChar pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMapTile (CSM_HOOK_OnHitMyCharMapTileFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMap (CSM_HOOK_OnHitMyCharMapFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnProcessAI (CSM_HOOK_OnProcessAIFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnMessageSent (CSM_HOOK_OnMessageSentFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromClient (CSM_HOOK_OnReceiveUserCmdFromClientFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 
CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromServer (CSM_HOOK_OnReceiveUserCmdFromServerFunc pFuncPtr)
 Hook up a function to make custom code run during a game event. More...
 

Detailed Description

Function Hooking.

Helps modders execute their code in-line with the game's normal executing code.

Typedef Documentation

◆ CSM_HOOK_OnClientConnectedFunc

typedef void(* CSM_HOOK_OnClientConnectedFunc) (CaveNet::DataStructures::NetClient *pClient)

Called when a client has connected to the server.

Parameters
pClientThe client that has connected.
Note
This only works when hosting a server.

◆ CSM_HOOK_OnClientDieFunc

typedef void(* CSM_HOOK_OnClientDieFunc) (CaveNet::DataStructures::NetClient *pClient, PlayerDeathType iDeathType, NPCHAR *pKillerNpc, CaveNet::DataStructures::NetClient *pKillerClient)

Called every time a client dies.

Parameters
pClientThe client that has connected. This is always NULL in singleplayer.
iDeathTypeSpecifies how the client died.
pKillerNpcIf iDeathType == PlayerDeathTypes::DEATHTYPE_KILLED_BY_NPC, then this will be equal to the NPC that killed us. Otherwise will be NULL.
pKillerClientIf iDeathType == PlayerDeathTypes::DEATHTYPE_KILLED_BY_PLAYER, then this will be equal to the client that killed us. Otherwise will be NULL.
Note
This only works when hosting a server OR if you're in singleplayer mode.

◆ CSM_HOOK_OnClientDisconnectedFunc

typedef void(* CSM_HOOK_OnClientDisconnectedFunc) (CaveNet::DataStructures::NetClient *pClient)

Called before a client is deleted after leaving.

Parameters
pClientThe client that is disconnecting.
Note
This only works when hosting a server.

◆ CSM_HOOK_OnClientReviveFunc

typedef void(* CSM_HOOK_OnClientReviveFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pSavior)

Called every time a client is revived.

Parameters
pClientThe client that was revived.
pSaviorThe client that saved pClient. Can be NULL for instances like reviving them through the player list.
Note
This only works when hosting a server.

◆ CSM_HOOK_OnClientSpawnFunc

typedef void(* CSM_HOOK_OnClientSpawnFunc) (CaveNet::DataStructures::NetClient *pClient)

Called every time a client spawns.

Parameters
pClientThe client that has connected.
Note
This only works when hosting a server.

◆ CSM_HOOK_OnDrawHUDFunc

typedef void(* CSM_HOOK_OnDrawHUDFunc) (BOOL bFlash)

Called after the game is finished drawing everything.

Parameters
bFlashWhether the HUD should flash or not.

◆ CSM_HOOK_OnDrawItemFunc

typedef BOOL(* CSM_HOOK_OnDrawItemFunc) (GUI_RECT pDrawRect, MYCHAR *pMC, ITEM *pItem, int iItemIndex)

Called when an item is drawn in the inventory menu.

Parameters
pDrawRectThe draw rect.
pMCThe actual player character who owns this.
pItemThe item's slot info.
iItemIndexThe item's index number.
Returns
Should return TRUE if the item should be drawn normally, or FALSE if the item shouldn't be drawn normally. This allows this callback to draw the item in a custom way.

◆ CSM_HOOK_OnGetTeamSpawnPointFunc

typedef BOOL(* CSM_HOOK_OnGetTeamSpawnPointFunc) (CaveNet::DataStructures::NetTeam *pTeam, int *pSpawnX, int *pSpawnY)

Called every time a team tries to find a valid player spawn point.

Parameters
pTeamThe team requesting the spawn point.
pSpawnXThe X spawn position (subpixel).
pSpawnYThe Y spawn position (subpixel).
Returns
Should return TRUE if the pOutX and pOutY buffers should be used instead of finding a different spawn point.
Note
This only works when hosting a server.

◆ CSM_HOOK_OnHitBulletMapFunc

typedef BOOL(* CSM_HOOK_OnHitBulletMapFunc) (BULLET *pBullet)

Called when a bullet is tested for collision against the map.

Parameters
pBulletThe bullet object being tested.
Returns
Should return FALSE if the normal collision check should be run, otherwise return FALSE to skip it.

◆ CSM_HOOK_OnHitMyCharMapFunc

typedef BOOL(* CSM_HOOK_OnHitMyCharMapFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)

Called when a player is being checked for map collision.

Parameters
pClientThe client being tested. If this is 'NULL', then we are testing the singleplayer character.
pMCThe player object being tested. This will never be NULL.
bNoclipWhether the player is using noclip or not.
Returns
Should return FALSE if the normal collision check should be run, otherwise return FALSE to skip it.

◆ CSM_HOOK_OnHitMyCharMapTileFunc

typedef BOOL(* CSM_HOOK_OnHitMyCharMapTileFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iTileX, int iTileY, int iTileAttrib, bool bNoclip)

Called when a player is being checked for map collision against a specific map tile.

Parameters
pClientThe client being tested. If this is 'NULL', then we are testing the singleplayer character.
pMCThe player object being tested. This will never be NULL.
iTileXThe tile's X position.
iTileYThe tile's Y position.
iTileAttribThe attribute of the tile.
bNoclipWhether the player is using noclip or not.
Returns
Should return FALSE if the normal collision check should be run, otherwise return FALSE to skip it.

◆ CSM_HOOK_OnHitMyCharNpCharFunc

typedef BOOL(* CSM_HOOK_OnHitMyCharNpCharFunc) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)

Called when a player is being checked for collision with NPCs.

Parameters
pClientThe client being tested. If this is 'NULL', then we are testing the singleplayer character.
pPlayerThe player object being tested. This will never be NULL.
bNoclipWhether the player is using noclip or not.
Returns
Should return FALSE if the normal collision check should be run, otherwise return FALSE to skip it.

◆ CSM_HOOK_OnMessageSentFunc

typedef BOOL(* CSM_HOOK_OnMessageSentFunc) (CaveNet::DataStructures::NetClient *pClient, const char *pMessage)

Called when a client says something.

Parameters
pClientThe client.
pMessageThe message sent.
Returns
Should return TRUE if the message should be broadcasted to everyone. Returning FALSE will silence the message.
Note
This is obviously only called server-side.

◆ CSM_HOOK_OnMyCharCollisionTest_NpChar

typedef BOOL(* CSM_HOOK_OnMyCharCollisionTest_NpChar) (CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, NPCHAR *pNpc, BOOL bNoclip, BOOL &bCallAgain)

Called when a player needs to test collision against a whitelisted NPC.

Parameters
pClientThe client being tested. If this is 'NULL', then we are testing the singleplayer character.
pPlayerThe player object being tested. This will never be NULL.
pNpcThe NPC being tested against. This will never be NULL.
bNoclipWhether the player is using noclip or not.
bCallAgainIf this is set to TRUE in the function, then this will be called AFTER main collision is calculated. This is only possible once every frame.
Returns
Should return FALSE if the normal collision check should be run, otherwise return FALSE to skip it.

◆ CSM_HOOK_OnPlayerPickupExperienceFunc

typedef BOOL(* CSM_HOOK_OnPlayerPickupExperienceFunc) (NPCHAR *pExp, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iExp)

Called every time a player picks up experience.

Parameters
pExpA pointer to the experience NPC.
pClientThe owner of the character. NULL signifies a singleplayer client.
pMCA pointer to the player object that should get the ammo.
iExpThe amount of ammo to add.
Returns
Should return TRUE if we should add the experience normally.

◆ CSM_HOOK_OnPlayerPickupHeartFunc

typedef BOOL(* CSM_HOOK_OnPlayerPickupHeartFunc) (NPCHAR *pHeart, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iHealth)

Called every time a player picks up a heart.

Parameters
pHeartA pointer to the heart NPC.
pClientThe owner of the character. NULL signifies a singleplayer client.
pMCA pointer to the player object that should get the health.
iHealthThe amount of health to give.
Returns
Should return TRUE if we should add the health normally.

◆ CSM_HOOK_OnPlayerPickupMissileFunc

typedef BOOL(* CSM_HOOK_OnPlayerPickupMissileFunc) (NPCHAR *pMissile, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iAmmo)

Called every time a player picks up a missile.

Parameters
pMissileA pointer to the ammo NPC.
pClientThe owner of the character. NULL signifies a singleplayer client.
pMCA pointer to the player object that should get the ammo.
iAmmoThe amount of ammo to add.
Returns
Should return TRUE if we should add the ammo normally.

◆ CSM_HOOK_OnPlayerPickupNpcFunc

typedef void(* CSM_HOOK_OnPlayerPickupNpcFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, MYCHAR *pMC, NPCHAR *pNpc)

Called when an NPCHAR with a whitelisted code_char can be picked up by the player.

Parameters
pClientThe client being tested. If this is 'NULL', then we are testing the singleplayer character.
pPlayerThe player being tested. If this is 'NULL', then we are testing the singleplayer character.
pMCThe MYCHAR* object being tested.
pNpcThe NPCHAR* object being tested for.

◆ CSM_HOOK_OnProcessAIFunc

typedef void(* CSM_HOOK_OnProcessAIFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, CaveNet::DataStructures::NetTeam *pTeam)

Called when an AI-controlled player is thinking.

Parameters
pClientThe AI's client.
pPlayerThe AI's player.
pTeamThe AI's team.
Note
This is obviously only called server-side.

◆ CSM_HOOK_OnReceiveUserCmdFromClientFunc

typedef void(* CSM_HOOK_OnReceiveUserCmdFromClientFunc) (CaveNet::DataStructures::NetClient *pClient, int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)

Called when a mod user command is received from a client.

Parameters
pClientThe client we received this command from.
iArg1An optional parameter.
iArg2An optional parameter.
iArg3An optional parameter.
iArg4An optional parameter.
iArg5An optional parameter.
iArg6An optional parameter.
pString1An optional parameter.
Note
This is obviously only called server-side.

◆ CSM_HOOK_OnReceiveUserCmdFromServerFunc

typedef void(* CSM_HOOK_OnReceiveUserCmdFromServerFunc) (int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)

Called when a mod user command is received from the server we're connected to.

Parameters
iArg1An optional parameter.
iArg2An optional parameter.
iArg3An optional parameter.
iArg4An optional parameter.
iArg5An optional parameter.
iArg6An optional parameter.
pString1An optional parameter.
Note
This is obviously only called client-side.

◆ CSM_HOOK_OnStageChangeFunc

typedef void(* CSM_HOOK_OnStageChangeFunc) (const char *pStageName, int iAreaIndex)

Called every time the stage changes.

Parameters
pStageNameThe stage's mapname.
iAreaIndexThe index of the area that the stage is assigned to.

◆ CSM_HOOK_OnTeamAddMemberFunc

typedef void(* CSM_HOOK_OnTeamAddMemberFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)

Called when a client is added to a team.

Parameters
pClientThe client-side client.
pServerClientThe server-side client. This is 'NULL' if we're not the server host.
pTeamThe team accepting the client.

◆ CSM_HOOK_OnTeamRemoveMemberFunc

typedef void(* CSM_HOOK_OnTeamRemoveMemberFunc) (CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)

Called when a client is removed from a team.

Parameters
pClientThe client-side client.
pServerClientThe server-side client. This is 'NULL' if we're not the server host.
pTeamThe team booting the client out.

Function Documentation

◆ CSM_SetHook_OnClientConnected()

CAVESTORY_MOD_API void CSM_SetHook_OnClientConnected ( CSM_HOOK_OnClientConnectedFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnClientDie()

CAVESTORY_MOD_API void CSM_SetHook_OnClientDie ( CSM_HOOK_OnClientDieFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnClientDisconnected()

CAVESTORY_MOD_API void CSM_SetHook_OnClientDisconnected ( CSM_HOOK_OnClientDisconnectedFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnClientRevive()

CAVESTORY_MOD_API void CSM_SetHook_OnClientRevive ( CSM_HOOK_OnClientReviveFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnClientSpawn()

CAVESTORY_MOD_API void CSM_SetHook_OnClientSpawn ( CSM_HOOK_OnClientSpawnFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnClientTick()

CAVESTORY_MOD_API void CSM_SetHook_OnClientTick ( CSM_HOOK_OnClientTickFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnDrawHUD()

CAVESTORY_MOD_API void CSM_SetHook_OnDrawHUD ( CSM_HOOK_OnDrawHUDFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnDrawItem()

CAVESTORY_MOD_API void CSM_SetHook_OnDrawItem ( CSM_HOOK_OnDrawItemFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnDrawMapBack()

CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapBack ( CSM_HOOK_OnDrawMapBackFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnDrawMapFront()

CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapFront ( CSM_HOOK_OnDrawMapFrontFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnGetTeamSpawnPoint()

CAVESTORY_MOD_API void CSM_SetHook_OnGetTeamSpawnPoint ( CSM_HOOK_OnGetTeamSpawnPointFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnHitBulletMap()

CAVESTORY_MOD_API void CSM_SetHook_OnHitBulletMap ( CSM_HOOK_OnHitBulletMapFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnHitMyCharMap()

CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMap ( CSM_HOOK_OnHitMyCharMapFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnHitMyCharMapTile()

CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMapTile ( CSM_HOOK_OnHitMyCharMapTileFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnHitMyCharNpChar()

CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharNpChar ( CSM_HOOK_OnHitMyCharNpCharFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnMessageSent()

CAVESTORY_MOD_API void CSM_SetHook_OnMessageSent ( CSM_HOOK_OnMessageSentFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnMyCharCollisionTest_NpChar()

CAVESTORY_MOD_API void CSM_SetHook_OnMyCharCollisionTest_NpChar ( int  iNpcId,
CSM_HOOK_OnMyCharCollisionTest_NpChar  pFuncPtr 
)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
iNpcIdThe NPC ID to set this function to.
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnPlayerPickupExperience()

CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupExperience ( CSM_HOOK_OnPlayerPickupExperienceFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnPlayerPickupHeart()

CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupHeart ( CSM_HOOK_OnPlayerPickupHeartFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnPlayerPickupMissile()

CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupMissile ( CSM_HOOK_OnPlayerPickupMissileFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnPlayerPickupNpc()

CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupNpc ( CSM_HOOK_OnPlayerPickupNpcFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnPostDraw()

CAVESTORY_MOD_API void CSM_SetHook_OnPostDraw ( CSM_HOOK_OnPostDrawFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.
Examples
RenderPipeline.cpp.

◆ CSM_SetHook_OnPreDrawHUD()

CAVESTORY_MOD_API void CSM_SetHook_OnPreDrawHUD ( CSM_HOOK_OnPreDrawHUDFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnProcessAI()

CAVESTORY_MOD_API void CSM_SetHook_OnProcessAI ( CSM_HOOK_OnProcessAIFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnReceiveUserCmdFromClient()

CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromClient ( CSM_HOOK_OnReceiveUserCmdFromClientFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnReceiveUserCmdFromServer()

CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromServer ( CSM_HOOK_OnReceiveUserCmdFromServerFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnServerTick()

CAVESTORY_MOD_API void CSM_SetHook_OnServerTick ( CSM_HOOK_OnServerTickFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnStageChange()

CAVESTORY_MOD_API void CSM_SetHook_OnStageChange ( CSM_HOOK_OnStageChangeFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnTeamAddMember()

CAVESTORY_MOD_API void CSM_SetHook_OnTeamAddMember ( CSM_HOOK_OnTeamAddMemberFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetHook_OnTeamRemoveMember()

CAVESTORY_MOD_API void CSM_SetHook_OnTeamRemoveMember ( CSM_HOOK_OnTeamRemoveMemberFunc  pFuncPtr)

Hook up a function to make custom code run during a game event.

Check out the typedef of the function pointer for further info.

Parameters
pFuncPtrA pointer to the function to call.

◆ CSM_SetNpcCodeCharWhitelisted()

CAVESTORY_MOD_API void CSM_SetNpcCodeCharWhitelisted ( int  iCodeChar,
bool  bWhitelisted 
)

Set whether a specific code_char is whitelisted or not.

When a code_char is whitelisted, then 'OnHitMyCharNpChar' will be called for that specific NPC.

Parameters
iCodeCharThe code character.
bWhitelistedWhether to whitelist this codechar or not.