Skip to content

Commit

Permalink
modloader updates, fun stuff and weapon adjuster things
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Sep 8, 2022
1 parent 4fc664a commit e3f9199
Show file tree
Hide file tree
Showing 68 changed files with 1,473 additions and 203 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ Currently, Manhunt version of modloader doesn't support swapping:
It depends on type, but every mod needs a folder.
Create a folder with any name inside modloader folder.

Modloader comes with a custom DFF loader which allows to load multiple .dff files a
nd append them to the model list.
Modloader comes with a custom DFF loader which allows to load multiple .dff files and append them to the model list.

Some files are ignored from beign loaded, they are specified
in modloader.ini file.
Expand Down
16 changes: 16 additions & 0 deletions source/PluginMH.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@
<ClInclude Include="code\manhunt\Anim.h" />
<ClInclude Include="code\manhunt\AnimID.h" />
<ClInclude Include="code\manhunt\App.h" />
<ClInclude Include="code\manhunt\AudioManager.h" />
<ClInclude Include="code\manhunt\Camera.h" />
<ClInclude Include="code\manhunt\Character.h" />
<ClInclude Include="code\manhunt\Cheats.h" />
<ClInclude Include="code\manhunt\Clump.h" />
<ClInclude Include="code\manhunt\ClumpDict.h" />
<ClInclude Include="code\manhunt\Collectable.h" />
<ClInclude Include="code\manhunt\ColLine.h" />
<ClInclude Include="code\manhunt\ContactInfo.h" />
<ClInclude Include="code\manhunt\core.h" />
<ClInclude Include="code\manhunt\CreationManager.h" />
<ClInclude Include="code\manhunt\Decal.h" />
<ClInclude Include="code\manhunt\DevMenu.h" />
<ClInclude Include="code\manhunt\Entity.h" />
<ClInclude Include="code\manhunt\EntityManager.h" />
Expand All @@ -138,7 +142,9 @@
<ClInclude Include="code\manhunt\Shot.h" />
<ClInclude Include="code\manhunt\SpecialFX.h" />
<ClInclude Include="code\manhunt\String.h" />
<ClInclude Include="code\manhunt\TexDictionary.h" />
<ClInclude Include="code\manhunt\Text.h" />
<ClInclude Include="code\manhunt\TextOverlay.h" />
<ClInclude Include="code\manhunt\Throwable.h" />
<ClInclude Include="code\manhunt\Time.h" />
<ClInclude Include="code\manhunt\TypeData.h" />
Expand All @@ -148,10 +154,12 @@
<ClInclude Include="code\plugin\classes\eCustomPed.h" />
<ClInclude Include="code\plugin\classes\eCustomProjectile.h" />
<ClInclude Include="code\plugin\console\eConsole.h" />
<ClInclude Include="code\plugin\eAchievements.h" />
<ClInclude Include="code\plugin\eCommonHooks.h" />
<ClInclude Include="code\plugin\eCustomAnimManager.h" />
<ClInclude Include="code\plugin\eCustomTableOfContents.h" />
<ClInclude Include="code\plugin\eGUI.h" />
<ClInclude Include="code\plugin\eLaserSights.h" />
<ClInclude Include="code\plugin\eLevelsLoader.h" />
<ClInclude Include="code\plugin\eLog.h" />
<ClInclude Include="code\plugin\eMapLimits.h" />
Expand Down Expand Up @@ -180,12 +188,15 @@
<ClCompile Include="code\manhunt\AmmoWeapon.cpp" />
<ClCompile Include="code\manhunt\Anim.cpp" />
<ClCompile Include="code\manhunt\App.cpp" />
<ClCompile Include="code\manhunt\AudioManager.cpp" />
<ClCompile Include="code\manhunt\Camera.cpp" />
<ClCompile Include="code\manhunt\Character.cpp" />
<ClCompile Include="code\manhunt\Cheats.cpp" />
<ClCompile Include="code\manhunt\ClumpDict.cpp" />
<ClCompile Include="code\manhunt\Collectable.cpp" />
<ClCompile Include="code\manhunt\ColLine.cpp" />
<ClCompile Include="code\manhunt\CreationManager.cpp" />
<ClCompile Include="code\manhunt\Decal.cpp" />
<ClCompile Include="code\manhunt\Entity.cpp" />
<ClCompile Include="code\manhunt\EntityManager.cpp" />
<ClCompile Include="code\manhunt\Filenames.cpp" />
Expand All @@ -205,18 +216,23 @@
<ClCompile Include="code\manhunt\Shot.cpp" />
<ClCompile Include="code\manhunt\SpecialFX.cpp" />
<ClCompile Include="code\manhunt\String.cpp" />
<ClCompile Include="code\manhunt\TexDictionary.cpp" />
<ClCompile Include="code\manhunt\Text.cpp" />
<ClCompile Include="code\manhunt\TextOverlay.cpp" />
<ClCompile Include="code\manhunt\Throwable.cpp" />
<ClCompile Include="code\manhunt\Time.cpp" />
<ClCompile Include="code\manhunt\Vector.cpp" />
<ClCompile Include="code\manhunt\Weapon.cpp" />
<ClCompile Include="code\manhunt\Weather.cpp" />
<ClCompile Include="code\plugin\classes\eCustomPed.cpp" />
<ClCompile Include="code\plugin\classes\eCustomProjectile.cpp" />
<ClCompile Include="code\plugin\console\eConsole.cpp" />
<ClCompile Include="code\plugin\eAchievements.cpp" />
<ClCompile Include="code\plugin\eCommonHooks.cpp" />
<ClCompile Include="code\plugin\eCustomAnimManager.cpp" />
<ClCompile Include="code\plugin\eCustomTableOfContents.cpp" />
<ClCompile Include="code\plugin\eGUI.cpp" />
<ClCompile Include="code\plugin\eLaserSights.cpp" />
<ClCompile Include="code\plugin\eLevelsLoader.cpp" />
<ClCompile Include="code\plugin\eLog.cpp" />
<ClCompile Include="code\plugin\eMapLimits.cpp" />
Expand Down
48 changes: 48 additions & 0 deletions source/PluginMH.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,30 @@
<ClInclude Include="code\manhunt\AnimID.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\AudioManager.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\TextOverlay.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\plugin\eAchievements.h">
<Filter>Header Files\plugin</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\Decal.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\ColLine.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\ContactInfo.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\manhunt\TexDictionary.h">
<Filter>Header Files\manhunt</Filter>
</ClInclude>
<ClInclude Include="code\plugin\eLaserSights.h">
<Filter>Header Files\plugin</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
Expand Down Expand Up @@ -449,6 +473,30 @@
<ClCompile Include="code\manhunt\Hunter.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\AudioManager.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\TextOverlay.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\plugin\eAchievements.cpp">
<Filter>Header Files\plugin</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\Decal.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\ColLine.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\Vector.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\manhunt\TexDictionary.cpp">
<Filter>Header Files\manhunt</Filter>
</ClCompile>
<ClCompile Include="code\plugin\eLaserSights.cpp">
<Filter>Header Files\plugin</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="PluginMH.rc">
Expand Down
12 changes: 12 additions & 0 deletions source/code/RenderWare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,15 @@ RwInt32 RpHAnimIDGetIndex(RpHAnimHierarchy* hierarchy, RwInt32 ID)
{
return CallAndReturn<RwInt32, 0x617250, RpHAnimHierarchy*, RwInt32>(hierarchy, ID);
}

RwMatrix* RwFrameGetLTM(RwFrame* frame)
{
return CallAndReturn<RwMatrix*, 0x6184C0, RwFrame*>(frame);
}

RpHAnimHierarchy* GetAnimHierarchyFromSkinClump(RpClump* clump)
{
RpHAnimHierarchy result;
RpClumpForAllAtomics(clump, GetAnimHierarchyCallback, &result);
return &result;
}
4 changes: 2 additions & 2 deletions source/code/RenderWare.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#define SCREEN_VIEWWINDOW (tanf(DEGTORAD(45.0f * 0.5f)))

RpClump* RpClumpRender(RpClump* clump);
RpHAnimHierarchy* GetAnimHierarchyFromSkinClump(RpClump*);


void CameraSize(RwCamera * camera, RwRect * rect, RwReal viewWindow, RwReal aspectRatio);
void CameraSize(RwCamera * camera, RwRect * rect, RwReal viewWindow, RwReal aspectRatio);
10 changes: 10 additions & 0 deletions source/code/core/eSettingsManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "eSettingsManager.h"
#include "..\..\IniReader.h"
#include "..\manhunt\core.h"
#include "..\plugin\menu\eMenu.h"

bool eSettingsManager::bEnableLog;
bool eSettingsManager::bHideVersionInfo;
Expand Down Expand Up @@ -90,4 +91,13 @@ void eSettingsManager::Init()
keyToggleConsole = reader.ReadInteger("Keys", "keyToggleConsole", VK_OEM_3);
keyToggleScreenshotMode = reader.ReadInteger("Keys", "keyToggleScreenshotMode", VK_F3);
keyToggleHUD = reader.ReadInteger("Keys", "keyToggleHUD", VK_F4);


TheMenu.KeyEnableMenu = reader.ReadInteger("Keys.Menu", "keyMenuEnable", VK_F2);
TheMenu.KeyMenuExecute = reader.ReadInteger("Keys.Menu", "keyMenuExecute", VK_RETURN);
TheMenu.KeyMenuGoBack = reader.ReadInteger("Keys.Menu", "keyMenuBack", VK_BACK);
TheMenu.KeyMenuItemDOWN = reader.ReadInteger("Keys.Menu", "keyMenuDown", VK_DOWN);
TheMenu.KeyMenuItemUP = reader.ReadInteger("Keys.Menu", "keyMenuUp", VK_UP);
TheMenu.KeyMenuItemLEFT = reader.ReadInteger("Keys.Menu", "keyMenuLeft", VK_LEFT);
TheMenu.KeyMenuItemRIGHT = reader.ReadInteger("Keys.Menu", "keyMenuRight", VK_RIGHT);
}
1 change: 0 additions & 1 deletion source/code/core/eSettingsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class eSettingsManager {
static bool bForceFXMode;
static bool bEnableFirstPersonMode;


// keys
static int keyToggleDebugMenu;
static int keyToggleConsole;
Expand Down
22 changes: 21 additions & 1 deletion source/code/manhunt/AI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int AISCRIPT_SetEntityVoiceID(char * entity, int voiceID)
return CallMethodAndReturn<int,0x53BF20, int, char*, int>(0x799B50, entity, voiceID);
}

int AIScript_BuddyFollow(char * entity)
int AISCRIPT_BuddyFollow(char * entity)
{
return CallMethodAndReturn<int, 0x53B9D0, int, char*>(0x799B50, entity);
}
Expand All @@ -54,6 +54,26 @@ int AISCRIPT_DefineGoal_BeBuddy(char * goalName, char * entityName, char * whoTo
return CallMethodAndReturn<int, 0x53A020, int, char*, char*, char*, char*, float>(0x799B50, goalName, entityName, whoToBeBuddyWith, home, radius);
}

int AISCRIPT_SetSubpackCombatType(char* entityName, char* pack, int type)
{
return CallMethodAndReturn<int, 0x5391E0, int, char*, char*, int>(0x799B50, entityName, pack, type);
}

int AISCRIPT_AddSubpack_ForLeader(char* entity, char* subpack)
{
return CallMethodAndReturn<int, 0x5386F0, int, char*, char*>(0x799B50, entity, subpack);
}

int AISCRIPT_AddAllHuntersInPackAsLeaderEnemies(char* entity, char* leaderName)
{
return CallMethodAndReturn<int, 0x538BC0, int, char*, char*>(0x799B50, entity, leaderName);
}

int AISCRIPT_AddGoal_Subpack(char* entity, char* subpack, char* goalName)
{
return CallMethodAndReturn<int, 0x538C80, int, char*, char*, char*>(0x799B50, entity, subpack, goalName);
}

int modAI_Audio_RegisterAISound(eAISounds sound, CEntity * entity, int unk, int unk2)
{
return CallMethodAndReturn<int, 0x520640, int, eAISounds, CEntity*,int,int>(0x7957BC, sound, entity, unk, unk2);
Expand Down
16 changes: 14 additions & 2 deletions source/code/manhunt/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,29 @@ enum eAISounds {
VOLUME_DISTANCES,
};


enum eAICombatTypes {
COMBATTYPEID_MELEE,
COMBATTYPEID_OPEN,
COMBATTYPEID_COVER,
COMBATTYPEID_OPEN_MELEE,
};

int AISCRIPT_EntityAlwaysEnabled(char* instance);
int AISCRIPT_AddAIEntity(char* entity);
int AISCRIPT_SetAIEntityAsLeader(char* entity);
int AISCRIPT_AddLeaderEnemy(char* entity, char* enemy);
int AISCRIPT_SetEntityVoiceID(char* entity, int voiceID);
int AIScript_BuddyFollow(char* entity);
int AISCRIPT_BuddyFollow(char* entity);
int AISCRIPT_CancelIdle(char* entity, int action);
int AISCRIPT_AddHunterToLeaderSubpack(char* leader, char* subpack, char* entity);
int AISCRIPT_DefineGoal_HuntEnemy(char* refName, char* who, bool unk, int unk2);
// AIDefineGoalBeBuddy('gTrampy', 'Tramp','player', 'Timer404', 2);
int AISCRIPT_DefineGoal_BeBuddy(char* goalName, char* entityName, char* whoToBeBuddyWith, char* home, float radius);
int AISCRIPT_SetSubpackCombatType(char* entityName, char* pack, int type);
int AISCRIPT_AddSubpack_ForLeader(char* entity, char* subpack);
int AISCRIPT_AddAllHuntersInPackAsLeaderEnemies(char* entity, char* leaderName);

int AISCRIPT_AddGoal_Subpack(char* entity, char* subpack, char* goalName);

int modAI_Audio_RegisterAISound(eAISounds sound, CEntity* entity, int unk, int unk2);

Expand Down
5 changes: 5 additions & 0 deletions source/code/manhunt/AmmoWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ void CAmmoWeapon::GetFiringDirection(CVector * dest, float unk, int unk2, int un
CallMethod<0x4F92F0, CAmmoWeapon*, CVector*, float, int, int>(this, dest, unk, unk2, unk3);
}

void CAmmoWeapon::GetFiringPoint(CVector* dest, int unk)
{
CallMethod<0x4F90C0, CAmmoWeapon*, CVector*, int>(this, dest, unk);
}

void CAmmoWeapon::UpdateFiringDirection(float unk)
{
CallMethod<0x4F96C0, CAmmoWeapon*, float>(this, unk);
Expand Down
1 change: 1 addition & 0 deletions source/code/manhunt/AmmoWeapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class CAmmoWeapon {
void Reload(int flag);
void SetAmmo(unsigned int amount);
void GetFiringDirection(CVector* dest, float unk, int unk2, int unk3);
void GetFiringPoint(CVector* dest, int unk);
void UpdateFiringDirection(float unk);
static bool& ms_bHeadShot;

Expand Down
25 changes: 25 additions & 0 deletions source/code/manhunt/AudioManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "AudioManager.h"
#include "core.h"

cAudioManager& AudioManager = *(cAudioManager*)0x6B53D8;
cDMAudio& DMAudio = *(cDMAudio*)0x6C5244;

void cAudioManager::ResetLevel()
{
CallMethod<0x455C70, cAudioManager*>(this);
}

void cAudioManager::RequestMiscOneShot(CVector* pos, eSampleIDs sample, int unk, int unk2)
{
CallMethod<0x5B5810, cAudioManager*, CVector*, eSampleIDs, int, int>(this, pos, sample, unk, unk2);
}

int cAudioManager::ProcessWeapon_Fire(eCollectableType item, int a2, int a3, float* freq, float* a5)
{
return CallMethodAndReturn<int, 0x44F620, cAudioManager*,eCollectableType, int, int, float*, float*>(this, item, a2, a3, freq, a5);
}

void cDMAudio::PlayFrontEndSound(short sample, float unk)
{
CallMethod<0x456280,cDMAudio*, short, float>(this, sample, unk);
}
20 changes: 20 additions & 0 deletions source/code/manhunt/AudioManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once
#include "Collectable.h"
#include "SampleIDs.h"

class cAudioManager {
public:
void ResetLevel();
void RequestMiscOneShot(CVector* pos, eSampleIDs sample, int unk, int unk2);
int ProcessWeapon_Fire(eCollectableType item, int a2, int a3, float* freq, float* a5);
};


class cDMAudio {
public:
void PlayFrontEndSound(short sample, float unk);
};

extern cAudioManager& AudioManager;

extern cDMAudio& DMAudio;
5 changes: 5 additions & 0 deletions source/code/manhunt/ClumpDict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ int CClumpDict::CheckDict()
return CallMethodAndReturn<int, 0x59B6F0, CClumpDict*>(this);
}

int CClumpDict::sub_59B860(const char* name)
{
return CallMethodAndReturn<int, 0x59B860, CClumpDict*, const char*>(this, name);
}

CClump * CClumpDict::FindClumpDescription(const char * name)
{
return CallMethodAndReturn<CClump*, 0x59B730, CClumpDict*, const char*>(this, name);
Expand Down
4 changes: 3 additions & 1 deletion source/code/manhunt/ClumpDict.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CClumpDict {
private:
char data[0x288];
char data[1024];
public:
void Initialise(const char* texture, const char* name);

Expand All @@ -13,4 +13,6 @@ class CClumpDict {

int CheckDict();

int sub_59B860(const char* name);

};
12 changes: 12 additions & 0 deletions source/code/manhunt/ColLine.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "ColLine.h"
#include "core.h"

void CColLine::Calculate()
{
CallMethod<0x4044F0, CColLine*>(this);
}

bool CColLine::TestBSP(CContactInfo* contact, float* unk)
{
return CallMethodAndReturn<bool, 0x4DE800, CColLine*, CContactInfo*, float*>(this, contact, unk);
}
Loading

0 comments on commit e3f9199

Please sign in to comment.