Skip to content

Commit

Permalink
Add asset-type functions & some other misc addresses (#77)
Browse files Browse the repository at this point in the history
* Add TakeDamage addresses

* add addresses for asset type functions

* Add DeclareAddress() for TakeDamage

---------

Co-authored-by: Eric Mor <emd4600@gmail.com>
  • Loading branch information
VanillaCold and emd4600 authored Jan 20, 2025
1 parent 04c892f commit 17e4815
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ namespace Editors
DefineAddress(PostEventToActors, SelectAddress(0x574000, 0x574110));

DefineAddress(HandleMessage, SelectAddress(0x591C80, 0x591FA0));


DefineAddress(GetEditorForAssetType, SelectAddress(0x00433010, 0x004333e0));
DefineAddress(GetNameForAssetType, SelectAddress(0x004badc0, 0x004bba50));
DefineAddress(GetTypeIDForAssetType, SelectAddress(0x004bb110, 0x004bbda0));
}

namespace Addresses(EditorCamera)
Expand Down
8 changes: 8 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,12 @@ namespace Simulator
DefineAddress(OnJumpLand, SelectAddress(0xC044D0, 0xC04CB0));
DefineAddress(OnStartSwimming, SelectAddress(0xC04610, 0xC04DF0));
DefineAddress(Update, SelectAddress(0xC0A590, 0xC0AE30));
DefineAddress(TakeDamage, SelectAddress(0xBFC500, 0xBFCF10));
}

namespace Addresses(cCreatureCitizen) {
DefineAddress(Update, SelectAddress(0xC24210, 0xC24A30));
DefineAddress(TakeDamage, SelectAddress(0xBFC500, 0xBFCF10));
DefineAddress(DoAction, SelectAddress(0xC26EF0, 0xC27710));
DefineAddress(GetHandheldItemForTool, SelectAddress(0xC22E70, 0xC23740));
DefineAddress(GetSpecializedName, SelectAddress(0xB6B500, 0xB6B910));
Expand Down Expand Up @@ -256,6 +258,12 @@ namespace Simulator
DefineAddress(OnJumpLand, SelectAddress(0xC14670, 0xC14E10));
DefineAddress(OnStartSwimming, SelectAddress(0xC147D0, 0xC14F70));
DefineAddress(Update, SelectAddress(0xC20C50, 0xC21530));
DefineAddress(TakeDamage, SelectAddress(0xBFC500, 0xBFCF10));
}

namespace Addresses(cCombatant)
{
DefineAddress(TakeDamage, SelectAddress(0xBFC500, 0xBFCF10));
DefineAddress(IsHervibore, SelectAddress(0xC0B040, 0xC0B8E0));
}

Expand Down
6 changes: 6 additions & 0 deletions Spore ModAPI/SourceCode/Editors/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,11 @@ namespace Editors


auto_METHOD_VOID(EditorRigblock, SetShadedDisplay, Args(bool isShaded), Args(isShaded));

auto_STATIC_METHOD(cEditor, uint32_t, GetEditorForAssetType, Args(uint32_t assetTypeID), Args(assetTypeID));

auto_STATIC_METHOD(cEditor, uint32_t, GetTypeIDForAssetType, Args(uint32_t assetTypeID), Args(assetTypeID));

auto_STATIC_METHOD(cEditor, const char16_t*, GetNameForAssetType, Args(uint32_t assetTypeID), Args(assetTypeID));
}
#endif
11 changes: 11 additions & 0 deletions Spore ModAPI/Spore/Editors/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ namespace Editors

void PostEventToActors(uint32_t eventID, int = -1, float = 1.0f, float = 0.0f);

static uint32_t GetEditorForAssetType(uint32_t assetTypeID);

static const char16_t* GetNameForAssetType(uint32_t assetTypeID);

static uint32_t GetTypeIDForAssetType(uint32_t assetTypeID);

public:

int vftable_1C;
Expand Down Expand Up @@ -628,6 +634,11 @@ namespace Editors
DeclareAddress(PostEventToActors); // 0x574000 0x574110

DeclareAddress(HandleMessage); // 0x591C80 0x591FA0


DeclareAddress(GetEditorForAssetType);
DeclareAddress(GetNameForAssetType);
DeclareAddress(GetTypeIDForAssetType);
}

#ifdef SDK_TO_GHIDRA
Expand Down
4 changes: 4 additions & 0 deletions Spore ModAPI/Spore/Simulator/cCombatant.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,8 @@ namespace Simulator
};
ASSERT_SIZE(cCombatant, 0xC8);

namespace Addresses(cCombatant){
DeclareAddress(TakeDamage);
}

}
1 change: 1 addition & 0 deletions Spore ModAPI/Spore/Simulator/cCreatureAnimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@ namespace Simulator
DeclareAddress(OnJumpLand); // 0xC044D0 0xC04CB0
DeclareAddress(OnStartSwimming); // 0xC04610 0xC04DF0
DeclareAddress(Update); // 0xC0A590 0xC0AE30
DeclareAddress(TakeDamage);
}
}
1 change: 1 addition & 0 deletions Spore ModAPI/Spore/Simulator/cCreatureBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ namespace Simulator
DeclareAddress(OnJumpLand); // 0xC14670 0xC14E10
DeclareAddress(OnStartSwimming); // 0xC147D0 0xC14F70
DeclareAddress(Update); // 0xC20C50 0xC21530
DeclareAddress(TakeDamage);
DeclareAddress(IsHervibore); // 0xC0B040 0xC0B8E0
}
}
1 change: 1 addition & 0 deletions Spore ModAPI/Spore/Simulator/cCreatureCitizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ namespace Simulator

namespace Addresses(cCreatureCitizen) {
DeclareAddress(Update); // 0xC24210 0xC24A30
DeclareAddress(TakeDamage);
DeclareAddress(DoAction); // 0xC26EF0 0xC27710
DeclareAddress(GetHandheldItemForTool); // 0xC22E70 0xC23740
DeclareAddress(GetSpecializedName); // 0xB6B500 0xB6B910
Expand Down

0 comments on commit 17e4815

Please sign in to comment.