From 908feb98dec02d381abf5538914c97cf02d02d26 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 8 Jan 2024 19:16:04 -0800 Subject: [PATCH 001/113] add function definition for AddCreature --- Spore ModAPI/SourceCode/Editors/Editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Spore ModAPI/SourceCode/Editors/Editor.cpp b/Spore ModAPI/SourceCode/Editors/Editor.cpp index a0942fce..1e34847c 100644 --- a/Spore ModAPI/SourceCode/Editors/Editor.cpp +++ b/Spore ModAPI/SourceCode/Editors/Editor.cpp @@ -172,6 +172,9 @@ namespace Editors auto_METHOD(cEditorAnimWorld, Anim::AnimatedCreature*, GetAnimatedCreature, Args(int creatureID), Args(creatureID)); + auto_METHOD(cEditor, bool, AddCreature, + Args(int a, const ResourceKey* key), Args(a, key)); + auto_METHOD_VOID(cEditorAnimWorld, DestroyCreature, Args(int creatureID), Args(creatureID)); From 9913d937a1326818a75e72c46c84379b3f457366 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Tue, 9 Jan 2024 15:50:29 -0800 Subject: [PATCH 002/113] Add MouthTypes to CommonIDs.h --- Spore ModAPI/Spore/CommonIDs.h | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index 40345734..3fa847db 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -93,6 +93,86 @@ enum Difficulty kDifficultyHard = 2, }; + +enum MouthTypes +{ + /// Creature Voices + AOA = 0x409C2A0E, + AOB = 0x409C2A0D, + AOC = 0x409C2A0C, + AOD = 0x409C2A0B, + BCA = 0x1C99B34D, + BCB = 0x1C99B34E, + BCC = 0x1C99B34F, + BCD = 0x1C99B348, + BHA = 0x2799C41C, + BHB = 0x2799C41F, + BHC = 0x2799C41E, + BHD = 0x2799C419, + FCA = 0x448F64A9, + FCB = 0x448F64AA, + FCC = 0x448F64AB, + FCD = 0x448F64AC, + JCA = 0x2C8644C5, + JCB = 0x2C8644C6, + JCC = 0x2C8644C7, + JCD = 0x2C8644C0, + JHA = 0x27863CA4, + JHB = 0x27863CA7, + JHC = 0x27863CA6, + JHD = 0x27863CA1, + MCA = 0x3C7E0F6E, + MCB = 0x3C7E0F6D, + MCC = 0x3C7E0F6C, + MCD = 0x3C7E0F6B, + POA = 0x407759F7, + POB = 0x407759F4, + POC = 0x407759F5, + POD = 0x407759F2, + ROA = 0x4072DC09, + ROB = 0x4072DC0A, + ROC = 0x4072DC0B, + ROD = 0x4072DC0C, + SHA = 0x21706D65, + SHB = 0x21706D66, + SHC = 0x21706D67, + SHD = 0x21706D60, + + /// Civilized Voices + MamA = 0xB876E0E9, + MamB = 0xB876E0EA, + MamC = 0xB876E0EB, + MamD = 0xB876E0EC, + BirA = 0x5C0D5529, + BirB = 0x5C0D552A, + BirC = 0x5C0D552B, + BirD = 0x5C0D552C, + InsA = 0x5AC64A74, + InsB = 0x5AC64A77, + InsC = 0x5AC64A76, + InsD = 0x5AC64A71, + + /// Cell Voices + al = 0x70772D36, + av = 0x70772D2C, + bz = 0x6F772BBD, + ch = 0x6E772A5C, + dk = 0x6D7728CA, + ed = 0x6C77276A, + ek = 0x6C772765, + go = 0x6A772387, + jw = 0x67771F58, + jt = 0x67771F5B, + mm = 0x64771A1B, + no = 0x6377188C, + pk = 0x617715D6, + po = 0x617715D2, + ps = 0x617715CE, + sh = 0x5E77116C, + st = 0x5E771170, + sq = 0x5E771175, +}; + /// Contains the ID of some important file types. namespace TypeIDs { From 6da280d6e18325a8daf9abc7ad8861465d5e8b4b Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 19 Aug 2024 03:11:56 -0700 Subject: [PATCH 003/113] Add name for Unk10 in enum CreaturePersonality --- Spore ModAPI/Spore/Simulator/cHerd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cHerd.h b/Spore ModAPI/Spore/Simulator/cHerd.h index c15c5127..41e3157e 100644 --- a/Spore ModAPI/Spore/Simulator/cHerd.h +++ b/Spore ModAPI/Spore/Simulator/cHerd.h @@ -21,7 +21,7 @@ namespace Simulator Pet = 7, WaterPredator = 8, Carcass = 9, - Unk10 = 10, + Rogue = 10, Scenario = 11 }; From fbdc34f8e3465f320df3c074deef7e262c8ab4fd Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 22 Aug 2024 20:43:29 -0700 Subject: [PATCH 004/113] Add definitions to Cursors.h --- Spore ModAPI/Spore/UTFWin/Cursors.h | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index 3c491866..a33cd9af 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -115,6 +115,50 @@ namespace UTFWin /// STD_Center-alpha09 StdCenterAlpha09 = 0x1023, + + + /// cursor-no-opt + NoOptions = 0x3a204b0, + + /// cursor-ban-mode + BanMode = 0x5ecbdffd, + + /// cursor_skeleton2 + UnlockSkeleton = 0x342d221f, + + /// cursor-eat-fruit + EatFruit = 0xb14ab7b6, + + /// cursor-eat-omni + EatFruit = 0x3febe52, + + /// cursor-eat-carcass + EatCarn = 0x514ab7b7, + + /// cursor-mate + Mate = 0x314ab7b1, + + /// cursor-target-creature + TargetCreature = 0xf36a0c84, + + /// cursor_atk + Attack = 0xb14ab7b9, + + /// cursor_social + Socialize = 0x525ff7d, + + /// cursor-trg-domesticate + Domesticate = 0xe382f00e, + + /// cursor-fish + Fish = 0x3febe3f, + + /// cursor-gather + Gather = 0x3febe40, + + /// cursor-steal + Steal = 0x3febe42, + }; } } \ No newline at end of file From b9ae16cc9a3858aff4b7be12fbb49fae85532e95 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 13:11:23 -0700 Subject: [PATCH 005/113] Fix typo, remove duplicate of auto_METHOD(cEditor, bool, AddCreature, add comment to funcC0h in cTribe.h --- Spore ModAPI/SourceCode/Editors/Editor.cpp | 3 --- Spore ModAPI/Spore/Simulator/cCommunity.h | 2 +- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI/SourceCode/Editors/Editor.cpp b/Spore ModAPI/SourceCode/Editors/Editor.cpp index 983f4d1a..1e34847c 100644 --- a/Spore ModAPI/SourceCode/Editors/Editor.cpp +++ b/Spore ModAPI/SourceCode/Editors/Editor.cpp @@ -189,9 +189,6 @@ namespace Editors auto_METHOD_VOID(cEditor, PostEventToActors, Args(uint32_t eventID, int a, float b, float c), Args(eventID, a, b, c)); - auto_METHOD(cEditor, bool, AddCreature, - Args(int a, const ResourceKey* key), Args(a, key)); - auto_METHOD_VOID(EditorRigblock, SetShadedDisplay, Args(bool isShaded), Args(isShaded)); diff --git a/Spore ModAPI/Spore/Simulator/cCommunity.h b/Spore ModAPI/Spore/Simulator/cCommunity.h index dcba0beb..f7d3578d 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunity.h +++ b/Spore ModAPI/Spore/Simulator/cCommunity.h @@ -65,7 +65,7 @@ namespace Simulator using Object::Cast; /// Returns the leader of this community, casted as a cCreatureCitizen. - /// This can ge used in cTribe to get the tribe chief. + /// This can be used in cTribe to get the tribe chief. /// @returns inline cCreatureCitizen* GetLeaderCitizen(); diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index e77f6e14..289863b6 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -58,7 +58,7 @@ namespace Simulator /* B4h */ virtual cCreatureCitizen* funcB4h(int); /* B8h */ virtual void funcB8h(int); /* BCh */ virtual eastl::vector& GetTools(); - /* C0h */ virtual eastl::vector& funcC0h(); + /* C0h */ virtual eastl::vector& funcC0h(); // GetSocialTools public: /* 260h */ cTribeFoodMatPtr mpFoodMat; From 1eed0505e8945b15e654f35622071a0e3da496e9 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 16:12:51 -0700 Subject: [PATCH 006/113] Add enum of identity colors to cIdentityColorable --- .../Spore/Simulator/cIdentityColorable.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h index 89730af8..339073a8 100644 --- a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h +++ b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h @@ -26,6 +26,24 @@ namespace Simulator { + enum class IdentityColors + { + Player = 0x053dbcf1, + Neutral = 0x053dbcf2, + Brown = 0x053dbcf3, + Pink = 0x053dbcf4, + Cyan = 0x053dbcf5, + Green = 0x053dbcf6, + Lavender = 0x053dbcf7, + Orange = 0x053dbcf8, + Yellow = 0x053dbcf9, + Red = 0x053dbcfa, + Blue = 0x053dbcfb, + Forest = 0x053dbcfc, + Crimson = 0x053dbcfd, + Purple = 0x053dbcfe, + }; + /// /// A Simulator class inherited by all those classes that can have an identity color, such as /// empires, tribes, etc From ff135fe16f77f0329cbc52fc43c53800a7bd9dde Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 16:55:28 -0700 Subject: [PATCH 007/113] Add several more cursors --- Spore ModAPI/Spore/UTFWin/Cursors.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index fd82c2c6..b164c428 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -119,6 +119,9 @@ namespace UTFWin /// cursor-no-opt NoOptions = 0x3a204b0, + + /// cursor-grab_open + GrabOpen = 0x648fbf1, /// cursor-ban-mode BanMode = 0x5ecbdffd, @@ -153,6 +156,15 @@ namespace UTFWin /// cursor-steal Steal = 0x3febe42, + /// cursor_repair + Repair = 0x525ff0f, + + /// cursor-crg-give-grn + Gift = 0x8b875bdc, + + /// cursor-crg-give-grn-no + GiftDeny = 0xf59ce677, + /// cursor-fish Fish = 0x3febe3f, From f887e7f3709834abe5f7bc26c96e605485a75864 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 17:02:35 -0700 Subject: [PATCH 008/113] ammend comment --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 289863b6..80551743 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -58,7 +58,7 @@ namespace Simulator /* B4h */ virtual cCreatureCitizen* funcB4h(int); /* B8h */ virtual void funcB8h(int); /* BCh */ virtual eastl::vector& GetTools(); - /* C0h */ virtual eastl::vector& funcC0h(); // GetSocialTools + /* C0h */ virtual eastl::vector& funcC0h(); // GetSocialTools? public: /* 260h */ cTribeFoodMatPtr mpFoodMat; From 117e9382c0e738257dffc46aada279f8908a1b76 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 17:03:51 -0700 Subject: [PATCH 009/113] remove mouthtypes commit --- Spore ModAPI/Spore/CommonIDs.h | 80 ---------------------------------- 1 file changed, 80 deletions(-) diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index 3fa847db..40345734 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -93,86 +93,6 @@ enum Difficulty kDifficultyHard = 2, }; - -enum MouthTypes -{ - /// Creature Voices - AOA = 0x409C2A0E, - AOB = 0x409C2A0D, - AOC = 0x409C2A0C, - AOD = 0x409C2A0B, - BCA = 0x1C99B34D, - BCB = 0x1C99B34E, - BCC = 0x1C99B34F, - BCD = 0x1C99B348, - BHA = 0x2799C41C, - BHB = 0x2799C41F, - BHC = 0x2799C41E, - BHD = 0x2799C419, - FCA = 0x448F64A9, - FCB = 0x448F64AA, - FCC = 0x448F64AB, - FCD = 0x448F64AC, - JCA = 0x2C8644C5, - JCB = 0x2C8644C6, - JCC = 0x2C8644C7, - JCD = 0x2C8644C0, - JHA = 0x27863CA4, - JHB = 0x27863CA7, - JHC = 0x27863CA6, - JHD = 0x27863CA1, - MCA = 0x3C7E0F6E, - MCB = 0x3C7E0F6D, - MCC = 0x3C7E0F6C, - MCD = 0x3C7E0F6B, - POA = 0x407759F7, - POB = 0x407759F4, - POC = 0x407759F5, - POD = 0x407759F2, - ROA = 0x4072DC09, - ROB = 0x4072DC0A, - ROC = 0x4072DC0B, - ROD = 0x4072DC0C, - SHA = 0x21706D65, - SHB = 0x21706D66, - SHC = 0x21706D67, - SHD = 0x21706D60, - - /// Civilized Voices - MamA = 0xB876E0E9, - MamB = 0xB876E0EA, - MamC = 0xB876E0EB, - MamD = 0xB876E0EC, - BirA = 0x5C0D5529, - BirB = 0x5C0D552A, - BirC = 0x5C0D552B, - BirD = 0x5C0D552C, - InsA = 0x5AC64A74, - InsB = 0x5AC64A77, - InsC = 0x5AC64A76, - InsD = 0x5AC64A71, - - /// Cell Voices - al = 0x70772D36, - av = 0x70772D2C, - bz = 0x6F772BBD, - ch = 0x6E772A5C, - dk = 0x6D7728CA, - ed = 0x6C77276A, - ek = 0x6C772765, - go = 0x6A772387, - jw = 0x67771F58, - jt = 0x67771F5B, - mm = 0x64771A1B, - no = 0x6377188C, - pk = 0x617715D6, - po = 0x617715D2, - ps = 0x617715CE, - sh = 0x5E77116C, - st = 0x5E771170, - sq = 0x5E771175, -}; - /// Contains the ID of some important file types. namespace TypeIDs { From af84e5852b44001b027c2db684946150182f342b Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 23 Aug 2024 17:52:24 -0700 Subject: [PATCH 010/113] Add space game cursors --- Spore ModAPI/Spore/UTFWin/Cursors.h | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index b164c428..67192244 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -119,6 +119,12 @@ namespace UTFWin /// cursor-no-opt NoOptions = 0x3a204b0, + + /// cursor_goodie-hut + QuestionHut = 0x56e3a22, + + // cursor-object-translate + Pan = 0x600cd69, /// cursor-grab_open GrabOpen = 0x648fbf1, @@ -201,6 +207,46 @@ namespace UTFWin /// cursor-dance Dance = 0x3febe3d, + /// cursor-claim-spicemine + ClaimSpice = 0x5d53800, + + /// cur_ClaimNest + ClaimNest = 0x7542cdb5, + + + /// cursor-spg-sculpting-norm + SpgSculpting = 0x682102e, + + /// cursor-spg-social-norm + SpgSocial = 0x6821016, + + /// cursor-spg-sculpting-norm + SpgSocial = 0x682102e, + + /// cursor-spg-travel-norm + SpgScan = 0x6821022, + + /// cursor-spg-travel-on + SpgScanActive = 0x6821024, + + /// cursor-spg-abduct-norm + SpgAbduct = 0x682103e, + + /// cursor-spg-abduct-on + SpgAbductActive = 0x6821040, + + /// cursor-spg-color-norm + SpgColor = 0x6821026, + + /// cursor-spg-color-on + SpgColorActive = 0x6821029, + + /// cursor-spg-colonize-norm + SpgColonize = 0x6821032, + + /// cursor-spg-atmospheric-norm + SpgAtmosphere = 0x6821042, + }; } } \ No newline at end of file From ab8e0a97ac52701be3cf7d71743738a8fc9aa668 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 24 Aug 2024 00:19:24 -0700 Subject: [PATCH 011/113] fix compile error in cursors.h --- Spore ModAPI/Spore/UTFWin/Cursors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index 67192244..3169467d 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -221,7 +221,7 @@ namespace UTFWin SpgSocial = 0x6821016, /// cursor-spg-sculpting-norm - SpgSocial = 0x682102e, + SpgSculpt = 0x682102e, /// cursor-spg-travel-norm SpgScan = 0x6821022, From adaa6ce10a5ff63c22a9138f519d503afc752354 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 24 Aug 2024 02:06:51 -0700 Subject: [PATCH 012/113] remove erroneous comment --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 80551743..e77f6e14 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -58,7 +58,7 @@ namespace Simulator /* B4h */ virtual cCreatureCitizen* funcB4h(int); /* B8h */ virtual void funcB8h(int); /* BCh */ virtual eastl::vector& GetTools(); - /* C0h */ virtual eastl::vector& funcC0h(); // GetSocialTools? + /* C0h */ virtual eastl::vector& funcC0h(); public: /* 260h */ cTribeFoodMatPtr mpFoodMat; From 489f3ad9e1a5f1c6d2c9c2d1bf8a8757d2179e23 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 25 Aug 2024 00:44:55 -0700 Subject: [PATCH 013/113] change mIDColorID to use IdentityColors --- Spore ModAPI/Spore/Simulator/cIdentityColorable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h index 339073a8..d51fa29b 100644 --- a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h +++ b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h @@ -54,6 +54,7 @@ namespace Simulator /// class cIdentityColorable { + public: static const uint32_t TYPE = 0x5593A1A; @@ -71,7 +72,7 @@ namespace Simulator void AssignNames(const eastl::string16& speciesName); public: - /* 04h */ uint32_t mIDColorID; // 0x53DBCF1 + /* 04h */ IdentityColors mIDColorID; // 0x53DBCF1 /// Names for different entities such as buildings, vehicles, etc. Check `Identity.locale` /* 08h */ eastl::map mEntityNames; /* 24h */ Math::ColorRGB mCachedColor; From 3c3ed76b9da2d2a8d5ae5b41593a5597cd4a4247 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 25 Aug 2024 16:02:17 -0700 Subject: [PATCH 014/113] Add 2 new dev cheats (devEffectLog & PrintCursor), add support for palette subcategories in part icon capture. NOTE: UNTESTED! For those who can, please compile this and test it ingame before accepting/rejecting PR. --- .../Example Projects/ModCreatorKit/Cheats.cpp | 5 ++ .../ModCreatorKit/EffectLogCheat.cpp | 30 ++++++++++++ .../ModCreatorKit/EffectLogCheat.h | 15 ++++++ .../ModCreatorKit/ModCreatorKit.vcxproj | 20 +++++++- .../ModCreatorKit.vcxproj.filters | 12 +++++ .../ModCreatorKit/PrintCursorCheat.cpp | 17 +++++++ .../ModCreatorKit/PrintCursorCheat.h | 16 +++++++ .../ModCreatorKit/ThumbnailCaptureScript.cpp | 47 +++++++++++++++---- 8 files changed, 153 insertions(+), 9 deletions(-) create mode 100644 Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp create mode 100644 Projects/Example Projects/ModCreatorKit/EffectLogCheat.h create mode 100644 Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp create mode 100644 Projects/Example Projects/ModCreatorKit/PrintCursorCheat.h diff --git a/Projects/Example Projects/ModCreatorKit/Cheats.cpp b/Projects/Example Projects/ModCreatorKit/Cheats.cpp index 10a4f3fa..b4e4b27b 100644 --- a/Projects/Example Projects/ModCreatorKit/Cheats.cpp +++ b/Projects/Example Projects/ModCreatorKit/Cheats.cpp @@ -22,7 +22,9 @@ #include "ContextCheat.h" #include "AddressCheat.h" #include "AnimLogCheat.h" +#include "EffectLogCheat.h" #include "PackageCheat.h" +#include "PrintCursorCheat.h" #include "UILogCheat.h" #include "UIInspectCheat.h" @@ -47,10 +49,13 @@ void AddCheats() { CheatManager.AddCheat("devContext", new ContextCheat()); CheatManager.AddCheat("devAnimLog", new AnimLogCheat()); + CheatManager.AddCheat("devEffectLog", new EffectLogCheat()); CheatManager.AddCheat("devPackage", new PackageCheat()); CheatManager.AddCheat("devLogUI", new UILogCheat()); CheatManager.AddCheat("devInspectUI", new UIInspectCheat()); + CheatManager.AddCheat("PrintCursor", new PrintCursorCheat()); + AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x1498444, 0x1493E5C)), "devRaid"); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x149845C, 0x1493E74)), "devSpace"); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x1498474, 0x1493E8C)), "devBadge"); diff --git a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp new file mode 100644 index 00000000..91669637 --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp @@ -0,0 +1,30 @@ +#include "stdafx.h" +#include "EffectLogCheat.h" +#include + +bool EffectLogCheat::IsEnabled = false; + +member_detour(ReadEffect_detour, Swarm::cEffectsManager, int(uint32_t, uint32_t)) { + int detoured(uint32_t instanceId, uint32_t groupId) { + if (EffectLogCheat::IsEnabled && instanceId != 0) + { + App::ConsolePrintF("devEffectLog: loaded effect ID: 0x%x", instanceId); + } + return original_function(this, instanceId, groupId); //And call the original function with the new instance ID. + } +}; + +void EffectLogCheat::AttachDetour() { + ReadEffect_detour::attach(Address(ModAPI::ChooseAddress(0x99EC00, 0x99ECA0))); +} + +void EffectLogCheat::ParseLine(const ArgScript::Line& line) +{ + auto args = line.GetArguments(1); + EffectLogCheat::IsEnabled = mpFormatParser->ParseBool(args[0]); +} + +const char* EffectLogCheat::GetDescription(ArgScript::DescriptionMode mode) const +{ + return "Usage: animLog on/off. If enabled, every time an animation is loaded it will print its ID."; +} \ No newline at end of file diff --git a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.h b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.h new file mode 100644 index 00000000..1087e1e4 --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +class EffectLogCheat + : public ArgScript::ICommand +{ +public: + void ParseLine(const ArgScript::Line& line) override; + const char* GetDescription(ArgScript::DescriptionMode mode) const override; + + static bool IsEnabled; + + static void AttachDetour(); +}; \ No newline at end of file diff --git a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj index f70af341..b609e89e 100644 --- a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj +++ b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj @@ -44,13 +44,15 @@ true - $(DXSDK_DIR)\Include;$(SporeSdkPath)Spore ModAPI;$(SporeSdkPath)EASTL-3.02.01\test\packages\EABase\include\Common;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAAssert\include;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAStdC\include;$(SporeSdkPath)EASTL-3.02.01\include;$(SporeSdkPath)Detours\include\;$(IncludePath) + C:\ProgramData\SPORE ModAPI Launcher Kit\coreLibs;$(DXSDK_DIR)\Include;$(SporeSdkPath)Spore ModAPI;$(SporeSdkPath)EASTL-3.02.01\test\packages\EABase\include\Common;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAAssert\include;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAStdC\include;$(SporeSdkPath)EASTL-3.02.01\include;$(SporeSdkPath)Detours\include\;C:\Users\Allison\source\SourceEngine2007-master\src_main\dx9sdk\Include;$(IncludePath) $(DXSDK_DIR)Lib\x86;$(SporeLauncherPath)coreLibs;$(SporeSdkPath)Detours\lib.X86;$(SporeSdkPath)lib\Debug;$(LibraryPath) $(ProjectName) $(SporeLauncherPath)mLibs\ $(SporeLauncherPath)Spore ModAPI Launcher.exe $(SporeLauncherPath) WindowsLocalDebugger + + false @@ -115,11 +117,19 @@ + + + + + + + + @@ -155,11 +165,19 @@ + + + + + + + + Create Create diff --git a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters index 8dd5762e..5658ab39 100644 --- a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters +++ b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters @@ -88,6 +88,12 @@ ModCreatorKit\AnimEditor + + ModCreatorKit\Cheats + + + ModCreatorKit\Cheats + @@ -153,6 +159,12 @@ ModCreatorKit\AnimEditor + + ModCreatorKit\Cheats + + + ModCreatorKit\Cheats + diff --git a/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp new file mode 100644 index 00000000..d07b5c9e --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp @@ -0,0 +1,17 @@ +#include "stdafx.h" +#include "PrintCursorCheat.h" + +void PrintCursorCheat::ParseLine(const ArgScript::Line& line) +{ + App::ConsolePrintF("Current Cursor ID: 0x%x", CursorManager.GetActiveCursor()); +} + +const char* PrintCursorCheat::GetDescription(ArgScript::DescriptionMode mode) const +{ + if (mode == ArgScript::DescriptionMode::Basic) { + return "Prints the ID of the current cursor to the console."; + } + else { + return "PrintCursor: Prints the ID of the current cursor to the console."; + } +} \ No newline at end of file diff --git a/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.h b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.h new file mode 100644 index 00000000..e84ff9ca --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +class PrintCursorCheat + : public ArgScript::ICommand +{ +public: + + // Called when the cheat is invoked + void ParseLine(const ArgScript::Line& line) override; + + // Returns a string containing the description. If mode != DescriptionMode::Basic, return a more elaborated description + const char* GetDescription(ArgScript::DescriptionMode mode) const override; +}; + diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index 2ec17248..97f3b538 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -157,23 +157,54 @@ void ThumbnailCaptureScript::CaptureImage() { void ThumbnailCaptureScript::InjectListeners() { RemoveListeners(); for (auto catUI : GetEditor()->mpPartsPaletteUI->mCategories) { - for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { - itemUI->field_18->AddWinProc(this); - mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + auto subCatUIs = catUI->mpSubcategoriesUI; + if (subCatUIs) { + for (auto subCatUI : subCatUIs->mCategoryUIs) { + for (auto pageUI : catUI->mPageUIs) { + for (auto itemUI : pageUI.page->mStandardItems) { + itemUI->field_18->AddWinProc(this); + mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + } + } + } + } + else { + for (auto pageUI : catUI->mPageUIs) { + for (auto itemUI : pageUI.page->mStandardItems) { + itemUI->field_18->AddWinProc(this); + mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + } } } + + + } Renderer.RegisterLayer(this, 40); } void ThumbnailCaptureScript::RemoveListeners() { + for (auto catUI : GetEditor()->mpPartsPaletteUI->mCategories) { - for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { - if (itemUI && itemUI->field_18) { - itemUI->field_18->RemoveWinProc(this); + auto subCatUIs = catUI->mpSubcategoriesUI; + if (subCatUIs) { + for (auto subCatUI : subCatUIs->mCategoryUIs) { + for (auto pageUI : catUI->mPageUIs) { + for (auto itemUI : pageUI.page->mStandardItems) { + if (itemUI && itemUI->field_18) { + itemUI->field_18->RemoveWinProc(this); + } + } + } + } + } + else { + for (auto pageUI : catUI->mPageUIs) { + for (auto itemUI : pageUI.page->mStandardItems) { + if (itemUI && itemUI->field_18) { + itemUI->field_18->RemoveWinProc(this); + } } } } From 49173ecd93dfce9dc6fef95182a858322752e689 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 25 Aug 2024 16:13:37 -0700 Subject: [PATCH 015/113] fix improper effects detour --- Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp index 91669637..6914c060 100644 --- a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp +++ b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp @@ -15,7 +15,7 @@ member_detour(ReadEffect_detour, Swarm::cEffectsManager, int(uint32_t, uint32_t) }; void EffectLogCheat::AttachDetour() { - ReadEffect_detour::attach(Address(ModAPI::ChooseAddress(0x99EC00, 0x99ECA0))); + ReadEffect_detour::attach(GetAddress(Swarm::cEffectsManager, GetDirectoryAndEffectIndex)); } void EffectLogCheat::ParseLine(const ArgScript::Line& line) From e4a1317e2376c2f52e969241f57749a432e74a56 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 29 Aug 2024 18:50:47 -0700 Subject: [PATCH 016/113] document several part unlocking related fields --- Spore ModAPI/Spore/App/cCreatureModeStrategy.h | 2 +- Spore ModAPI/Spore/Simulator/cCollectableItems.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/App/cCreatureModeStrategy.h b/Spore ModAPI/Spore/App/cCreatureModeStrategy.h index ea0dbed1..8d5e6b1e 100644 --- a/Spore ModAPI/Spore/App/cCreatureModeStrategy.h +++ b/Spore ModAPI/Spore/App/cCreatureModeStrategy.h @@ -96,7 +96,7 @@ namespace App Simulator::cCreatureBase* creature; int field_4; - int field_8; + int unlockLevel; }; } } diff --git a/Spore ModAPI/Spore/Simulator/cCollectableItems.h b/Spore ModAPI/Spore/Simulator/cCollectableItems.h index ea898ce5..95b913c8 100644 --- a/Spore ModAPI/Spore/Simulator/cCollectableItems.h +++ b/Spore ModAPI/Spore/Simulator/cCollectableItems.h @@ -155,7 +155,16 @@ namespace Simulator class CreatureGamePartUnlocking { public: - struct cCollectableItemID sub_D3B460(UnkHashMap&, bool, int, int); + // Given an (unknown) hashmap (the creature parts one always is size 56), + // return a valid new part ID to unlock, or call this func again until it returns a valid part. + // + // firstCall is always true ONLY on the first call of this function + // unlockLevel will be either a .prop unlockLevel value or -1 + // + // the cCollectableItemID return value is formatted as such: + // groupID: category name (eg: ce_category_mouths) + // instanceID: part placement in category by page index and part row (eg: a part on page 4 and row 5 would have a hex of 0x30004) + struct cCollectableItemID sub_D3B460(UnkHashMap& unk0, bool firstCall, int unk1, int unlockLevel); }; namespace Addresses(CreatureGamePartUnlocking) From 5343f139136698c9e37f4a2871f3001af3fc9db3 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 29 Aug 2024 21:26:44 -0700 Subject: [PATCH 017/113] add comment to cCollectibleItems::sub_597BC0 --- Spore ModAPI/Spore/Simulator/cCollectableItems.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCollectableItems.h b/Spore ModAPI/Spore/Simulator/cCollectableItems.h index 95b913c8..8bdf8850 100644 --- a/Spore ModAPI/Spore/Simulator/cCollectableItems.h +++ b/Spore ModAPI/Spore/Simulator/cCollectableItems.h @@ -90,7 +90,7 @@ namespace Simulator /// @param pageIndex bool AddUnlockableItemFromProp(struct ResourceKey key, uint32_t categoryID, int row, int column, int pageIndex); - + // called at the start of creature stage with an int of "1" and a nullptr speciesKey void sub_597BC0(UnkHashMap& dst, int, const ResourceKey& speciesKey); void sub_597390(eastl::vector& dst, struct cCollectableItemID itemID, int); From 56ea6fe4f718431dea35432a50136230e28872d0 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 4 Sep 2024 15:50:38 -0700 Subject: [PATCH 018/113] Add cursors, Document string format for CursorManager::Load --- Spore ModAPI/Spore/UTFWin/CursorManager.h | 1 + Spore ModAPI/Spore/UTFWin/Cursors.h | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Spore ModAPI/Spore/UTFWin/CursorManager.h b/Spore ModAPI/Spore/UTFWin/CursorManager.h index c4162892..24fba19e 100644 --- a/Spore ModAPI/Spore/UTFWin/CursorManager.h +++ b/Spore ModAPI/Spore/UTFWin/CursorManager.h @@ -13,6 +13,7 @@ namespace UTFWin public: /// Loads a cursor and assigns it to the given ID. + /// fileName should reference a file in cursors~, eg: u"cursor-camera-translate" bool Load(uint32_t id, const char16_t* fileName, bool loadFromFile = true, int xHotspot = 0, int yHotspot = 0); uint32_t GetActiveCursor() const; diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index 3169467d..0c040d74 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -156,6 +156,9 @@ namespace UTFWin /// cursor_social Socialize = 0x525ff7d, + /// cursor_friend + Friend = 0x755c4eb5, + /// cursor-trg-domesticate Domesticate = 0xe382f00e, @@ -177,6 +180,15 @@ namespace UTFWin /// cursor-gather Gather = 0x3febe40, + /// cursor-crg-pickup + Pickup = 0x3b360dc, + + /// cursor-crg-putdown + Putdown = 0x3b360df, + + /// cursor-crg-throw + Throw = 0x3b360e4, + /// cursor_pickup-maracas PickupMaracas = 0x63fe8d4, From 831a44a489c2bf033b4c20145266c538ed380aa9 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 7 Sep 2024 00:00:03 -0700 Subject: [PATCH 019/113] fix typo --- Spore ModAPI/Spore/Anim/AnimatedCreature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Anim/AnimatedCreature.h b/Spore ModAPI/Spore/Anim/AnimatedCreature.h index caca9c98..cd63aaeb 100644 --- a/Spore ModAPI/Spore/Anim/AnimatedCreature.h +++ b/Spore ModAPI/Spore/Anim/AnimatedCreature.h @@ -58,7 +58,7 @@ namespace Anim /// Loads an animation to be used by this creature. It takes the ID of a TLSA group. /// It returns an index that is used to identify the animation within this creature. /// - /// TLSA Animaiton groups can specify multiple animation choices with different probabilities. + /// TLSA Animation groups can specify multiple animation choices with different probabilities. /// The `pChoice` argument can be provided to force a certain choice index; if the value is -1, /// the argument will be used as an ooutput to know what choice has been selected. /// @param animID The ID of the animation to play, a TLSA group. From cc145adc60fd44f4152fc10adb26073bd5a0e30e Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 7 Sep 2024 21:05:45 -0700 Subject: [PATCH 020/113] Add Math::GetDistance --- Spore ModAPI/SourceCode/Math.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Spore ModAPI/SourceCode/Math.cpp b/Spore ModAPI/SourceCode/Math.cpp index a4b24a58..01d6dd5f 100644 --- a/Spore ModAPI/SourceCode/Math.cpp +++ b/Spore ModAPI/SourceCode/Math.cpp @@ -88,6 +88,10 @@ namespace Math } } + float GetDistance(Vector3 vec1, Vector3 vec2) { + return abs((vec1 - vec2).Length()); + } + Matrix3& Matrix3::SetIdentity() { m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; From 588d5ba65d6e5760463cd144fc258e6356990431 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 8 Sep 2024 17:13:34 -0700 Subject: [PATCH 021/113] Revert "Add Math::GetDistance" This reverts commit cc145adc60fd44f4152fc10adb26073bd5a0e30e. --- Spore ModAPI/SourceCode/Math.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Spore ModAPI/SourceCode/Math.cpp b/Spore ModAPI/SourceCode/Math.cpp index 01d6dd5f..a4b24a58 100644 --- a/Spore ModAPI/SourceCode/Math.cpp +++ b/Spore ModAPI/SourceCode/Math.cpp @@ -88,10 +88,6 @@ namespace Math } } - float GetDistance(Vector3 vec1, Vector3 vec2) { - return abs((vec1 - vec2).Length()); - } - Matrix3& Matrix3::SetIdentity() { m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; From 89fb05f342e41cef6a884522e1c52486c0df6399 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 11 Sep 2024 04:03:22 -0700 Subject: [PATCH 022/113] Begin redoing EP1 object system --- Spore ModAPI/Spore/Simulator/cCombatant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCombatant.h b/Spore ModAPI/Spore/Simulator/cCombatant.h index 53e42e12..703ed0f7 100644 --- a/Spore ModAPI/Spore/Simulator/cCombatant.h +++ b/Spore ModAPI/Spore/Simulator/cCombatant.h @@ -139,7 +139,7 @@ namespace Simulator /* 6Ch */ bool field_6C; // true, needsToLoadAimPoints? /* 70h */ uint32_t field_70; // an effect ID /* 74h */ Vector3 field_74; - /* 80h */ bool field_80; + /* 80h */ bool field_80; // if true, combatant is invincible /* 81h */ bool field_81; /* 84h */ eastl::vector field_84; /* 98h */ cGonzagoTimer field_98; From 7d3abfa8061bfe1e60add21a5f78520bc4149284 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 01:40:08 -0700 Subject: [PATCH 023/113] Revert "change mIDColorID to use IdentityColors" This reverts commit 489f3ad9e1a5f1c6d2c9c2d1bf8a8757d2179e23. --- Spore ModAPI/Spore/Simulator/cIdentityColorable.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h index d51fa29b..339073a8 100644 --- a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h +++ b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h @@ -54,7 +54,6 @@ namespace Simulator /// class cIdentityColorable { - public: static const uint32_t TYPE = 0x5593A1A; @@ -72,7 +71,7 @@ namespace Simulator void AssignNames(const eastl::string16& speciesName); public: - /* 04h */ IdentityColors mIDColorID; // 0x53DBCF1 + /* 04h */ uint32_t mIDColorID; // 0x53DBCF1 /// Names for different entities such as buildings, vehicles, etc. Check `Identity.locale` /* 08h */ eastl::map mEntityNames; /* 24h */ Math::ColorRGB mCachedColor; From de9e709baaadd2b1899baef82056f89162eec0bf Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 01:42:21 -0700 Subject: [PATCH 024/113] Update cIdentityColorable.h --- Spore ModAPI/Spore/Simulator/cIdentityColorable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h index 339073a8..acd3d691 100644 --- a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h +++ b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h @@ -26,7 +26,7 @@ namespace Simulator { - enum class IdentityColors + enum IdentityColors { Player = 0x053dbcf1, Neutral = 0x053dbcf2, From 233dd5c74e1e1fad1cef16b0db4f2fe21605bf62 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 05:30:45 -0700 Subject: [PATCH 025/113] cTribeHut - Document field_218 --- Spore ModAPI/Spore/Simulator/cTribeHut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribeHut.h b/Spore ModAPI/Spore/Simulator/cTribeHut.h index 6035410d..c0094d1c 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeHut.h +++ b/Spore ModAPI/Spore/Simulator/cTribeHut.h @@ -31,7 +31,7 @@ namespace Simulator /* 1F4h */ ResourceKey mDestructModelMd; /* 200h */ ResourceKey mDestructModelHi; /* 20Ch */ ResourceKey mUndamagedModel; - /* 218h */ bool field_218; + /* 218h */ bool field_218; // 'true' makes the hut emit harp music /* 21Ch */ int field_21C; /* 220h */ bool field_220; /* 221h */ bool field_221; From e3e3584d005b5762e4ead8febff605e886e293b3 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 05:42:22 -0700 Subject: [PATCH 026/113] cTribeHut - document field_21C --- Spore ModAPI/Spore/Simulator/cTribeHut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribeHut.h b/Spore ModAPI/Spore/Simulator/cTribeHut.h index c0094d1c..a6a81c3d 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeHut.h +++ b/Spore ModAPI/Spore/Simulator/cTribeHut.h @@ -32,7 +32,7 @@ namespace Simulator /* 200h */ ResourceKey mDestructModelHi; /* 20Ch */ ResourceKey mUndamagedModel; /* 218h */ bool field_218; // 'true' makes the hut emit harp music - /* 21Ch */ int field_21C; + /* 21Ch */ int field_21C; // values above 0 make the hut emit a 'zzz' sleeping effect /* 220h */ bool field_220; /* 221h */ bool field_221; /* 224h */ int field_224; // not initialized From 431ecdd59020e7c8c56a15e54f5574aa9222f166 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 14:05:22 -0700 Subject: [PATCH 027/113] Resolve 4/5 PR change requests --- Projects/Example Projects/ModCreatorKit/Cheats.cpp | 3 +-- Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp | 2 +- .../Example Projects/ModCreatorKit/ModCreatorKit.vcxproj | 2 +- Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp | 2 +- Spore ModAPI/Spore/Simulator/cTribeHut.h | 5 +++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/Cheats.cpp b/Projects/Example Projects/ModCreatorKit/Cheats.cpp index b4e4b27b..2d40edc2 100644 --- a/Projects/Example Projects/ModCreatorKit/Cheats.cpp +++ b/Projects/Example Projects/ModCreatorKit/Cheats.cpp @@ -53,8 +53,7 @@ void AddCheats() CheatManager.AddCheat("devPackage", new PackageCheat()); CheatManager.AddCheat("devLogUI", new UILogCheat()); CheatManager.AddCheat("devInspectUI", new UIInspectCheat()); - - CheatManager.AddCheat("PrintCursor", new PrintCursorCheat()); + CheatManager.AddCheat("devPrintCursor", new PrintCursorCheat()); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x1498444, 0x1493E5C)), "devRaid"); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x149845C, 0x1493E74)), "devSpace"); diff --git a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp index 6914c060..86b66e4f 100644 --- a/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp +++ b/Projects/Example Projects/ModCreatorKit/EffectLogCheat.cpp @@ -26,5 +26,5 @@ void EffectLogCheat::ParseLine(const ArgScript::Line& line) const char* EffectLogCheat::GetDescription(ArgScript::DescriptionMode mode) const { - return "Usage: animLog on/off. If enabled, every time an animation is loaded it will print its ID."; + return "Usage: effectLog on/off. If enabled, every time an effect is loaded it will print its ID."; } \ No newline at end of file diff --git a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj index b609e89e..778effef 100644 --- a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj +++ b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj @@ -44,7 +44,7 @@ true - C:\ProgramData\SPORE ModAPI Launcher Kit\coreLibs;$(DXSDK_DIR)\Include;$(SporeSdkPath)Spore ModAPI;$(SporeSdkPath)EASTL-3.02.01\test\packages\EABase\include\Common;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAAssert\include;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAStdC\include;$(SporeSdkPath)EASTL-3.02.01\include;$(SporeSdkPath)Detours\include\;C:\Users\Allison\source\SourceEngine2007-master\src_main\dx9sdk\Include;$(IncludePath) + $(DXSDK_DIR)\Include;$(SporeSdkPath)Spore ModAPI;$(SporeSdkPath)EASTL-3.02.01\test\packages\EABase\include\Common;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAAssert\include;$(SporeSdkPath)EASTL-3.02.01\test\packages\EAStdC\include;$(SporeSdkPath)EASTL-3.02.01\include;$(SporeSdkPath)Detours\include\;$(IncludePath) $(DXSDK_DIR)Lib\x86;$(SporeLauncherPath)coreLibs;$(SporeSdkPath)Detours\lib.X86;$(SporeSdkPath)lib\Debug;$(LibraryPath) $(ProjectName) $(SporeLauncherPath)mLibs\ diff --git a/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp index d07b5c9e..76fbba31 100644 --- a/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp +++ b/Projects/Example Projects/ModCreatorKit/PrintCursorCheat.cpp @@ -12,6 +12,6 @@ const char* PrintCursorCheat::GetDescription(ArgScript::DescriptionMode mode) co return "Prints the ID of the current cursor to the console."; } else { - return "PrintCursor: Prints the ID of the current cursor to the console."; + return "DevPrintCursor: Prints the ID of the current cursor to the console."; } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cTribeHut.h b/Spore ModAPI/Spore/Simulator/cTribeHut.h index a6a81c3d..e0e2f5b8 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeHut.h +++ b/Spore ModAPI/Spore/Simulator/cTribeHut.h @@ -31,8 +31,9 @@ namespace Simulator /* 1F4h */ ResourceKey mDestructModelMd; /* 200h */ ResourceKey mDestructModelHi; /* 20Ch */ ResourceKey mUndamagedModel; - /* 218h */ bool field_218; // 'true' makes the hut emit harp music - /* 21Ch */ int field_21C; // values above 0 make the hut emit a 'zzz' sleeping effect + /* 218h */ bool mbEmitHarpMusic; + /// values above 0 make the hut emit a 'zzz' sleeping effect + /* 21Ch */ int mIsSleeping; /* 220h */ bool field_220; /* 221h */ bool field_221; /* 224h */ int field_224; // not initialized From 9fa604747067e616dd538eb635b5a820e820a8b1 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 14:15:05 -0700 Subject: [PATCH 028/113] add 'class' to identitycolor enum --- Spore ModAPI/Spore/Simulator/cIdentityColorable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h index acd3d691..01c6722e 100644 --- a/Spore ModAPI/Spore/Simulator/cIdentityColorable.h +++ b/Spore ModAPI/Spore/Simulator/cIdentityColorable.h @@ -26,7 +26,7 @@ namespace Simulator { - enum IdentityColors + enum class IdentityColors : uint32_t { Player = 0x053dbcf1, Neutral = 0x053dbcf2, From d7fee33f3bcff1a753e0eb107d3513ad0592a9bc Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 20 Sep 2024 21:46:46 -0700 Subject: [PATCH 029/113] SpawnNpcTribe's 4rd interger arg = foodAmount --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index e77f6e14..9fe51eed 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -159,7 +159,7 @@ namespace Simulator }; ASSERT_SIZE(cTribe, 0x19E0); - cTribe* SpawnNpcTribe(const Math::Vector3& position, int tribeArchetype, int numMembers, int, bool, cSpeciesProfile* species); + cTribe* SpawnNpcTribe(const Math::Vector3& position, int tribeArchetype, int numMembers, int foodAmount, bool, cSpeciesProfile* species); } namespace Addresses(Simulator) { From 8c2520c5e18e172093e9b8dcfb5c4e56d721403a Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 27 Sep 2024 23:28:27 -0700 Subject: [PATCH 030/113] fix typo --- Spore ModAPI/Spore/UTFWin/IWindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/UTFWin/IWindow.h b/Spore ModAPI/Spore/UTFWin/IWindow.h index c2f30b40..18a691f6 100644 --- a/Spore ModAPI/Spore/UTFWin/IWindow.h +++ b/Spore ModAPI/Spore/UTFWin/IWindow.h @@ -176,7 +176,7 @@ namespace UTFWin /* 4Ch */ virtual int func19() const = 0; /// - /// Sets the unique ID of this object. This ID is used to identfy windows, as it is the one used by FindWindowByID(). + /// Sets the unique ID of this object. This ID is used to identify windows, as it is the one used by FindWindowByID(). /// This ID can also be used on message handling, to check what window raised the message. /// @param controlID The new value of the 'controlID' property. /// From c16de41f0267201a12879423ede5205db76f5f53 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 30 Sep 2024 01:29:20 -0700 Subject: [PATCH 031/113] fix typo in LoadBackgroundFiles --- Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp | 2 +- Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp | 2 +- Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h | 4 ++-- Spore ModAPI/Spore/Simulator/cTribeTool.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp b/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp index e6553820..215b4adf 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp @@ -176,7 +176,7 @@ namespace Editors DefineAddress(SwitchBackground, SelectAddress(0x62F5F0, 0x62F640)); DefineAddress(DisableBackground, SelectAddress(0x62F900, 0x62F950)); DefineAddress(Load, SelectAddress(0x62FC70, 0x62FCC0)); - DefineAddress(LoadBackgroudFiles, SelectAddress(0x62FBA0, 0x62FBF0)); + DefineAddress(LoadBackgroundFiles, SelectAddress(0x62FBA0, 0x62FBF0)); DefineAddress(HandleUIButton, SelectAddress(0x62F7D0, 0x62F820)); DefineAddress(ToggleBackgroundButtonHighlights, SelectAddress(0x62F320, 0x62F370)); DefineAddress(UpdatePageNumbers, SelectAddress(0x62F520, 0x62F570)); diff --git a/Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp b/Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp index 9c3c3c94..2fd30c5b 100644 --- a/Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp +++ b/Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp @@ -111,7 +111,7 @@ namespace Editors Args(PlayModeUI* a1, uint32_t a2, uint32_t a3, Graphics::ILightingWorld* a4, int8_t a5), Args(a1, a2, a3, a4, a5)); - auto_METHOD_VOID(PlayModeBackgrounds, LoadBackgroudFiles, + auto_METHOD_VOID(PlayModeBackgrounds, LoadBackgroundFiles, Args(int8_t backgroundSet), Args(backgroundSet)); auto_METHOD(PlayModeBackgrounds, bool, HandleUIButton, diff --git a/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h b/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h index a78a7fe0..ea2d9376 100644 --- a/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h +++ b/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h @@ -29,7 +29,7 @@ namespace Editors void Load(PlayModeUI* playModeUI, uint32_t entryEffectID, uint32_t crossFadeSnapEffectID, Graphics::ILightingWorld* lightingWorld, int8_t backgroundSet); - void LoadBackgroudFiles(int8_t backgroundSet); + void LoadBackgroundFiles(int8_t backgroundSet); bool HandleUIButton(uint32_t controlID); @@ -65,7 +65,7 @@ namespace Editors DeclareAddress(SwitchBackground); DeclareAddress(DisableBackground); DeclareAddress(Load); // 0x62FC70 0x62FCC0 - DeclareAddress(LoadBackgroudFiles); // 0x62FBA0 0x62FBF0 + DeclareAddress(LoadBackgroundFiles); // 0x62FBA0 0x62FBF0 DeclareAddress(HandleUIButton); // 0x62F7D0 0x62F820 DeclareAddress(ToggleBackgroundButtonHighlights); // 0x62F320 0x62F370 DeclareAddress(UpdatePageNumbers); // 0x62F520 0x62F570 diff --git a/Spore ModAPI/Spore/Simulator/cTribeTool.h b/Spore ModAPI/Spore/Simulator/cTribeTool.h index 79031f27..841616a4 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeTool.h +++ b/Spore ModAPI/Spore/Simulator/cTribeTool.h @@ -24,7 +24,7 @@ namespace Simulator using Object::Cast; public: - /* 1ECh */ float field_1EC; + /* 1ECh */ uint32_t field_1EC; /* 1F0h */ int field_1F0; /* 1F4h */ int field_1F4; /* 1F8h */ int field_1F8; From 4053ad8e41858f74a54eef01d0546acec097b7f2 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 30 Sep 2024 16:28:06 -0700 Subject: [PATCH 032/113] Add message enums to SimulatorMessages.h, organize by stage --- .../Spore/Simulator/SimulatorMessages.h | 167 ++++++++++++++++-- 1 file changed, 156 insertions(+), 11 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index d3a09353..8fcf1b53 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -45,6 +45,117 @@ namespace Simulator /// Simulator::CombatantKilledMessage; called when a combatant is killed kMsgCombatantKilled = 0x1622184, + /// kills persistant swarm effects. Used at the end of certain stages + kMsgKillPersistentEffects = 0x0667af52, + + ////////////////// + // Cell Stage + ////////////////// + + // Sent when the cell stage intro cinematic effect ends + kMsgCinematicGGE2CLGEnds = 0x04065b23, + + /// Sent when cell stage has begun + kMsgCellStageStart = 0x047c1d19, + + + ////////////////// + // Creature Stage + ////////////////// + + /// Hatches the avatar creature's egg in creature stage + kMsgHatchAvatarEggs = 0x06566531, + + /// Upgrades the player's nest to the current brain level(?) in creature stage + kMsgUpgradeNest = 0x06555abc, + + /// Respawns the avatar creature at their nest in creature stage + kMsgRestartAtNest = 0x04f60b92, + + /// Loads the avatar into the creature editor + kEnterCreatureEditor = 0x04d9686f, + + /// TODO, uses data + //kCinematicCRG2TRGPreload = 0x04b719d4, + + /// Transitions creature stage to tribal stage + kMsgCinematicTransitionToTribe = 0x0477f66c, + + /////////////// + // Tribe Stage + /////////////// + + /// Upgrades the player tribe's main hut + kMsgTribeUpgradeHut = 0x0575116e, + + /// Upgrades the player tribe's campfire and layout decal + kMsgTribeUpgradeCampfire = 0x0575116f, + + /// Upgrades the player tribe's totem base and food mat + kMsgTribeUpgradeFoodMat = 0x05751170, + + /// Restarts the tribal stage (as though tribal hut has been destroyed) + kMsgTribeRestart = 0x0420e32a, + + /// Sent to notify the game that a new tribal totem needs to be added + kMsgNotifyTotemNeeded = 0x05cd5482, + + /// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save + kMsgNotifyUpgradeDone = 0x05cd5482, + + /// Moves the tribal camera back + kMsgTribeMoveCameraBack = 0x056cf231, + + /// TRG2CVG - Shows the city hall + kMsgCinematicTRG2CVGShowCityHall = 0x069479a8, + + /// TRG2CVG - Hides the city hall + kMsgCinematicTRG2CVGHideCityHall = 0x0694797d, + + ///////////// + // Civ Stage + ///////////// + + /// Sent when the cutscene for a new city appearing plays in civ stage + kMsgCinematicNewCityAppears = 0x05668f43, + + /// Sent when the captured city's buildings restart their runtime effects in civ stage + kMsgCinematicCityChangeStartBuildingsEffects = 0x05f4d02a, + + /// Sent when the captured city's buildings swap their models in civ stage + kMsgCinematicCityChangeSwapBuildings = 0x05dfb77f, + + /// Sent when the captured city's wall color changes in civ stage + kMsgCinematicCityChangeChangeWallColor = 0x05dfb782, + + /// Sent when the captured city's civilization ownership changes in civ stage + kMsgCinematicCityChangeChangeCivilization = 0x05dbc31e, + + /// Sent when a tier 3 superweapon cutscene begins in civ stage (?) + kMsgCivTriggerSuperweapon = 0x06524f8f, + + /// Sent when the UFO appears at the very end of civ stage + kMsgShowUFOForTransition = 0x0590cd26, + + /////////////// + // Space Stage + /////////////// + + /// Sent when the player gets new tools in a space stage cutscene (TODO: Does this also get called outside of cutscenes?) + kMsgCinematicSpaceGetTools = 0x06526395, + + /// Sent from the cutscene where the player first picks up spice in space stage + kMsgCinematicSpaceFirstSpicePickup = 0x06834927, + + /// Plays the "UFO Effect" of swirly lights appearing around the player's ship in a space stage cutscene + kMsgCinematicSpaceUFOEffect = 0x0665e639, + + /// Sent when a new badge appears on the screen in space stage + kMsgCinematicScreenBadgeEffect = 0x0665e1ab, + + /// Sent when the atmosphere dome goes down on a space stage colony (TODO: Does this also get called outside of cutscenes?) + kMsgCinematicSpaceColonyAtmosphereDomeDown = 0x065e622c, + /// Simulator::PlayerEmpireAlliedMessage; called when the player empire makes a new alliance kMsgPlayerEmpireAllied = 0x4445D43, @@ -57,17 +168,6 @@ namespace Simulator /// Simulator::ToolOnHitMessage; called when a space tool hits a target kMsgToolOnHit = 0x56690BB, - /// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode - kMsgScenarioCreatureHealed = 0x7C789F8, - - /// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy - kMsgScenarioEnergyConsumed = 0x7C7A52E, - - /// No data, called when pressing the undo button in the scenario editor - kMsgScenarioUndo = 0xC9D86390, - /// No data, called when pressing the redo button in the scenario editor - kMsgScenarioRedo = 0xC9D86391, - /// Message emitted by the galaxy generation effect to create stars of StarType::StarG (yellow) type. kMsgGalaxyGenerateStarG = 0x35B2B15, /// Message emitted by the galaxy generation effect to create stars of StarType::StarO (blue) type. @@ -100,6 +200,51 @@ namespace Simulator /// Sent when the ownership of some star changes. No parameters. kMsgStarOwnershipChanged = 0x55BD8F7, + + ///////////////// + // Scenario Mode + ///////////////// + + /// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode + kMsgScenarioCreatureHealed = 0x7C789F8, + + /// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy + kMsgScenarioEnergyConsumed = 0x7C7A52E, + + /// No data, called when pressing the undo button in the scenario editor + kMsgScenarioUndo = 0xC9D86390, + /// No data, called when pressing the redo button in the scenario editor + kMsgScenarioRedo = 0xC9D86391, + + /// Called when the captain is finished beaming down in scenario mode + kMsgCinematicScenarioBeamDownComplete = 0x078eab55, + + /// Removes the avatar from a scenario cutscene + kMsgCinematicScenarioClearAvatar = 0x07b509fe, + + /// Called when the size of the talked-to creature or object is being calculated. (TODO: Seems to generate one of 3 values, how to access these?) + kMsgCinematicTalkToSizeSetup = 0x07d0c530, + + /// Called when the greeting style of the talked-to creature is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToGreetSetup = 0x07da0410, + + /// Called when the textbox style of the talked-to creature or object is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToTextSetup = 0x0754ae8a, + + /// Called when the animation style (sentient, animal, epic) of the talked-to creature is being determined. (TODO: Seems to generate one of 3 values, how to access these?) + kMsgCinematicTalkToAnimStyleSetup = 0x07688cad, + + /// Called when the animation emotion of the talked-to creature is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToAnimEmotionSetup = 0x07688cad, + + /// Called when the page waiting style (wait for next or wait for last) of the talk-to dialogue is being determined (TODO: Seems to generate one of 2 values, how to access these?) + kMsgCinematicTalkToPageSetup = 0x0750d732, + + /// Called when the talk-to dialogue skips a blank page + kMsgCinematicTalkToSkipBlankPage = 0x07aaa58c, + + + }; class IMessageParameters From afad808204e3218f12c56535b62315f93eddf575 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Tue, 1 Oct 2024 16:40:23 -0700 Subject: [PATCH 033/113] fix typo --- Spore ModAPI/Spore/UTFWin/IButton.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/UTFWin/IButton.h b/Spore ModAPI/Spore/UTFWin/IButton.h index 9c9207c4..77146b09 100644 --- a/Spore ModAPI/Spore/UTFWin/IButton.h +++ b/Spore ModAPI/Spore/UTFWin/IButton.h @@ -38,7 +38,7 @@ namespace UTFWin kBtnFlagFixedHeight = 0x00000004 }; - /// Flags relted to the state of a button that can be set to an UTFWin::IButton. + /// Flags related to the state of a button that can be set to an UTFWin::IButton. enum ButtonStateFlags { kBtnStateSelected = 4 From 25cee871037b466439b70a6b20f8b768670dc644 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 2 Oct 2024 04:26:15 -0700 Subject: [PATCH 034/113] Clarify new simulator messages --- Spore ModAPI/Spore/Simulator/SimulatorMessages.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index 8fcf1b53..3ca790e9 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -66,7 +66,7 @@ namespace Simulator /// Hatches the avatar creature's egg in creature stage kMsgHatchAvatarEggs = 0x06566531, - /// Upgrades the player's nest to the current brain level(?) in creature stage + /// Upgrades the player's nest to the current brain level(?) in creature stage. May be cutscene only. kMsgUpgradeNest = 0x06555abc, /// Respawns the avatar creature at their nest in creature stage @@ -85,13 +85,13 @@ namespace Simulator // Tribe Stage /////////////// - /// Upgrades the player tribe's main hut + /// Upgrades the player tribe's main hut (Cutscene only) kMsgTribeUpgradeHut = 0x0575116e, - /// Upgrades the player tribe's campfire and layout decal + /// Upgrades the player tribe's campfire and layout decal (Cutscene only) kMsgTribeUpgradeCampfire = 0x0575116f, - /// Upgrades the player tribe's totem base and food mat + /// Upgrades the player tribe's totem base and food mat (Cutscene only) kMsgTribeUpgradeFoodMat = 0x05751170, /// Restarts the tribal stage (as though tribal hut has been destroyed) @@ -103,8 +103,8 @@ namespace Simulator /// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save kMsgNotifyUpgradeDone = 0x05cd5482, - /// Moves the tribal camera back - kMsgTribeMoveCameraBack = 0x056cf231, + /// Moves the tribal camera to point towards the center of your tribe + kMsgTribeMoveCameraToTribe = 0x056cf231, /// TRG2CVG - Shows the city hall kMsgCinematicTRG2CVGShowCityHall = 0x069479a8, From 488c26aa13d21962c622d5191e8a2d75e0055d1c Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 2 Oct 2024 04:27:01 -0700 Subject: [PATCH 035/113] Clarify more messages --- Spore ModAPI/Spore/Simulator/SimulatorMessages.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index 3ca790e9..629468e8 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -94,22 +94,22 @@ namespace Simulator /// Upgrades the player tribe's totem base and food mat (Cutscene only) kMsgTribeUpgradeFoodMat = 0x05751170, - /// Restarts the tribal stage (as though tribal hut has been destroyed) - kMsgTribeRestart = 0x0420e32a, - - /// Sent to notify the game that a new tribal totem needs to be added + /// Sent to notify the game that a new tribal totem needs to be added (Cutscene only) kMsgNotifyTotemNeeded = 0x05cd5482, - - /// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save + + /// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save (Cutscene only) kMsgNotifyUpgradeDone = 0x05cd5482, + + /// Restarts the tribal stage (as though tribal hut has been destroyed) + kMsgTribeRestart = 0x0420e32a, /// Moves the tribal camera to point towards the center of your tribe kMsgTribeMoveCameraToTribe = 0x056cf231, - /// TRG2CVG - Shows the city hall + /// TRG2CVG - Shows the city hall (Cutscene only) kMsgCinematicTRG2CVGShowCityHall = 0x069479a8, - /// TRG2CVG - Hides the city hall + /// TRG2CVG - Hides the city hall (Cutscene only) kMsgCinematicTRG2CVGHideCityHall = 0x0694797d, ///////////// From a0ee254b4e626823156d73a6bdd2e3dfa09c2845 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 2 Oct 2024 18:01:54 -0700 Subject: [PATCH 036/113] Add messages, change 1 type --- Spore ModAPI/Spore/Palettes/StandardItemUI.h | 2 +- .../Spore/Simulator/SimulatorMessages.h | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Palettes/StandardItemUI.h b/Spore ModAPI/Spore/Palettes/StandardItemUI.h index 6c400ae4..1881c513 100644 --- a/Spore ModAPI/Spore/Palettes/StandardItemUI.h +++ b/Spore ModAPI/Spore/Palettes/StandardItemUI.h @@ -43,7 +43,7 @@ namespace Palettes public: /* 0Ch */ PaletteItemPtr mpItem; - /* 10h */ int field_10; + /* 10h */ uint32_t field_10; /* 14h */ ItemViewerPtr mpViewer; /* 18h */ IWindowPtr field_18; /* 1Ch */ bool field_1C; diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index 629468e8..1d9b5e4c 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -31,11 +31,17 @@ namespace Simulator /// Simulator::EnterEditorMessage; Enters the correct editor modifying the specified creation. kMsgEnterEditor = 0x53850BAE, + // Switches the editor. Use the desired editor ID as the message data . + kMsgSwitchEditor = 0x0212D3E7, + kMsgSwitchGameMode = 0x0212D3E7, /// Saves the game, pausing the game and showing a dialog on success. Use with message data `1` (as in, an integer). kMsgSaveGame = 0x1CD20F0, + /// Sent when loading a saved game. + kMessageLoadGame = 0xf8b1a2af, + /// Simulator::GameNounStatusChangedMessage kMsgGameNounStatusChanged = 0x1A0219E, @@ -58,6 +64,9 @@ namespace Simulator /// Sent when cell stage has begun kMsgCellStageStart = 0x047c1d19, + /// Sent when cell stage is transitioning to creature stage + kMsgCellToCreatureTransition = 0x02A4f8f0, + ////////////////// // Creature Stage @@ -79,7 +88,10 @@ namespace Simulator //kCinematicCRG2TRGPreload = 0x04b719d4, /// Transitions creature stage to tribal stage - kMsgCinematicTransitionToTribe = 0x0477f66c, + kMsgTransitionToTribe = 0x0477f66c, + + /// Sent when the avatar creature transitions from creature stage to tribal stage (what is the difference between these?) + kMsgCreatureToTribeTransition = 0x0477f66c, /////////////// // Tribe Stage @@ -141,6 +153,9 @@ namespace Simulator // Space Stage /////////////// + /// Sent when launching a space stage game form the main menu + kMsgSpaceGameFromLaunchScreen = 0x02364016, + /// Sent when the player gets new tools in a space stage cutscene (TODO: Does this also get called outside of cutscenes?) kMsgCinematicSpaceGetTools = 0x06526395, From 8276e413a35ef018adeb59357eb4b74e019812c0 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 2 Oct 2024 18:27:15 -0700 Subject: [PATCH 037/113] Update SimulatorMessages.h --- .../Spore/Simulator/SimulatorMessages.h | 141 ++++++++++++++++-- 1 file changed, 128 insertions(+), 13 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index 2a16f4b6..be2874b9 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -32,11 +32,17 @@ namespace Simulator /// Simulator::EnterEditorMessage; Enters the correct editor modifying the specified creation. kMsgEnterEditor = 0x53850BAE, + /// Switches the editor. Use the desired editor ID as the message data . + kMsgSwitchEditor = 0x0212D3E7, + kMsgSwitchGameMode = 0x0212D3E7, /// Saves the game, pausing the game and showing a dialog on success. Use with message data `1` (as in, an integer). kMsgSaveGame = 0x1CD20F0, + /// Sent when loading a saved game. + kMessageLoadGame = 0xf8b1a2af, + /// Simulator::GameNounStatusChangedMessage kMsgGameNounStatusChanged = 0x1A0219E, @@ -46,6 +52,128 @@ namespace Simulator /// Simulator::CombatantKilledMessage; called when a combatant is killed kMsgCombatantKilled = 0x1622184, + /// kills persistant swarm effects. Used at the end of certain stages + kMsgKillPersistentEffects = 0x0667af52, + + /// Simulator::DoCinematicActionMessage ; sent to execute a single action within a cinematic stage + kMsgDoCinematicAction = 0x4470A41, + + ////////////////// + // Cell Stage + ////////////////// + + // Sent when the cell stage intro cinematic effect ends + kMsgCinematicGGE2CLGEnds = 0x04065b23, + + /// Sent when cell stage has begun + kMsgCellStageStart = 0x047c1d19, + + /// Sent when cell stage is transitioning to creature stage + kMsgCellToCreatureTransition = 0x02A4f8f0, + + ////////////////// + // Creature Stage + ////////////////// + + /// Hatches the avatar creature's egg in creature stage + kMsgHatchAvatarEggs = 0x06566531, + + /// Upgrades the player's nest to the current brain level(?) in creature stage. May be cutscene only. + kMsgUpgradeNest = 0x06555abc, + + /// Respawns the avatar creature at their nest in creature stage + kMsgRestartAtNest = 0x04f60b92, + + /// Loads the avatar into the creature editor + kEnterCreatureEditor = 0x04d9686f, + + /// TODO, uses data + //kCinematicCRG2TRGPreload = 0x04b719d4, + + /// Transitions creature stage to tribal stage + kMsgTransitionToTribe = 0x0477f66c, + + /// Sent when the avatar creature transitions from creature stage to tribal stage (what is the difference between these?) + kMsgCreatureToTribeTransition = 0x0477f66c, + + /////////////// + // Tribe Stage + /////////////// + + /// Upgrades the player tribe's main hut (Cutscene only) + kMsgTribeUpgradeHut = 0x0575116e, + + /// Upgrades the player tribe's campfire and layout decal (Cutscene only) + kMsgTribeUpgradeCampfire = 0x0575116f, + + /// Upgrades the player tribe's totem base and food mat (Cutscene only) + kMsgTribeUpgradeFoodMat = 0x05751170, + + /// Sent to notify the game that a new tribal totem needs to be added (Cutscene only) + kMsgNotifyTotemNeeded = 0x05cd5482, + + /// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save (Cutscene only) + kMsgNotifyUpgradeDone = 0x05cd5482, + + /// Restarts the tribal stage (as though tribal hut has been destroyed) + kMsgTribeRestart = 0x0420e32a, + + /// Moves the tribal camera to point towards the center of your tribe + kMsgTribeMoveCameraToTribe = 0x056cf231, + + /// TRG2CVG - Shows the city hall (Cutscene only) + kMsgCinematicTRG2CVGShowCityHall = 0x069479a8, + + /// TRG2CVG - Hides the city hall (Cutscene only) + kMsgCinematicTRG2CVGHideCityHall = 0x0694797d, + + ///////////// + // Civ Stage + ///////////// + + /// Sent when the cutscene for a new city appearing plays in civ stage + kMsgCinematicNewCityAppears = 0x05668f43, + + /// Sent when the captured city's buildings restart their runtime effects in civ stage + kMsgCinematicCityChangeStartBuildingsEffects = 0x05f4d02a, + + /// Sent when the captured city's buildings swap their models in civ stage + kMsgCinematicCityChangeSwapBuildings = 0x05dfb77f, + + /// Sent when the captured city's wall color changes in civ stage + kMsgCinematicCityChangeChangeWallColor = 0x05dfb782, + + /// Sent when the captured city's civilization ownership changes in civ stage + kMsgCinematicCityChangeChangeCivilization = 0x05dbc31e, + + /// Sent when a tier 3 superweapon cutscene begins in civ stage (?) + kMsgCivTriggerSuperweapon = 0x06524f8f, + + /// Sent when the UFO appears at the very end of civ stage + kMsgShowUFOForTransition = 0x0590cd26, + + /////////////// + // Space Stage + /////////////// + + /// Sent when launching a space stage game form the main menu + kMsgSpaceGameFromLaunchScreen = 0x02364016, + + /// Sent when the player gets new tools in a space stage cutscene (TODO: Does this also get called outside of cutscenes?) + kMsgCinematicSpaceGetTools = 0x06526395, + + /// Sent from the cutscene where the player first picks up spice in space stage + kMsgCinematicSpaceFirstSpicePickup = 0x06834927, + + /// Plays the "UFO Effect" of swirly lights appearing around the player's ship in a space stage cutscene + kMsgCinematicSpaceUFOEffect = 0x0665e639, + + /// Sent when a new badge appears on the screen in space stage + kMsgCinematicScreenBadgeEffect = 0x0665e1ab, + + /// Sent when the atmosphere dome goes down on a space stage colony (TODO: Does this also get called outside of cutscenes?) + kMsgCinematicSpaceColonyAtmosphereDomeDown = 0x065e622c, + /// Simulator::PlayerEmpireAlliedMessage; called when the player empire makes a new alliance kMsgPlayerEmpireAllied = 0x4445D43, @@ -58,17 +186,6 @@ namespace Simulator /// Simulator::ToolOnHitMessage; called when a space tool hits a target kMsgToolOnHit = 0x56690BB, - /// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode - kMsgScenarioCreatureHealed = 0x7C789F8, - - /// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy - kMsgScenarioEnergyConsumed = 0x7C7A52E, - - /// No data, called when pressing the undo button in the scenario editor - kMsgScenarioUndo = 0xC9D86390, - /// No data, called when pressing the redo button in the scenario editor - kMsgScenarioRedo = 0xC9D86391, - /// Message emitted by the galaxy generation effect to create stars of StarType::StarG (yellow) type. kMsgGalaxyGenerateStarG = 0x35B2B15, /// Message emitted by the galaxy generation effect to create stars of StarType::StarO (blue) type. @@ -102,8 +219,6 @@ namespace Simulator /// Sent when the ownership of some star changes. No parameters. kMsgStarOwnershipChanged = 0x55BD8F7, - /// Simulator::DoCinematicActionMessage ; sent to execute a single action within a cinematic stage - kMsgDoCinematicAction = 0x4470A41, }; class IMessageParameters From cdc5dcec475efa72ddbc09921901126c707a4e69 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 2 Oct 2024 20:20:01 -0700 Subject: [PATCH 038/113] Update SimulatorMessages.h --- .../Spore/Simulator/SimulatorMessages.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index be2874b9..db94d287 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -219,6 +219,47 @@ namespace Simulator /// Sent when the ownership of some star changes. No parameters. kMsgStarOwnershipChanged = 0x55BD8F7, + ///////////////// + // Scenario Mode + ///////////////// + + /// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode + kMsgScenarioCreatureHealed = 0x7C789F8, + + /// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy + kMsgScenarioEnergyConsumed = 0x7C7A52E, + + /// No data, called when pressing the undo button in the scenario editor + kMsgScenarioUndo = 0xC9D86390, + /// No data, called when pressing the redo button in the scenario editor + kMsgScenarioRedo = 0xC9D86391, + + /// Called when the captain is finished beaming down in scenario mode + kMsgCinematicScenarioBeamDownComplete = 0x078eab55, + + /// Removes the avatar from a scenario cutscene + kMsgCinematicScenarioClearAvatar = 0x07b509fe, + + /// Called when the size of the talked-to creature or object is being calculated. (TODO: Seems to generate one of 3 values, how to access these?) + kMsgCinematicTalkToSizeSetup = 0x07d0c530, + + /// Called when the greeting style of the talked-to creature is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToGreetSetup = 0x07da0410, + + /// Called when the textbox style of the talked-to creature or object is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToTextSetup = 0x0754ae8a, + + /// Called when the animation style (sentient, animal, epic) of the talked-to creature is being determined. (TODO: Seems to generate one of 3 values, how to access these?) + kMsgCinematicTalkToAnimStyleSetup = 0x07688cad, + + /// Called when the animation emotion of the talked-to creature is being determined. (TODO: Seems to generate one of 5 values, how to access these?) + kMsgCinematicTalkToAnimEmotionSetup = 0x07688cad, + + /// Called when the page waiting style (wait for next or wait for last) of the talk-to dialogue is being determined (TODO: Seems to generate one of 2 values, how to access these?) + kMsgCinematicTalkToPageSetup = 0x0750d732, + + /// Called when the talk-to dialogue skips a blank page + kMsgCinematicTalkToSkipBlankPage = 0x07aaa58c, }; class IMessageParameters From 9197088eae52fd0fa5d33a9f118dee93f1536f88 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 4 Oct 2024 16:47:40 -0700 Subject: [PATCH 039/113] fix typo --- Spore ModAPI/Spore/Simulator/cCityWalls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCityWalls.h b/Spore ModAPI/Spore/Simulator/cCityWalls.h index 7c4a54c3..25c04814 100644 --- a/Spore ModAPI/Spore/Simulator/cCityWalls.h +++ b/Spore ModAPI/Spore/Simulator/cCityWalls.h @@ -89,7 +89,7 @@ namespace Simulator /* 260h */ float mCityHallDiasHeight; /* 264h */ eastl::intrusive_ptr mpCity; /* 268h */ Vector3 field_268; // 1, 1, 1 - /// A matrix teling which building slots are connected to which slots + /// A matrix telling which building slots are connected to which slots /* 274h */ bool mBuildingLinks[MAX_LAYOUT_SLOTS][MAX_LAYOUT_SLOTS]; /* 338h */ Vector3 mCenterAxis; // not initialized /* 344h */ uint32_t mStyle; // 0x9181A19 From ed9c724ad671dda0e5d34ee0376e63eafdd7c31c Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 6 Oct 2024 18:46:23 -0700 Subject: [PATCH 040/113] Document tribe vars --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- Spore ModAPI/Spore/Simulator/cTribeTool.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 9fe51eed..8795c70b 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -105,7 +105,7 @@ namespace Simulator /* 36Ch */ eastl::vector mTools; /* 380h */ eastl::vector mSocialTools; /* 394h */ eastl::hash_map field_394; - /* 3B4h */ cCommunityLayout field_3B4; + /* 3B4h */ cCommunityLayout mTribeLayout; /* 418h */ eastl::fixed_vector field_418; /* 4E4h */ eastl::hash_map> field_4E4; /* 504h */ int field_504; // not initialized diff --git a/Spore ModAPI/Spore/Simulator/cTribeTool.h b/Spore ModAPI/Spore/Simulator/cTribeTool.h index 841616a4..004f406d 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeTool.h +++ b/Spore ModAPI/Spore/Simulator/cTribeTool.h @@ -24,11 +24,11 @@ namespace Simulator using Object::Cast; public: - /* 1ECh */ uint32_t field_1EC; + /* 1ECh */ uint32_t field_1EC; // value always seems to be 0x1984618, at least in player villages /* 1F0h */ int field_1F0; /* 1F4h */ int field_1F4; /* 1F8h */ int field_1F8; - /* 1FCh */ int mToolType; + /* 1FCh */ uint32_t mToolType; // value seems usually to be 0x1b5e3868, at least in player villages /* 200h */ cGonzagoTimer mCreationTimer; /* 220h */ cGonzagoTimer mDestroyedTimer; /* 240h */ int field_240; From 4ca2586d7d1387235f4797323bad5d84d6d92c06 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 7 Oct 2024 15:16:23 -0700 Subject: [PATCH 041/113] Document cTribe.mbMembersFlee, add Button funcs, fix documentation comments --- Spore ModAPI/Spore ModAPI.vcxproj | 1 + Spore ModAPI/Spore ModAPI.vcxproj.filters | 3 ++ Spore ModAPI/Spore/Simulator/cCommunity.h | 2 +- .../Spore/Simulator/cCommunityLayout.h | 2 +- Spore ModAPI/Spore/Simulator/cTribe.h | 4 +-- Spore ModAPI/Spore/UTFWin/IButton.cpp | 32 +++++++++++++++++++ Spore ModAPI/Spore/UTFWin/IButton.h | 5 +++ 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Spore ModAPI/Spore/UTFWin/IButton.cpp diff --git a/Spore ModAPI/Spore ModAPI.vcxproj b/Spore ModAPI/Spore ModAPI.vcxproj index a4ed439d..f70c782b 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj +++ b/Spore ModAPI/Spore ModAPI.vcxproj @@ -1074,6 +1074,7 @@ + diff --git a/Spore ModAPI/Spore ModAPI.vcxproj.filters b/Spore ModAPI/Spore ModAPI.vcxproj.filters index 13b5f31e..f1bf6485 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj.filters +++ b/Spore ModAPI/Spore ModAPI.vcxproj.filters @@ -2678,6 +2678,9 @@ Source Files + + Source Files + diff --git a/Spore ModAPI/Spore/Simulator/cCommunity.h b/Spore ModAPI/Spore/Simulator/cCommunity.h index f7d3578d..e1f790bb 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunity.h +++ b/Spore ModAPI/Spore/Simulator/cCommunity.h @@ -77,7 +77,7 @@ namespace Simulator /* 68h */ virtual void func68h(); /* 6Ch */ virtual cCityWalls* GetCityWalls(); // returns 0 /* 70h */ virtual eastl::vector& GetPopulation(); - /* 74h */ virtual int GetPopulationCount(); // returns the count of vector returned by func70h + /* 74h */ virtual int GetPopulationCount(); // returns the count of vector returned by GetPopulation() /* 78h */ virtual void func78h(); /* 7Ch */ virtual eastl::string16& GetCommunityName(); /* 80h */ virtual void func80h(); diff --git a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h index 6aff8d2a..6eb63701 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h +++ b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h @@ -12,7 +12,7 @@ namespace Simulator /* 00h */ bool mIsOccupied; /// A building, turret, ornament, etc /* 04h */ cGameDataPtr mpObject; - /* 08h */ int field_8; + /* 08h */ int field_8; // 0 /* 0Ch */ Math::Vector3 mPosition; }; ASSERT_SIZE(cLayoutSlot, 0x18); diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 8795c70b..f457734a 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -116,7 +116,7 @@ namespace Simulator /* 550h */ int mTribeArchetype; //TODO /* 554h */ bool field_554; /* 555h */ bool field_555; - /* 556h */ bool field_556; + /* 556h */ bool mbMembersFlee; // if true, creatures run away in fear /* 557h */ bool mGoodyPopped; /* 558h */ char _padding_558[0x1310]; /* 1868h */ int field_1868; @@ -139,7 +139,7 @@ namespace Simulator /* 18A4h */ int field_18A4; // -1 /* 18A8h */ bool field_18A8; /* 18A9h */ bool field_18A9; - /* 18ACh */ int field_18AC; // not initialized + /* 18ACh */ uint32_t field_18AC; // not initialized /* 18B0h */ int field_18B0; /* 18B4h */ int field_18B4; /* 18B8h */ int field_18B8; diff --git a/Spore ModAPI/Spore/UTFWin/IButton.cpp b/Spore ModAPI/Spore/UTFWin/IButton.cpp new file mode 100644 index 00000000..c953414c --- /dev/null +++ b/Spore ModAPI/Spore/UTFWin/IButton.cpp @@ -0,0 +1,32 @@ +/**************************************************************************** +* Copyright (C) 2024 Eric Mor, Allison Ghost +* +* This file is part of Spore ModAPI. +* +* Spore ModAPI is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +****************************************************************************/ + +#include + +namespace UTFWin +{ + void IButton::SetButtonPressed(bool bValue) { + this->SetButtonFlag(kBtnStateSelected, bValue); + } + + bool IButton::IsButtonPressed() { + return this->GetButtonStateFlags() & 4; + } +} + diff --git a/Spore ModAPI/Spore/UTFWin/IButton.h b/Spore ModAPI/Spore/UTFWin/IButton.h index 77146b09..b76572f1 100644 --- a/Spore ModAPI/Spore/UTFWin/IButton.h +++ b/Spore ModAPI/Spore/UTFWin/IButton.h @@ -177,6 +177,11 @@ namespace UTFWin /// @param format /* 6Ch */ virtual void SetTextOutline(OutlineFormat& format) = 0; + /// Custom method that sets if the button is pressed or not. + void SetButtonPressed(bool bValue); + /// Custom method that returns if the button is pressed or not. + bool IsButtonPressed(); + static IButton* Create(); }; From d9a3a710cdcf0aac187b32e31c354e4976a0b6e5 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 7 Oct 2024 18:51:20 -0700 Subject: [PATCH 042/113] Annotate unknown func --- Spore ModAPI/Spore/Simulator/cTribe.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 4b8196e7..aad0674b 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -73,9 +73,10 @@ namespace Simulator /// Returns a vector of all selectable members of the tribe /* 94h */ virtual eastl::vector& GetSelectableMembers(); /* 98h */ virtual cCreatureCitizen* SpawnMember(); - /* 9Ch */ virtual void func9Ch(int, bool); + /// Removes a member of the tribe. index seems to cause issues if not 0. + /* 9Ch */ virtual void func9Ch(int index, bool); /// Calls func9Ch() with second parameter true - /* A0h */ virtual void funcA0h(int); + /* A0h */ virtual void funcA0h(int index); /* A4h */ virtual int GetTotalFood(); /* A8h */ virtual void funcA8h(); /* ACh */ virtual cTribeHut* GetHut(); From 482d47bc788d17735c9480b9529ac80fbfb54e0a Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 9 Oct 2024 14:24:44 -0700 Subject: [PATCH 043/113] Resolve PR issues --- .../SourceCode/DLL/AddressesEditors.cpp | 1 + Spore ModAPI/SourceCode/UTFWin/Window.cpp | 11 +++++++ Spore ModAPI/Spore ModAPI.vcxproj | 1 - Spore ModAPI/Spore ModAPI.vcxproj.filters | 3 -- .../Spore/Editors/PlayModeBackgrounds.h | 1 + .../Spore/Simulator/SimulatorMessages.h | 5 +-- .../Spore/Simulator/cCommunityLayout.h | 2 +- Spore ModAPI/Spore/Simulator/cTribeTool.h | 1 + Spore ModAPI/Spore/UTFWin/IButton.cpp | 32 ------------------- 9 files changed, 16 insertions(+), 41 deletions(-) delete mode 100644 Spore ModAPI/Spore/UTFWin/IButton.cpp diff --git a/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp b/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp index 215b4adf..bd3f3a74 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp @@ -176,6 +176,7 @@ namespace Editors DefineAddress(SwitchBackground, SelectAddress(0x62F5F0, 0x62F640)); DefineAddress(DisableBackground, SelectAddress(0x62F900, 0x62F950)); DefineAddress(Load, SelectAddress(0x62FC70, 0x62FCC0)); + DefineAddress(LoadBackgroudFiles, SelectAddress(0x62FBA0, 0x62FBF0)); DefineAddress(LoadBackgroundFiles, SelectAddress(0x62FBA0, 0x62FBF0)); DefineAddress(HandleUIButton, SelectAddress(0x62F7D0, 0x62F820)); DefineAddress(ToggleBackgroundButtonHighlights, SelectAddress(0x62F320, 0x62F370)); diff --git a/Spore ModAPI/SourceCode/UTFWin/Window.cpp b/Spore ModAPI/SourceCode/UTFWin/Window.cpp index 7245d308..f8704ea7 100644 --- a/Spore ModAPI/SourceCode/UTFWin/Window.cpp +++ b/Spore ModAPI/SourceCode/UTFWin/Window.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -436,4 +437,14 @@ namespace UTFWin return true; }, pWinProc); } + + // Button Funcs + + void IButton::SetButtonPressed(bool bValue) { + this->SetButtonFlag(kBtnStateSelected, bValue); + } + + bool IButton::IsButtonPressed() { + return this->GetButtonStateFlags() & kBtnStateSelected; + } } diff --git a/Spore ModAPI/Spore ModAPI.vcxproj b/Spore ModAPI/Spore ModAPI.vcxproj index daa02764..f89d02e6 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj +++ b/Spore ModAPI/Spore ModAPI.vcxproj @@ -1078,7 +1078,6 @@ - diff --git a/Spore ModAPI/Spore ModAPI.vcxproj.filters b/Spore ModAPI/Spore ModAPI.vcxproj.filters index 933a0fa9..b41c5242 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj.filters +++ b/Spore ModAPI/Spore ModAPI.vcxproj.filters @@ -2690,9 +2690,6 @@ Source Files - - Source Files - diff --git a/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h b/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h index ea2d9376..61e45a30 100644 --- a/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h +++ b/Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h @@ -66,6 +66,7 @@ namespace Editors DeclareAddress(DisableBackground); DeclareAddress(Load); // 0x62FC70 0x62FCC0 DeclareAddress(LoadBackgroundFiles); // 0x62FBA0 0x62FBF0 + DeclareAddress(LoadBackgroudFiles); // legacy DeclareAddress(HandleUIButton); // 0x62F7D0 0x62F820 DeclareAddress(ToggleBackgroundButtonHighlights); // 0x62F320 0x62F370 DeclareAddress(UpdatePageNumbers); // 0x62F520 0x62F570 diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index db94d287..caff5595 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -90,10 +90,7 @@ namespace Simulator /// TODO, uses data //kCinematicCRG2TRGPreload = 0x04b719d4, - /// Transitions creature stage to tribal stage - kMsgTransitionToTribe = 0x0477f66c, - - /// Sent when the avatar creature transitions from creature stage to tribal stage (what is the difference between these?) + /// Transitions from creature stage to tribal stage kMsgCreatureToTribeTransition = 0x0477f66c, /////////////// diff --git a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h index 6eb63701..6aff8d2a 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h +++ b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h @@ -12,7 +12,7 @@ namespace Simulator /* 00h */ bool mIsOccupied; /// A building, turret, ornament, etc /* 04h */ cGameDataPtr mpObject; - /* 08h */ int field_8; // 0 + /* 08h */ int field_8; /* 0Ch */ Math::Vector3 mPosition; }; ASSERT_SIZE(cLayoutSlot, 0x18); diff --git a/Spore ModAPI/Spore/Simulator/cTribeTool.h b/Spore ModAPI/Spore/Simulator/cTribeTool.h index a4b9030a..7b883697 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeTool.h +++ b/Spore ModAPI/Spore/Simulator/cTribeTool.h @@ -50,6 +50,7 @@ namespace Simulator /* 1F0h */ int field_1F0; /* 1F4h */ int field_1F4; /* 1F8h */ eastl::intrusive_ptr mTribe; + /* 1FCh */ int field_1FCpadding; // temp /* 1FCh */ int mToolType; /* 200h */ cGonzagoTimer mCreationTimer; /* 220h */ cGonzagoTimer mDestroyedTimer; diff --git a/Spore ModAPI/Spore/UTFWin/IButton.cpp b/Spore ModAPI/Spore/UTFWin/IButton.cpp deleted file mode 100644 index c953414c..00000000 --- a/Spore ModAPI/Spore/UTFWin/IButton.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -* Copyright (C) 2024 Eric Mor, Allison Ghost -* -* This file is part of Spore ModAPI. -* -* Spore ModAPI is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -****************************************************************************/ - -#include - -namespace UTFWin -{ - void IButton::SetButtonPressed(bool bValue) { - this->SetButtonFlag(kBtnStateSelected, bValue); - } - - bool IButton::IsButtonPressed() { - return this->GetButtonStateFlags() & 4; - } -} - From 20bd733fd0ce21f72d52e81e922737b8f90e6d65 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 9 Oct 2024 15:02:31 -0700 Subject: [PATCH 044/113] Revert cTribeTool temp fix --- Spore ModAPI/Spore/Simulator/cTribeTool.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribeTool.h b/Spore ModAPI/Spore/Simulator/cTribeTool.h index 7b883697..a4b9030a 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeTool.h +++ b/Spore ModAPI/Spore/Simulator/cTribeTool.h @@ -50,7 +50,6 @@ namespace Simulator /* 1F0h */ int field_1F0; /* 1F4h */ int field_1F4; /* 1F8h */ eastl::intrusive_ptr mTribe; - /* 1FCh */ int field_1FCpadding; // temp /* 1FCh */ int mToolType; /* 200h */ cGonzagoTimer mCreationTimer; /* 220h */ cGonzagoTimer mDestroyedTimer; From 5587d33152959921fd5028620040dc4173cfc306 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 10 Oct 2024 13:42:36 -0700 Subject: [PATCH 045/113] fix HandheldItem enum typos --- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index feb1ae22..3bc6dd93 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -773,15 +773,15 @@ namespace Simulator /// trg_hunting_tool1 kHandheldItemTrgHuntingTool1 = 1, /// trg_hunting_tool2 - kHandheldItemTrgHuntingTool1 = 2, + kHandheldItemTrgHuntingTool2 = 2, /// trg_hunting_tool3 - kHandheldItemTrgHuntingTool1 = 3, + kHandheldItemTrgHuntingTool3 = 3, /// trg_fishing_tool and related kHandheldItemTrgFishingTool = 4, /// Either trg_eating_fish or trg_fishing_tool1_fish, etc kHandheldItemTrgFish = 5, /// Either trg_eating_seaweed or trg_fishing_tool1_seaweed, etc - kHandheldItemTrgFish = 6, + kHandheldItemTrgSeaweed = 6, /// trg_eating_fruit kHandheldItemTrgEatingFruit = 7, /// trg_eating_seaweed or trg_eating_fish From 8d5a1e5a05fcbeba3848e47e3f3306e422a34244 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 12 Oct 2024 16:03:14 -0700 Subject: [PATCH 046/113] document tribe vars, rename BakeManager::func4Ch to Bake --- Spore ModAPI/Spore/Editors/BakeManager.h | 2 +- Spore ModAPI/Spore/Simulator/cTribe.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Spore ModAPI/Spore/Editors/BakeManager.h b/Spore ModAPI/Spore/Editors/BakeManager.h index 6b05270e..087401fa 100644 --- a/Spore ModAPI/Spore/Editors/BakeManager.h +++ b/Spore ModAPI/Spore/Editors/BakeManager.h @@ -58,7 +58,7 @@ namespace Editors /* 40h */ virtual void func40h(); /* 44h */ virtual void func44h(); /* 48h */ virtual void func48h(); - /* 4Ch */ virtual void func4Ch(const ResourceKey& nameKey, const BakeParameters& params); // bake? + /* 4Ch */ virtual void Bake(const ResourceKey& nameKey, const BakeParameters& params); // 60h returns IModelWorld diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 1d59f393..99b0a06d 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -106,7 +106,7 @@ namespace Simulator /* 2A8h */ eastl::vector field_2A8; /* 2BCh */ int field_2BC; /* 2C0h */ float mEggPenFoodValue; - /* 2C4h */ float mInitialRelationship; + /* 2C4h */ float mInitialRelationship; // does not seem to change from 0 /* 2C8h */ float mChieftainRespawnTimer; /* 2CCh */ float mGiftRelationshipDecayTimer; /* 2D0h */ ObjectPtr field_2D0; @@ -129,7 +129,7 @@ namespace Simulator /* 310h */ float mClosestWaterDistance; /* 314h */ eastl::vector mClosestForests; /* 328h */ int field_328; // not initialized - /* 32Ch */ int mUpgradeLevel; + /* 32Ch */ int mUpgradeLevel; // may be a uint32 or have errors? /* 330h */ float mZoningRadius; // 30.0 /* 334h */ bool mbRoboTribe; /* 338h */ int mRoboPopulationCount; @@ -151,7 +151,7 @@ namespace Simulator /* 550h */ int mTribeArchetype; //TODO /* 554h */ bool field_554; /* 555h */ bool field_555; - /* 556h */ bool mbMembersFlee; // if true, creatures run away in fear + /* 556h */ bool mbMembersFlee; // if true, creatures run away in fear and die /* 557h */ bool mGoodyPopped; /* 558h */ char _padding_558[0x1310]; /* 1868h */ int field_1868; From 88eb2a10ce86dfa6242c8dceec66c6060c95c3ea Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 16 Oct 2024 12:23:21 -0700 Subject: [PATCH 047/113] Document EditorNamePanel Initialize() --- Spore ModAPI/Spore/UI/EditorNamePanel.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/UI/EditorNamePanel.h b/Spore ModAPI/Spore/UI/EditorNamePanel.h index aecf1a1a..6093dd90 100644 --- a/Spore ModAPI/Spore/UI/EditorNamePanel.h +++ b/Spore ModAPI/Spore/UI/EditorNamePanel.h @@ -20,8 +20,11 @@ namespace UI EditorNamePanel(); ~EditorNamePanel(); + /// Creates a functional renaming UI for a nameable entity (eg Tribes and Cities) + /// allowRename when set to false will gray-out the name field + /// randomNameType when set to 0x0 will hide the randomization button void Initialize(Editors::INameableEntity* pEntity, UTFWin::IWindow* pContainer, uint32_t layoutID, - bool, uint32_t randomNameType); + bool allowRename = true, uint32_t randomNameType = 0x0); void Dispose(); virtual void SetExtended(bool extended); From ac45c89e191cdf538cc2eb454bf99ca09bf9bfe3 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 16 Oct 2024 12:29:37 -0700 Subject: [PATCH 048/113] rename mbMembersFlee to mbDefeated --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 99b0a06d..16ef4e2e 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -151,7 +151,7 @@ namespace Simulator /* 550h */ int mTribeArchetype; //TODO /* 554h */ bool field_554; /* 555h */ bool field_555; - /* 556h */ bool mbMembersFlee; // if true, creatures run away in fear and die + /* 556h */ bool mbDefeated; // if true, creatures run away in fear then die. /* 557h */ bool mGoodyPopped; /* 558h */ char _padding_558[0x1310]; /* 1868h */ int field_1868; From 9aed2e215b62246b58f1c7e5704c58d5ea417a1b Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 17 Oct 2024 02:29:09 -0700 Subject: [PATCH 049/113] String16 serialization fix --- Spore ModAPI/Spore/Simulator/SerializationTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/SerializationTypes.h b/Spore ModAPI/Spore/Simulator/SerializationTypes.h index d6262c28..dea9cfa3 100644 --- a/Spore ModAPI/Spore/Simulator/SerializationTypes.h +++ b/Spore ModAPI/Spore/Simulator/SerializationTypes.h @@ -182,7 +182,7 @@ namespace Simulator if (count > 0) { *dst = eastl::string16(count, ' '); for (size_t i = 0; i < count; ++i) { - IO::ReadInt16(s, (int16_t*)(*dst)[i], 1, IO::Endian::Little); + IO::ReadInt16(s, (int16_t*)(dst->c_str() + i), 1, IO::Endian::Little); } } return true; From d31406050cd8860f0064a39ccf59f049003b1290 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 18 Oct 2024 19:05:18 -0700 Subject: [PATCH 050/113] Update cTribe.h --- Spore ModAPI/Spore/Simulator/cTribe.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 16ef4e2e..73650e08 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -187,7 +188,7 @@ namespace Simulator /* 1904h */ eastl::fixed_vector mSpeciesKeys; /* 19C4h */ cOrnamentPtr mpDomesticatedAnimalsPen; /* 19C8h */ cOrnamentPtr mpEggPen; - /* 19CCh */ cGameDataPtr mpDomesticatedAnimalsHerd; //TODO + /* 19CCh */ cHerdPtr mpDomesticatedAnimalsHerd; //TODO /* 19D0h */ cTotemPolePtr mpTotemPole; /* 19D4h */ uint32_t mhFootprint; /* 19D8h */ int mPurchasedTools; From b7a3b85216b0f7ee68769a97b325c437899711b7 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 23 Oct 2024 17:05:03 -0700 Subject: [PATCH 051/113] re-sort numgraspers next to numfeet in enum --- Spore ModAPI/Spore/Sporepedia/OTDBParameters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h b/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h index 9b2ad62c..4e287282 100644 --- a/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h +++ b/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h @@ -77,11 +77,11 @@ namespace Sporepedia cuteness = 0x2F05C5E, totalSocial = 0x2F05C5F, social = 0x5B15AA5, - numGraspers = 0x2F05C61, meanLookingScore = 0x3FEA210, totalAttack = 0x3FEA1A0, attack = 0x5B15A92, numFeet = 0x3FEA1C0, + numGraspers = 0x2F05C61, biteCapRange = 0x4AB3BD8, strikeCapRange = 0x4AB3BD9, chargeCapRange = 0x4AB3BDA, From 08f62a0b1e71e5e48ddb56bed3015a8dadf26f7a Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 25 Oct 2024 09:17:53 -0700 Subject: [PATCH 052/113] fix typos, document working OTDB params, reformat func28 in OTDB --- Spore ModAPI/Spore/Simulator/SimulatorMessages.h | 4 ++-- Spore ModAPI/Spore/Sporepedia/OTDBParameters.h | 9 +++++---- Spore ModAPI/Spore/Sporepedia/ObjectTemplateDB.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index caff5595..ad5c28bc 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -128,7 +128,7 @@ namespace Simulator // Civ Stage ///////////// - /// Sent when the cutscene for a new city appearing plays in civ stage + /// Sent when the cutscene for a new city appearing plays in civ stage. Not sent when a city is founded outside of a cutscene. kMsgCinematicNewCityAppears = 0x05668f43, /// Sent when the captured city's buildings restart their runtime effects in civ stage @@ -153,7 +153,7 @@ namespace Simulator // Space Stage /////////////// - /// Sent when launching a space stage game form the main menu + /// Sent when launching a space stage game from the main menu kMsgSpaceGameFromLaunchScreen = 0x02364016, /// Sent when the player gets new tools in a space stage cutscene (TODO: Does this also get called outside of cutscenes?) diff --git a/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h b/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h index de02729f..a5541b41 100644 --- a/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h +++ b/Spore ModAPI/Spore/Sporepedia/OTDBParameters.h @@ -65,6 +65,7 @@ namespace Sporepedia namespace Parameters { + // TODO: Some of these don't seem to work; the ones that are verified to work are commented. enum Parameters : uint32_t { type = 0x2DD90AF, @@ -73,13 +74,13 @@ namespace Sporepedia cost = 0x5B06E36, baseGear = 0x2F05C60, height = 0x7358629A, - carnivore = 0x2F05C58, - herbivore = 0x2F05C59, + carnivore = 0x2F05C58, // works + herbivore = 0x2F05C59, // works cuteness = 0x2F05C5E, - totalSocial = 0x2F05C5F, + totalSocial = 0x2F05C5F, // works social = 0x5B15AA5, meanLookingScore = 0x3FEA210, - totalAttack = 0x3FEA1A0, + totalAttack = 0x3FEA1A0, // works attack = 0x5B15A92, numFeet = 0x3FEA1C0, numGraspers = 0x2F05C61, diff --git a/Spore ModAPI/Spore/Sporepedia/ObjectTemplateDB.h b/Spore ModAPI/Spore/Sporepedia/ObjectTemplateDB.h index b7d87e5c..45f5bf38 100644 --- a/Spore ModAPI/Spore/Sporepedia/ObjectTemplateDB.h +++ b/Spore ModAPI/Spore/Sporepedia/ObjectTemplateDB.h @@ -29,7 +29,7 @@ namespace Sporepedia /* 1Ch */ virtual bool func1Ch(); /* 20h */ virtual void func20h(); /* 24h */ virtual bool func24h(eastl::vector& dstKeys, int, const eastl::vector& parameters); - /* 28h */ virtual bool func28h(int, int, int); + /* 28h */ virtual bool func28h(eastl::vector& dstKeys, int, const eastl::vector& parameters); /* 2Ch */ virtual void FindObjects(eastl::vector& dst, const eastl::vector& parameters); //TODO thse functions are placeholders /* 30h */ virtual int func30h(); From d130a7da16e8fdebb988b5aa5e467bdd79ea173e Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 25 Oct 2024 18:49:23 -0700 Subject: [PATCH 053/113] Update SimulatorMessages.h --- .../Spore/Simulator/SimulatorMessages.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index ad5c28bc..a74b6430 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -131,16 +131,25 @@ namespace Simulator /// Sent when the cutscene for a new city appearing plays in civ stage. Not sent when a city is founded outside of a cutscene. kMsgCinematicNewCityAppears = 0x05668f43, - /// Sent when the captured city's buildings restart their runtime effects in civ stage + /// Sent when a vehicle is sent to spice (Cutscene only) + kMsgCinematicSendVehicleToCommodityPart2 = 0x056cfe69, + + /// Sent when a city is captured and plays an effect (TODO: What effect?) (Cutscene only) + kCinematicMessageCityChangeShowCaptureEffect = 0x05f4d02a, + + /// TODO (Cutscene only) + kCinematicMessageCityChangeTriggerVignette = 0x05f4d02a, + + /// Sent when the captured city's buildings restart their runtime effects in civ stage (Cutscene only) kMsgCinematicCityChangeStartBuildingsEffects = 0x05f4d02a, - /// Sent when the captured city's buildings swap their models in civ stage + /// Sent when the captured city's buildings swap their models in civ stage (Cutscene only) kMsgCinematicCityChangeSwapBuildings = 0x05dfb77f, - /// Sent when the captured city's wall color changes in civ stage + /// Sent when the captured city's wall color changes in civ stage (Cutscene only) kMsgCinematicCityChangeChangeWallColor = 0x05dfb782, - /// Sent when the captured city's civilization ownership changes in civ stage + /// Sent when the captured city's civilization ownership changes in civ stage (Cutscene only) kMsgCinematicCityChangeChangeCivilization = 0x05dbc31e, /// Sent when a tier 3 superweapon cutscene begins in civ stage (?) From f00467292a48472904a02857cf9e66db684c2e38 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 26 Oct 2024 01:08:34 -0700 Subject: [PATCH 054/113] remove unnecessary comment --- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index 11e48019..abb09d5a 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -261,7 +261,7 @@ namespace Simulator /* B14h */ float mDamageBoostAmount; // not initialized /* B18h */ bool mHasArmorBoost; /* B1Ch */ float mArmorBoostAmount; // not initialized - /* B20h */ cSpeciesProfile* mpSpeciesProfile; // species profile? + /* B20h */ cSpeciesProfile* mpSpeciesProfile; /* B24h */ uint32_t mProfileSeq; /* B28h */ ResourceKey mSpeciesKey; /* B34h */ int mAge; // 1 From d8df782a75271b79e7e229a40b281693fbe96795 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 26 Oct 2024 01:22:15 -0700 Subject: [PATCH 055/113] rename field_80 in cCombatant to mbInvincible --- Spore ModAPI/Spore/Simulator/cCombatant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCombatant.h b/Spore ModAPI/Spore/Simulator/cCombatant.h index 72c48896..14bdc65f 100644 --- a/Spore ModAPI/Spore/Simulator/cCombatant.h +++ b/Spore ModAPI/Spore/Simulator/cCombatant.h @@ -140,7 +140,7 @@ namespace Simulator /* 6Ch */ bool field_6C; // true, needsToLoadAimPoints? /* 70h */ uint32_t field_70; // an effect ID /* 74h */ Vector3 field_74; - /* 80h */ bool field_80; // if true, combatant is invincible + /* 80h */ bool mbInvincible; // if true, combatant is invincible /* 81h */ bool field_81; /* 84h */ eastl::vector field_84; /* 98h */ cGonzagoTimer field_98; From 869cc6137b26269305a5be02a8acd44d8f00f609 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 4 Nov 2024 20:54:24 -0800 Subject: [PATCH 056/113] Document Cell Stage vars --- .../Spore/Simulator/Cell/cCellObjectData.h | 42 +++++++++++-------- .../Spore/Simulator/Cell/cCellResource.h | 11 +++-- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h b/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h index eed41a49..b103f8cc 100644 --- a/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h +++ b/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h @@ -34,6 +34,8 @@ namespace Simulator /// Target position, changing this moves the cell towards the target /* 08h */ Math::Vector3 mTargetPosition; /* 14h */ Math::Quaternion mTargetOrientation; + + // Multiplying these 2 values by a scalar results in no significant change to movement /* 24h */ Math::Vector3 field_24; /* 30h */ Math::Vector3 field_30; /* 3Ch */ int field_3C; @@ -42,8 +44,8 @@ namespace Simulator /* 48h */ Transform mTransform; /// Elevation of the cell relative to the current level /* 80h */ float mRelativeElevation; - /* 84h */ Math::Vector3 field_84; - /* 90h */ Math::Vector3 field_90; + /* 84h */ Math::Vector3 field_84; // Previous position? + /* 90h */ Math::Vector3 field_90; // has something to do with speed of bouncing backwards off of something. can be set negative for a speed boost in the traveled direction. /* 9Ch */ int field_9C; /* A0h */ float mOpacity; /* A4h */ float mTargetOpacity; // changed by sub_E7C510 @@ -51,8 +53,8 @@ namespace Simulator /* ACh */ float field_AC; /* B0h */ int field_B0; /* B4h */ float mTargetSize; - /* B8h */ float field_B8; - /* BCh */ float field_BC; + /* B8h */ float field_B8; // Something to do with speed? Player cell hovers around 10-15 at speed lvl 1 + /* BCh */ float mAcceleration; // Movement acceleration? By default a very low number, causes chopping issues when too high /* C0h */ Transform field_C0; /* F8h */ int field_F8; /// Key of the main model used, this is 0 for all cells that are not actual creatures. @@ -64,35 +66,37 @@ namespace Simulator /* 112h */ bool field_112; /* 113h */ bool field_113; /* 114h */ int field_114; + /// field_118 value seems to vary between 0 to double digits, but is always above 0 when hatched and -1 when in egg. + /// seems to be 0 when cell is at rest and 18 or 48 when cell is moving, depending on speed ability level. /* 118h */ int field_118; /* 11Ch */ int field_11C; - /* 120h */ int field_120; - /* 124h */ int field_124; - /* 128h */ int field_128; + /* 120h */ int field_120; // 9 in starter cell + /* 124h */ int field_124; // 1 in starter cell + /* 128h */ int field_128; // seems to change per level or upgrade? /* 12Ch */ Math::Vector3 field_12C; /* 138h */ Math::Vector3 field_138; /* 144h */ int field_144; /* 148h */ int field_148; /* 14Ch */ int field_14C; /* 150h */ float field_150; - /* 154h */ int field_154; // probably float + /* 154h */ float field_154; // probably float /* 158h */ int field_158; - /* 15Ch */ float field_15C; + /* 15Ch */ float field_15C; // -1 /* 160h */ int field_160; /* 164h */ int field_164; - /* 168h */ int field_168; + /* 168h */ uint32_t field_168; /* 16Ch */ int field_16C; /* 170h */ int field_170; /* 174h */ int field_174; /* 178h */ int field_178; - /* 17Ch */ int field_17C; + /* 17Ch */ uint32_t field_17C; /* 180h */ int field_180; /* 184h */ int field_184; /* 188h */ int field_188; //TODO requested animation? E6D9D6 /* 18Ch */ CellAnimations field_18C; /* 190h */ int field_190; - /* 194h */ int field_194; + /* 194h */ uint32_t field_194; /* 198h */ int field_198; /* 19Ch */ int field_19C; /* 1A0h */ int field_1A0; @@ -107,7 +111,7 @@ namespace Simulator /* 1C4h */ int field_1C4; /* 1C8h */ int field_1C8; /* 1CCh */ int field_1CC; - /* 1D0h */ float field_1D0; + /* 1D0h */ float field_1D0; // approx 0.55 in starter cell, seems to go up into the hundreds /* 1D4h */ int field_1D4; /* 1D8h */ int field_1D8; /* 1DCh */ int field_1DC; @@ -143,11 +147,13 @@ namespace Simulator /// Index to the object in cCellGFX::mCellGFXObjects that visually represents this cell (its model, animated creature, etc.) /* 248h */ cObjectPoolIndex mGFXObjectIndex; /* 24Ch */ int field_24C; - /* 250h */ int field_250; - /* 254h */ int field_254; - /* 258h */ int field_258; - /* 25Ch */ int field_25C; - /* 260h */ int field_260; + /* 250h */ int field_250; // 4 + /// From f254 to f260, the values seem to increase when adding speed parts. appears to be movement related? Can crash the game if set improperly + /* 254h */ int field_254; // 1 + /* 258h */ int field_258; // 2 + /* 25Ch */ int field_25C; // 3 + /* 260h */ int field_260; // 4 + /// /* 264h */ int field_264; /* 268h */ int field_268; /* 26Ch */ int field_26C; diff --git a/Spore ModAPI/Spore/Simulator/Cell/cCellResource.h b/Spore ModAPI/Spore/Simulator/Cell/cCellResource.h index acf129b6..e4f14b58 100644 --- a/Spore ModAPI/Spore/Simulator/Cell/cCellResource.h +++ b/Spore ModAPI/Spore/Simulator/Cell/cCellResource.h @@ -434,15 +434,18 @@ namespace Simulator { None = 0, Body = 12, + Mandible = 2, Filter = 3, Proboscis = 4, - Cilia = 8, - Flagella = 9, - Jet = 10, + Chemical = 5, Electric = 6, - Spike = 7 + Spike = 7, + + Cilia = 8, + Flagella = 9, + Jet = 10 }; /* 00h */ cCellDataReference* structure; From 62867cb4df1dab9e603aca9e9ceaffea4da88904 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 8 Nov 2024 04:32:26 -0800 Subject: [PATCH 057/113] Add TribeToolData group ID --- Spore ModAPI/Spore/CommonIDs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index 9aea4931..12e01272 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -218,6 +218,7 @@ namespace GroupIDs SpaceTrading_ = 0x034D97FA, TribalTools = 0xF37C24E6, + TribeToolData = 0x04292F52, TribePlans = 0x72D02C25, Abilities = 0x01B68DB4, From 5fe847a5b7c23df21b78b08776b84199b262fe59 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 11 Nov 2024 12:06:26 -0800 Subject: [PATCH 058/113] Add kCitizenActionWalkTo --- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index 3bc6dd93..146bf180 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -743,7 +743,9 @@ namespace Simulator kCitizenActionEat = 0, kCitizenActionFish = 1, kCitizenActionGather = 2, - kCitizenActionGrabTool = 3, + kCitizenActionGrabTool = 3, // actionObject = cTribeTool + + kCitizenActionWalkTo = 4, // actionObject = nullptr, cannot be manually called via DoAction kCitizenActionHeal = 5, @@ -761,10 +763,12 @@ namespace Simulator kCitizenActionFeedWild = 20, kCitizenActionGift2 = 21, - kCitizenActionRepair = 24, + kCitizenActionRepair = 24, // actionObject = cTribeHut or cTribeTool kCitizenActionTame = 25, kCitizenActionRecruit = 26, kCitizenActionGatherMeat = 27, + + kCitizenActionUnk1 = 28, // common ID, actionObject = nullptr }; enum HandheldItem From 4a59bd6947c4be5e951548eeaf835ae2cf28b734 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 11 Nov 2024 18:01:08 -0800 Subject: [PATCH 059/113] document mPaintID --- Spore ModAPI/Spore/Editors/EditorRigblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/EditorRigblock.h b/Spore ModAPI/Spore/Editors/EditorRigblock.h index b9760f6c..5602194f 100644 --- a/Spore ModAPI/Spore/Editors/EditorRigblock.h +++ b/Spore ModAPI/Spore/Editors/EditorRigblock.h @@ -55,7 +55,7 @@ namespace Editors struct EditorRigblockPaint { - /* 00h */ uint32_t mPaintID; + /* 00h */ uint32_t mPaintID; // ID of the skinPaint_script~ entry /* 04h */ ColorRGB mPaintColor1; /* 10h */ ColorRGB mPaintColor2; }; From 7e3f5adbe5b1e6a1381763508d04e73daa3503dc Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 05:26:38 -0800 Subject: [PATCH 060/113] add Simulator::GetMinimapWindow(), Add documentation related to minimap --- .../SourceCode/Simulator/SimulatorSystem.cpp | 13 +++++++++++++ .../Spore/Simulator/SubSystem/SimulatorSystem.h | 6 ++++++ Spore ModAPI/Spore/UI/Minimap.h | 14 ++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp index b11281d2..7adb0019 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include namespace Simulator @@ -49,6 +51,17 @@ namespace Simulator GameViewManager.PrepareSimulator(); } + UI::Minimap* GetMinimapWindow() { + if (WindowManager.GetMainWindow()) { + UTFWin::IWindow* minimapHolder = WindowManager.GetMainWindow()->FindWindowByID(0x0190722E); + return object_cast(minimapHolder->FindWindowByID(0x0)); + //for (auto child : minimapHolder->children()) { + // return object_cast(child); + //} + } + return nullptr; + } + /// cStrategy /// cStrategy::cStrategy() diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/SimulatorSystem.h b/Spore ModAPI/Spore/Simulator/SubSystem/SimulatorSystem.h index 6a057974..efec5fbb 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/SimulatorSystem.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/SimulatorSystem.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #define SimulatorSystem (*Simulator::cSimulatorSystem::Get()) @@ -112,6 +113,11 @@ namespace Simulator /// on the screen. void InitializeWithoutPlanet(); + /// Returns a pointer to the current minimap, if one exists. + /// Call via Simulator::GetMinimapWindow() + /// TODO: should this be moved to a different class? + UI::Minimap* GetMinimapWindow(); + namespace Addresses(cSimulatorSystem) { DeclareAddress(Get); diff --git a/Spore ModAPI/Spore/UI/Minimap.h b/Spore ModAPI/Spore/UI/Minimap.h index a4b1636f..f5eca955 100644 --- a/Spore ModAPI/Spore/UI/Minimap.h +++ b/Spore ModAPI/Spore/UI/Minimap.h @@ -15,15 +15,16 @@ namespace UI { public: /* 218h */ Math::ColorRGB field_218; // white - /* 224h */ int field_224; - /* 228h */ int field_228; - /* 22Ch */ int field_22C; - /* 230h */ int field_230; + // 224h - 22Ch are unknown types + /* 224h */ uint32_t field_224; + /* 228h */ uint32_t field_228; + /* 22Ch */ uint32_t field_22C; + /* 230h */ int field_230; // 18 /* 234h */ int field_234; /* 238h */ bool field_238; /* 239h */ bool field_239; // arg_14 - /* 23Ch */ int field_23C; - /* 240h */ int field_240; // arg_4 + /* 23Ch */ int field_23C; // value in the 200s, seems to vary based on stage. crg = 225 trg = 227 spg & cvg = 231 + /* 240h */ int field_240; // arg_4, 103 in creature, 102 in all else /* 244h */ ObjectPtr field_244; /* 248h */ ObjectPtr field_248; /* 24Ch */ ObjectPtr field_24C; @@ -38,6 +39,7 @@ namespace UI /* 984h */ ObjectPtr field_984; /* 988h */ ObjectPtr field_988; /* 98Ch */ ObjectPtr field_98C; + // 990h - 9A0h seem to only have values in tribal stage, in all others they are zero /* 990h */ float field_990; /* 994h */ float field_994; /* 998h */ float field_998; From 684f3fbb4fa3696cd692ce0c07d4ef159a4b3a95 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 05:29:50 -0800 Subject: [PATCH 061/113] remove unneeded header --- Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp index 7adb0019..9f4ac4c1 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include namespace Simulator From 615488db07bfcde5116b223ae45db8295b4b0d1f Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 05:30:34 -0800 Subject: [PATCH 062/113] remove messy comment --- Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp index 9f4ac4c1..09ff6cf9 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp @@ -54,9 +54,6 @@ namespace Simulator if (WindowManager.GetMainWindow()) { UTFWin::IWindow* minimapHolder = WindowManager.GetMainWindow()->FindWindowByID(0x0190722E); return object_cast(minimapHolder->FindWindowByID(0x0)); - //for (auto child : minimapHolder->children()) { - // return object_cast(child); - //} } return nullptr; } From c3fbbfedcfa2c8402e10e64c4bcc9aedcae6c05b Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 05:36:12 -0800 Subject: [PATCH 063/113] undo dubious var name --- Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h b/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h index b103f8cc..bdc7f20f 100644 --- a/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h +++ b/Spore ModAPI/Spore/Simulator/Cell/cCellObjectData.h @@ -54,7 +54,7 @@ namespace Simulator /* B0h */ int field_B0; /* B4h */ float mTargetSize; /* B8h */ float field_B8; // Something to do with speed? Player cell hovers around 10-15 at speed lvl 1 - /* BCh */ float mAcceleration; // Movement acceleration? By default a very low number, causes chopping issues when too high + /* BCh */ float field_BC; // mAcceleration Movement acceleration? By default a very low number, causes chopping issues when too high /* C0h */ Transform field_C0; /* F8h */ int field_F8; /// Key of the main model used, this is 0 for all cells that are not actual creatures. From 6f7edb574fc3fa914e3e9b5bc10e160f1b07858f Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 13:56:25 -0800 Subject: [PATCH 064/113] fix GetMinimapWindow crash --- Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp index 09ff6cf9..af154e5d 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorSystem.cpp @@ -53,7 +53,9 @@ namespace Simulator UI::Minimap* GetMinimapWindow() { if (WindowManager.GetMainWindow()) { UTFWin::IWindow* minimapHolder = WindowManager.GetMainWindow()->FindWindowByID(0x0190722E); - return object_cast(minimapHolder->FindWindowByID(0x0)); + if (minimapHolder) { + return object_cast(minimapHolder->FindWindowByID(0x0)); + } } return nullptr; } From c13a29de39bbd7ff57ed90c2d4c885afc944efdd Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 16:23:45 -0800 Subject: [PATCH 065/113] add EditorManipulators enum to CommonIDs --- Spore ModAPI/Spore/CommonIDs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index 301fd995..a010bb05 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -53,6 +53,32 @@ enum ModelTypes }; +enum EditorManipulators +{ + kEditorManipulationStackingSimple = 0x889CDBFF, + kEditorManipulationStacking = 0x67B68E4D, + kEditorManipulationPinning = 0xA9910288, + kEditorManipulationReplacement = 0x58891023, + kEditorManipulationDeformHandle = 0x9F48C094, + kEditorManipulationRotationHandle = 0x855DE44D, + + + kEditorManipulationSpine = 0x5FDE642E, + kEditorManipulationSpineScaling = 0x7AD67439, + kEditorManipulationSpineResize = 0xBB46D99A, + kEditorManipulationLimb = 0x8665F54D, + kEditorManipulationBoneRotation = 0xE931544D, + + kEditorManipulationTranslateCreature = 0x9ED74A02, + kEditorManipulationCreatureTest = 0xF818C5BA, + kEditorManipulationCellTorso = 0x2D35AF62, + kEditorManipulationCellPinning = 0x1B73114C, + + kEditorManipulationInterpenetration = 0x6125EE88, + kEditorManipulationPlanarInterpenetration = 0xF48AB41C, + +}; + enum GameModeIDs { /// Not a game mode by itself, used to index game modes. From 1bf65beee66c23275c5736a7f72bc9283f24e0aa Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 16:26:26 -0800 Subject: [PATCH 066/113] fix new enum to type as a uint32 --- Spore ModAPI/Spore/CommonIDs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index a010bb05..71eac4b9 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -53,7 +53,7 @@ enum ModelTypes }; -enum EditorManipulators +enum EditorManipulators : uint32_t { kEditorManipulationStackingSimple = 0x889CDBFF, kEditorManipulationStacking = 0x67B68E4D, From ca7219c6595b75836e7145ad55805bf198ad1604 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 18:06:06 -0800 Subject: [PATCH 067/113] annotate EditorRigblock field_138 --- Spore ModAPI/Spore/Editors/EditorRigblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/EditorRigblock.h b/Spore ModAPI/Spore/Editors/EditorRigblock.h index 5602194f..06dc3c9a 100644 --- a/Spore ModAPI/Spore/Editors/EditorRigblock.h +++ b/Spore ModAPI/Spore/Editors/EditorRigblock.h @@ -226,7 +226,7 @@ namespace Editors /* CCh */ Matrix3 field_CC; /* F0h */ Matrix3 mUserOrientation; /* 114h */ Matrix3 field_114; - /* 138h */ Vector3 field_138; + /* 138h */ Vector3 field_138; // position relative to parent? /* 144h */ Vector3 field_144; /* 150h */ int field_150; // -2 /* 154h */ EditorBaseHandlePtr mAxisHandles[3]; //TODO sub_483CE0 From 8b777613c7d6783c63cd9dfc88643249e440a1ed Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 13 Nov 2024 21:15:46 -0800 Subject: [PATCH 068/113] fix typo --- Spore ModAPI/Spore/Simulator/cPlanetRecord.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cPlanetRecord.h b/Spore ModAPI/Spore/Simulator/cPlanetRecord.h index 4141fa23..c75f4f02 100644 --- a/Spore ModAPI/Spore/Simulator/cPlanetRecord.h +++ b/Spore ModAPI/Spore/Simulator/cPlanetRecord.h @@ -243,7 +243,7 @@ namespace Simulator float baseValue, float maxOutput, float extraFactor, bool isHomeWorld, bool useSuperpowerMultiplier, bool useStorageMultiplier, float finalFactor, int numCities, bool limitOutput); - /// Return true if the planet ahs any city controlled by the specified empire. + /// Return true if the planet has any city controlled by the specified empire. /// If 'requireMoreThanOneTurret' is true, then it will only return true if the controlled city /// has more than one turret. /// @param planetRecord From 372b89b59259fb0a0db0fc27f01ad15a90cafe6e Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 14 Nov 2024 11:21:19 -0800 Subject: [PATCH 069/113] fix typo in EditorRigblockBoolAttributes --- Spore ModAPI/Spore/Editors/EditorRigblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/EditorRigblock.h b/Spore ModAPI/Spore/Editors/EditorRigblock.h index 06dc3c9a..47d3ff03 100644 --- a/Spore ModAPI/Spore/Editors/EditorRigblock.h +++ b/Spore ModAPI/Spore/Editors/EditorRigblock.h @@ -110,7 +110,7 @@ namespace Editors kEditorRigblockModelIsNullBlock = 0x14, kEditorRigblockModelUseHullForBBox = 0x15, kEditorRigblockModelHasStayAbove = 0x16, - kEditorRigblockModelHasSnapDawnTo = 0x17, + kEditorRigblockModelHasSnapDownTo = 0x17, kEditorRigblockModelHideDeformHandles = 0x18, kEditorRigblockModelHideRotationHandles = 0x19, kEditorRigblockModelHasAlignLateralWith = 0x1A, From 87f2ca36b34ef247589f243d01cd07d8745d0c61 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 14 Nov 2024 11:32:41 -0800 Subject: [PATCH 070/113] change kEditorRigblockModelCanBeParentless to kEditorRigblockModelCannotBeParentless --- Spore ModAPI/Spore/Editors/EditorRigblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/EditorRigblock.h b/Spore ModAPI/Spore/Editors/EditorRigblock.h index 47d3ff03..e10b17a9 100644 --- a/Spore ModAPI/Spore/Editors/EditorRigblock.h +++ b/Spore ModAPI/Spore/Editors/EditorRigblock.h @@ -122,7 +122,7 @@ namespace Editors kEditorRigblockModelHasSocketConnector = 0x20, kEditorRigblockModelCellAllowOnTopOfBody = 0x21, kEditorRigblockModelPreferToBeOnPlaneOfSymmetry = 0x22, - kEditorRigblockModelCanBeParentless = 0x23, + kEditorRigblockModelCannotBeParentless = 0x23, // formerly kEditorRigblockModelCanBeParentless; functionality appeared to be inverted kEditorRigblockModelBoundsCheckOnlyForDelete = 0x24, kEditorRigblockModelHasRotationBallHandle = 0x26, From 77b675a2794a17396c76d5c20a7491d5d93995f3 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 14 Nov 2024 17:39:41 -0800 Subject: [PATCH 071/113] document creature model related vars and flags --- Spore ModAPI/Spore/Graphics/Model.h | 23 +++++++++++++++++++- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 8 ++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Spore ModAPI/Spore/Graphics/Model.h b/Spore ModAPI/Spore/Graphics/Model.h index 477b039a..09e165da 100644 --- a/Spore ModAPI/Spore/Graphics/Model.h +++ b/Spore ModAPI/Spore/Graphics/Model.h @@ -61,11 +61,15 @@ namespace Graphics enum ModelFlags { kModelFlagUseColor = 0x2, // actually 4? - + kModelFlagUseIdentityColor = 0x4, // is required for ID color to apply, overrides flag 0x2 kModelFlagObjectTypeColor = 0x8, + kModelFlagUnk1Color = 0x16, // has something to do with slightly tinting the color kModelFlagOverrideRaycastMode = 0x100, + kModelFlagMatteColorMask = 0x400, // applies a flat gray color in the color masked areas. + kModelFlagApplyIdentityColor = 0x800, // required for Identity color to apply + kModelFlagHighRes = 0x2000, kModelFlagIsLoaded = 0x4000, kModelFlagVisible = 0x8000, @@ -94,6 +98,9 @@ namespace Graphics bool IsVisible() const; + bool UsesColorAsIdentity() const; + void SetUseColorAsIdentity(bool state); + /// /// Assigns the required flags to this model depending on the groupID specified. /// @param groupID The ID of the model group, in the ModelGroups enum. @@ -197,6 +204,20 @@ namespace Graphics return (mFlags & kModelFlagVisible) != 0; } + inline bool Model::UsesColorAsIdentity() const + { + return (mFlags & 0x804) != 0; + } + inline void Model::SetUseColorAsIdentity(bool state) + { + if (state) { + mFlags |= 0x804; + } + else { + mFlags &= ~0x804; + } + } + inline Math::ColorRGBA Model::GetColor() const { return mColor; } diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index abb09d5a..75921c46 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -279,9 +279,10 @@ namespace Simulator /* B60h */ bool mbUpdateInteractionEffect; /* B61h */ bool mbUpdateMotiveEffect; /* B62h */ bool mbIsDiseased; - /* B63h */ bool field_B63; + /// Setting this to true deletes the creature + /* B63h */ bool mbMarkedForDeletion; /* B64h */ bool field_B64; // true - /* B65h */ bool mbColorIsIdentity; + /* B65h */ bool mbColorIsIdentity; // requires age-up or other model reload to take effect /* B66h */ bool field_B66; /* B67h */ bool mbCasted; /* B68h */ bool field_B68; // true @@ -338,7 +339,8 @@ namespace Simulator /* E62h */ bool field_E62; /* E63h */ bool field_E63; /* E64h */ int field_E64; - /* E68h */ bool field_E68; + /// If true, green sparkles and smiles will emanate from the creature + /* E68h */ bool mbMindMelded; /* E6Ch */ int field_E6C; /// Index to default attack ability, which is generally bite or its improvements (energy or poison blade) /* E70h */ int mDefaultAttackAbilityIndex; // -1 From bd2d8fbf1ae4323c2d2fc909c6f06aeda4e18141 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 15 Nov 2024 01:16:48 -0800 Subject: [PATCH 072/113] clarify comment --- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index 75921c46..b90fe191 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -282,7 +282,7 @@ namespace Simulator /// Setting this to true deletes the creature /* B63h */ bool mbMarkedForDeletion; /* B64h */ bool field_B64; // true - /* B65h */ bool mbColorIsIdentity; // requires age-up or other model reload to take effect + /* B65h */ bool mbColorIsIdentity; // if applied at runtime, requires age-up or other model reload to take effect /* B66h */ bool field_B66; /* B67h */ bool mbCasted; /* B68h */ bool field_B68; // true From 97ef7cb2435d83ca328cc793a54df75471fb2c75 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 16 Nov 2024 22:41:11 -0800 Subject: [PATCH 073/113] document int arg in cTribe::SpawnMember --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 73650e08..831c257d 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -73,7 +73,7 @@ namespace Simulator /* 90h */ virtual eastl::vector& GetTribeMembers(); /// Returns a vector of all selectable members of the tribe /* 94h */ virtual eastl::vector& GetSelectableMembers(); - /* 98h */ virtual cCreatureCitizen* SpawnMember(int); + /* 98h */ virtual cCreatureCitizen* SpawnMember(int age); /// Removes a member of the tribe. index seems to cause issues if not 0. /* 9Ch */ virtual void func9Ch(int index, bool); /// Calls func9Ch() with second parameter true From 42d0d59c05869512a83bf0f0a21783086753394f Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 17 Nov 2024 14:51:46 -0800 Subject: [PATCH 074/113] Add ColorRGB & ColorRGBA Serializers --- .../Spore/Simulator/SerializationTypes.h | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/SerializationTypes.h b/Spore ModAPI/Spore/Simulator/SerializationTypes.h index dea9cfa3..4bdaeff0 100644 --- a/Spore ModAPI/Spore/Simulator/SerializationTypes.h +++ b/Spore ModAPI/Spore/Simulator/SerializationTypes.h @@ -385,6 +385,61 @@ namespace Simulator } }; + template <> + struct SerializationTypes::SerializedType + { + static bool Read(ISerializerReadStream* stream, ColorRGB* dst) { + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->r); + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->g); + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->b); + return true; + } + + static bool Write(ISerializerWriteStream* stream, ColorRGB* src) { + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->r); + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->g); + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->b); + return true; + } + + static void ReadText(const eastl::string& str, ColorRGB* dst) { + auto data = eastl::string16(eastl::string16::CtorConvert(), str).c_str(); + *dst = ColorRGB(atol(str.c_str())); + } + + static void WriteText(char* buf, ColorRGB* src) { + sprintf_s(buf, 1024, "0x%x", src->ToIntColor().value); + } + }; + + template <> + struct SerializationTypes::SerializedType + { + static bool Read(ISerializerReadStream* stream, ColorRGBA* dst) { + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->r); + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->g); + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->b); + IO::ReadFloat(stream->GetRecord()->GetStream(), &dst->a); + return true; + } + + static bool Write(ISerializerWriteStream* stream, ColorRGBA* src) { + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->r); + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->g); + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->b); + IO::WriteFloat(stream->GetRecord()->GetStream(), &src->a); + return true; + } + + static void ReadText(const eastl::string& str, ColorRGBA* dst) { + auto data = eastl::string16(eastl::string16::CtorConvert(), str).c_str(); + *dst = ColorRGBA(atol(str.c_str())); + } + + static void WriteText(char* buf, ColorRGBA* src) { + sprintf_s(buf, 1024, "0x%x", src->ToIntColor().value); + } + }; template bool Read(ISerializerReadStream* stream, T* dst) From e184d07f403d33abe2305b1a3797c8eb38278e16 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 17 Nov 2024 16:19:07 -0800 Subject: [PATCH 075/113] rename func78h to GrowUp() --- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index b90fe191..ce2c4e41 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -227,7 +227,8 @@ namespace Simulator /* 6Ch */ virtual void func6Ch(int deltaTime); // called by Update /* 70h */ virtual void func70h(float deltaTimeSeconds); // called by Update /* 74h */ virtual void func74h(void*); // related to babies growing up - /* 78h */ virtual void func78h(); + /// Make the creature grow up and play the baby grow up effect. Will run even if the creature is already an adult. + /* 78h */ virtual void GrowUp(); /* 7Ch */ virtual float GetBaseMaxHitPoints() = 0; /* 80h */ virtual float CalculateScale(bool isBaby); /* 84h */ virtual void SetCreatureTarget(cCombatant* pTarget, bool, int intentionTowardsTarget); //TODO check loc_D3242E From 89c532bb88914931f58f62157496cd071ea60f9b Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 20 Nov 2024 17:46:48 -0800 Subject: [PATCH 076/113] clarify cCreatureBase::IsHerbivore (also returns if creature is omnivore) --- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index ce2c4e41..ab129a8c 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -208,7 +208,7 @@ namespace Simulator /// @returns int PlayVoice(const char* pName, int param2, int param3); - bool IsHervibore(); + bool IsHervibore(); // also returns true for omnivores /* 54h */ virtual void CreateLocomotionStrategy(); From fd03139dd0136da960da5b7bba2cf9d3a155cb6e Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 24 Nov 2024 21:17:04 -0800 Subject: [PATCH 077/113] Swap AbilityMode enum entries, annotate Editor::AddCreature() --- Spore ModAPI/Spore/Editors/Editor.h | 3 ++- Spore ModAPI/Spore/Simulator/cCreatureGameData.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index dce2d01b..d89c5879 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -203,7 +203,8 @@ namespace Editors /// its current animation and return to the neutral, motionless pose. void SetCreatureToNeutralPose(); - bool AddCreature(int, const ResourceKey* key = nullptr); + /// Adds a creature to the test drive, crashes in other modes. + bool AddCreature(int age, const ResourceKey* key = nullptr); void PostEventToActors(uint32_t eventID, int = -1, float = 1.0f, float = 0.0f); diff --git a/Spore ModAPI/Spore/Simulator/cCreatureGameData.h b/Spore ModAPI/Spore/Simulator/cCreatureGameData.h index acc752a4..775a7dae 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureGameData.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureGameData.h @@ -12,8 +12,8 @@ namespace Simulator public: enum class AbilityMode : int { - Attack = 0, - Social = 1 + Social = 0, + Attack = 1 }; static cCreatureGameData* Get(); From b46c819b6a258c99f77e1832321599b8645569e8 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 27 Nov 2024 06:12:53 -0800 Subject: [PATCH 078/113] add better description for AnimEditor, Fix icon capture for subcategories and ingame community planners --- .../ModCreatorKit/AnimEditorMode.cpp | 6 +- .../ModCreatorKit/ThumbnailCaptureScript.cpp | 115 +++++++++++++++--- .../ModCreatorKit/ThumbnailCaptureScript.h | 2 + .../ModCreatorKit/dllmain.cpp | 1 + 4 files changed, 104 insertions(+), 20 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp b/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp index 641f9524..9028b90f 100644 --- a/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp +++ b/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp @@ -75,6 +75,10 @@ bool AnimEditorMode::Initialize(App::IGameModeManager* pManager) request.shopperID = id("CreatureShopper"); Sporepedia::ShopperRequest::Show(request); } + else if (line.HasFlag("exit")) + { + GameModeManager.SetActiveMode(kGGEMode); + } size_t numArgs; if (auto args = line.GetOptionRange("play", &numArgs, 1, 2)) { @@ -93,7 +97,7 @@ bool AnimEditorMode::Initialize(App::IGameModeManager* pManager) const char* GetDescription(ArgScript::DescriptionMode mode) const override { - return "Enters into anim editor"; + return "Enters into anim editor. Use the flags -add and -remove to add or change creatures, and -exit to leave the mode."; } }; diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index 97f3b538..1becac6a 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -43,6 +43,26 @@ ThumbnailCaptureScript::~ThumbnailCaptureScript() { } +//--------------------------------------------------- +// Detours + +PaletteUIPtr pLastPalette; + +// Editor parts palette loading func, PaletteUI::Load. Used to pull the ingame palettes +member_detour(PaletteUILoad_detour, Palettes::PaletteUI, void(Palettes::PaletteMain*, UTFWin::IWindow*, bool, Palettes::PaletteInfo*)) { + void detoured(Palettes::PaletteMain* pPalette, UTFWin::IWindow* pWindow, bool bool1, Palettes::PaletteInfo* pInfo) { + pLastPalette = this; + original_function(this, pPalette, pWindow, bool1, pInfo); + } +}; + +void ThumbnailCaptureScript::AttachDetour() { + PaletteUILoad_detour::attach(GetAddress(Palettes::PaletteUI, Load)); +} + +//--------------------------------------------------- + + int ThumbnailCaptureScript::GetEventFlags() const { return UTFWin::kEventRefresh; } @@ -52,7 +72,7 @@ bool ThumbnailCaptureScript::HandleUIMessage(IWindow* pWindow, const Message& me mpItemViewer = mItemViewers[pWindow]; } else if (message.IsType(kMsgMouseLeave)) { - // For some reason this might happen in paralel to Render? We don't want them to race + // For some reason this might happen in parallel to Render? We don't want them to race //mpItemViewer = nullptr; } return false; @@ -154,54 +174,97 @@ void ThumbnailCaptureScript::CaptureImage() { device->SetRenderTarget(0, surface); } + +PaletteUIPtr ThumbnailCaptureScript::GetCurrentPalette() const { + // Editor is valid, get the parts palette + if (GetEditor() && GetEditor()->IsActive()) { return GetEditor()->mpPartsPaletteUI; } + // Editor is invalid, try the last loaded palette + else { return pLastPalette; } + +} + void ThumbnailCaptureScript::InjectListeners() { + + PaletteUIPtr palette = GetCurrentPalette(); + if (!palette) { return; } + RemoveListeners(); - for (auto catUI : GetEditor()->mpPartsPaletteUI->mCategories) { - auto subCatUIs = catUI->mpSubcategoriesUI; + for (PaletteCategoryUIPtr catUI : palette->mCategories) { + PaletteSubcategoriesUIPtr subCatUIs = catUI->mpSubcategoriesUI; + + // subcategories present if (subCatUIs) { - for (auto subCatUI : subCatUIs->mCategoryUIs) { - for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { - itemUI->field_18->AddWinProc(this); - mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + for (PaletteCategoryUIPtr subCatUI : subCatUIs->mCategoryUIs) { + for (auto pageUI : subCatUI->mPageUIs) { + // standard editor/planner + if (pageUI.page->mStandardItems.size() > 0) { + for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { + itemUI->field_18->AddWinProc(this); + mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + } } + // adventure editor + /* + else { + for (eastl::intrusive_ptr itemUI : pageUI.page->mAdvancedItems) { + itemUI->mpWindow + mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + } + }*/ + } } } + // simple category else { for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { + for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { itemUI->field_18->AddWinProc(this); mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); } } } - - } Renderer.RegisterLayer(this, 40); } + + void ThumbnailCaptureScript::RemoveListeners() { - for (auto catUI : GetEditor()->mpPartsPaletteUI->mCategories) { + PaletteUIPtr palette = GetCurrentPalette(); + if (!palette) { return; } + + for (auto catUI : palette->mCategories) { auto subCatUIs = catUI->mpSubcategoriesUI; + + // subcategories present if (subCatUIs) { - for (auto subCatUI : subCatUIs->mCategoryUIs) { - for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { - if (itemUI && itemUI->field_18) { + for (PaletteCategoryUIPtr subCatUI : subCatUIs->mCategoryUIs) { + for (auto pageUI : subCatUI->mPageUIs) { + // standard editor/planner + if (pageUI.page->mStandardItems.size() > 0) { + for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { itemUI->field_18->RemoveWinProc(this); } } + /* + // adventure editor + else { + for (StandardItemUIPtr itemUI : pageUI.page->mpPage->mItems) { + itemUI->field_18->RemoveWinProc(this); + } + } + */ } } } + // simple category else { for (auto pageUI : catUI->mPageUIs) { - for (auto itemUI : pageUI.page->mStandardItems) { + for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { if (itemUI && itemUI->field_18) { itemUI->field_18->RemoveWinProc(this); } @@ -223,9 +286,23 @@ void ThumbnailCaptureScript::ParseLine(const ArgScript::Line& line) { return; } + //auto editor = GetEditor(); + if (!Editor.IsActive()) { - App::ConsolePrintF("Must be in editor to use this cheat."); - return; + + if (Simulator::GetGameModeID() == kEditorMode) { + App::ConsolePrintF("Must be in editor or a community planner to use this cheat."); + return; + } + // TODO: make this work in the adventure editor. + else if (Simulator::IsTribeGame() || Simulator::IsCivGame() || Simulator::IsSpaceGame()) { // || Simulator::IsScenarioMode() + // found a palette that's been loaded anyway + if (!pLastPalette) { + App::ConsolePrintF("Must be in editor or a community planner to use this cheat."); + } + } + + //return; } else if (!Editor.IsMode(Mode::BuildMode)) { App::ConsolePrintF("Must be in editor build mode to use this cheat."); diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h index 2ad5a34d..f68fcf84 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h @@ -53,12 +53,14 @@ class ThumbnailCaptureScript bool HandleMessage(uint32_t messageID, void* pMessage) override; static void AddCheat(); + static void AttachDetour(); private: void CaptureImage(); Vector3 CalculateOffset(Graphics::Model* model); + PaletteUIPtr GetCurrentPalette() const; void InjectListeners(); void RemoveListeners(); diff --git a/Projects/Example Projects/ModCreatorKit/dllmain.cpp b/Projects/Example Projects/ModCreatorKit/dllmain.cpp index f6a5c0bc..39d9f68f 100644 --- a/Projects/Example Projects/ModCreatorKit/dllmain.cpp +++ b/Projects/Example Projects/ModCreatorKit/dllmain.cpp @@ -109,6 +109,7 @@ void AttachDetours() cEffectsManager_detour::attach(GetAddress(Swarm::cSwarmManager, GetDirectoryAndEffectIndex)); AnimLogCheat::AttachDetour(); UILogCheat::AttachDetour(); + ThumbnailCaptureScript::AttachDetour(); } From 8464c53f38f13625fc7432ae5488983d9bcd2d7e Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 30 Nov 2024 20:04:03 -0800 Subject: [PATCH 079/113] change IsHervibore to IsHerbivore (recent enough addition to mod API that i didn't include fallback names) --- Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp | 2 +- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index 5c571dd7..4afdf44b 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -256,7 +256,7 @@ namespace Simulator DefineAddress(OnJumpLand, SelectAddress(0xC14670, 0xC14E10)); DefineAddress(OnStartSwimming, SelectAddress(0xC147D0, 0xC14F70)); DefineAddress(Update, SelectAddress(0xC20C50, 0xC21530)); - DefineAddress(IsHervibore, SelectAddress(0xC0B040, 0xC0B8E0)); + DefineAddress(IsHerbivore, SelectAddress(0xC0B040, 0xC0B8E0)); } namespace Addresses(cCropCirclesToolStrategy) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index ab129a8c..1d84ad8e 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -208,7 +208,7 @@ namespace Simulator /// @returns int PlayVoice(const char* pName, int param2, int param3); - bool IsHervibore(); // also returns true for omnivores + bool IsHerbivore(); // also returns true for omnivores /* 54h */ virtual void CreateLocomotionStrategy(); @@ -420,6 +420,6 @@ namespace Simulator DeclareAddress(OnJumpLand); // 0xC14670 0xC14E10 DeclareAddress(OnStartSwimming); // 0xC147D0 0xC14F70 DeclareAddress(Update); // 0xC20C50 0xC21530 - DeclareAddress(IsHervibore); // 0xC0B040 0xC0B8E0 + DeclareAddress(IsHerbivore); // 0xC0B040 0xC0B8E0 } } \ No newline at end of file From bce510649be357bff718d736502195db0426cdd8 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 30 Nov 2024 20:08:30 -0800 Subject: [PATCH 080/113] stop tracking editable sdkpathconfigs --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3772b0a0..4ab5d6a8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,9 @@ Release Projects/* !Projects/Example Projects/ /SDKtoGhidra/temp.cpp -modapi-generated-docs \ No newline at end of file +modapi-generated-docs +/Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props +/Projects/Example Projects/ModCreatorKit/SdkPathConfig.props +/Projects/Example Projects/TemplatesExample/SdkPathConfig.props +/Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props +/Projects/Example Projects/GmdlExport/SdkPathConfig.props From dc2ce9c5c6c05b9ffdcebd76f9ba8a16649d8728 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 30 Nov 2024 20:08:46 -0800 Subject: [PATCH 081/113] gitgnore --- .gitignore | 5 +++++ .../EditorPlayModeNoBounds/SdkPathConfig.props | 18 ------------------ .../GmdlExport/SdkPathConfig.props | 18 ------------------ .../ModCreatorKit/SdkPathConfig.props | 18 ------------------ .../SpaceToolCheat/SdkPathConfig.props | 18 ------------------ .../TemplatesExample/SdkPathConfig.props | 18 ------------------ 6 files changed, 5 insertions(+), 90 deletions(-) delete mode 100644 Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props delete mode 100644 Projects/Example Projects/GmdlExport/SdkPathConfig.props delete mode 100644 Projects/Example Projects/ModCreatorKit/SdkPathConfig.props delete mode 100644 Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props delete mode 100644 Projects/Example Projects/TemplatesExample/SdkPathConfig.props diff --git a/.gitignore b/.gitignore index 4ab5d6a8..9a8c3889 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,8 @@ modapi-generated-docs /Projects/Example Projects/TemplatesExample/SdkPathConfig.props /Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props /Projects/Example Projects/GmdlExport/SdkPathConfig.props +/Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props +/Projects/Example Projects/ModCreatorKit/SdkPathConfig.props +/Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props +/Projects/Example Projects/TemplatesExample/SdkPathConfig.props +/Projects/Example Projects/GmdlExport/SdkPathConfig.props diff --git a/Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props b/Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props deleted file mode 100644 index 623cf370..00000000 --- a/Projects/Example Projects/EditorPlayModeNoBounds/SdkPathConfig.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ..\..\..\ - E:\Eric\Spore ModAPI\Development Folder\ - - - - - - $(SporeSdkPath) - - - $(SporeLauncherPath) - - - \ No newline at end of file diff --git a/Projects/Example Projects/GmdlExport/SdkPathConfig.props b/Projects/Example Projects/GmdlExport/SdkPathConfig.props deleted file mode 100644 index 623cf370..00000000 --- a/Projects/Example Projects/GmdlExport/SdkPathConfig.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ..\..\..\ - E:\Eric\Spore ModAPI\Development Folder\ - - - - - - $(SporeSdkPath) - - - $(SporeLauncherPath) - - - \ No newline at end of file diff --git a/Projects/Example Projects/ModCreatorKit/SdkPathConfig.props b/Projects/Example Projects/ModCreatorKit/SdkPathConfig.props deleted file mode 100644 index 623cf370..00000000 --- a/Projects/Example Projects/ModCreatorKit/SdkPathConfig.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ..\..\..\ - E:\Eric\Spore ModAPI\Development Folder\ - - - - - - $(SporeSdkPath) - - - $(SporeLauncherPath) - - - \ No newline at end of file diff --git a/Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props b/Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props deleted file mode 100644 index 53736690..00000000 --- a/Projects/Example Projects/SpaceToolCheat/SdkPathConfig.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - E:\Eric\Spore ModAPI SDK\ - E:\Eric\Spore ModAPI\Development Folder\ - - - - - - $(SporeSdkPath) - - - $(SporeLauncherPath) - - - \ No newline at end of file diff --git a/Projects/Example Projects/TemplatesExample/SdkPathConfig.props b/Projects/Example Projects/TemplatesExample/SdkPathConfig.props deleted file mode 100644 index 53736690..00000000 --- a/Projects/Example Projects/TemplatesExample/SdkPathConfig.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - E:\Eric\Spore ModAPI SDK\ - E:\Eric\Spore ModAPI\Development Folder\ - - - - - - $(SporeSdkPath) - - - $(SporeLauncherPath) - - - \ No newline at end of file From 291bdd1b65347d5c988fcef28a747eaba9d0a4b9 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 30 Nov 2024 20:12:09 -0800 Subject: [PATCH 082/113] fix remaining 'hervibore' typo --- Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp index 2685bdb1..b0e68e7d 100644 --- a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp +++ b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp @@ -96,7 +96,7 @@ namespace Simulator auto_METHOD_VOID(cCreatureBase, ConsumeEnergy, Args(float energyConsumed), Args(energyConsumed)); - auto_METHOD_(cCreatureBase, bool, IsHervibore); + auto_METHOD_(cCreatureBase, bool, IsHerbivore); auto_METHOD_VOID(cCreatureCitizen, DoAction, Args(int actionId, cGameData* actionObject, App::Property* prop), Args(actionId, actionObject, prop)); From 04b3fee6d48542f54bdd4595a8417ced457ea06d Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 1 Dec 2024 00:09:28 -0800 Subject: [PATCH 083/113] undo "Hervibore" fix due to crashes --- Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp | 2 +- Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp | 2 +- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index 4afdf44b..5c571dd7 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -256,7 +256,7 @@ namespace Simulator DefineAddress(OnJumpLand, SelectAddress(0xC14670, 0xC14E10)); DefineAddress(OnStartSwimming, SelectAddress(0xC147D0, 0xC14F70)); DefineAddress(Update, SelectAddress(0xC20C50, 0xC21530)); - DefineAddress(IsHerbivore, SelectAddress(0xC0B040, 0xC0B8E0)); + DefineAddress(IsHervibore, SelectAddress(0xC0B040, 0xC0B8E0)); } namespace Addresses(cCropCirclesToolStrategy) diff --git a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp index b0e68e7d..2685bdb1 100644 --- a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp +++ b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp @@ -96,7 +96,7 @@ namespace Simulator auto_METHOD_VOID(cCreatureBase, ConsumeEnergy, Args(float energyConsumed), Args(energyConsumed)); - auto_METHOD_(cCreatureBase, bool, IsHerbivore); + auto_METHOD_(cCreatureBase, bool, IsHervibore); auto_METHOD_VOID(cCreatureCitizen, DoAction, Args(int actionId, cGameData* actionObject, App::Property* prop), Args(actionId, actionObject, prop)); diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index 1d84ad8e..b21e7e21 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -208,7 +208,8 @@ namespace Simulator /// @returns int PlayVoice(const char* pName, int param2, int param3); - bool IsHerbivore(); // also returns true for omnivores + /// also returns true for omnivores + bool IsHervibore(); // TODO: fix typo without causing crash. /* 54h */ virtual void CreateLocomotionStrategy(); @@ -420,6 +421,6 @@ namespace Simulator DeclareAddress(OnJumpLand); // 0xC14670 0xC14E10 DeclareAddress(OnStartSwimming); // 0xC147D0 0xC14F70 DeclareAddress(Update); // 0xC20C50 0xC21530 - DeclareAddress(IsHerbivore); // 0xC0B040 0xC0B8E0 + DeclareAddress(IsHervibore); // 0xC0B040 0xC0B8E0 } } \ No newline at end of file From 391154b1672766891b245afc7ae629e906d3ce33 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 2 Dec 2024 21:36:07 -0800 Subject: [PATCH 084/113] fix variable annotations --- Spore ModAPI/Spore/Editors/Editor.h | 5 +++-- Spore ModAPI/Spore/Simulator/cCivilization.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index d89c5879..e1bc8ac9 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -204,7 +204,7 @@ namespace Editors void SetCreatureToNeutralPose(); /// Adds a creature to the test drive, crashes in other modes. - bool AddCreature(int age, const ResourceKey* key = nullptr); + bool AddCreature(int, const ResourceKey* key = nullptr); void PostEventToActors(uint32_t eventID, int = -1, float = 1.0f, float = 0.0f); @@ -380,7 +380,8 @@ namespace Editors /* 280h */ uint32_t mSkyBoxEffectID; /* 284h */ int field_284; /* 288h */ float field_288; // 1.2 - /* 28Ch */ TexturePtr mpThumbnailTexture; + /// Briefly set when saving a creature, then immediately unset. + /* 28Ch */ TexturePtr mpThumbnailTexture; /* 290h */ int field_290; /* 294h */ IShadowWorldPtr mpShadowWorld; /* 298h */ Graphics::ShadowMapInfo* mpShadowMapInfo; diff --git a/Spore ModAPI/Spore/Simulator/cCivilization.h b/Spore ModAPI/Spore/Simulator/cCivilization.h index e6de64b6..6a679fa8 100644 --- a/Spore ModAPI/Spore/Simulator/cCivilization.h +++ b/Spore ModAPI/Spore/Simulator/cCivilization.h @@ -43,6 +43,7 @@ namespace Simulator /* 92h */ bool mTargetMinerals; /* 93h */ bool mFirstMinerals; /* 94h */ bool mFirstBudget; + /// Amount of money held by the civilization /* 98h */ float mWealth; /* 9Ch */ eastl::vector mCities; /* B0h */ eastl::vector mVehicles; From 550030cdac349cda735a73bf0c5c0aaabe093ca6 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 2 Dec 2024 21:40:37 -0800 Subject: [PATCH 085/113] add default var amount to AddCreature --- Spore ModAPI/Spore/Editors/Editor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index e1bc8ac9..fb8e143e 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -204,7 +204,7 @@ namespace Editors void SetCreatureToNeutralPose(); /// Adds a creature to the test drive, crashes in other modes. - bool AddCreature(int, const ResourceKey* key = nullptr); + bool AddCreature(int = 1, const ResourceKey* key = nullptr); void PostEventToActors(uint32_t eventID, int = -1, float = 1.0f, float = 0.0f); From dd385078b9c054ee03b8fae2d3173263f957fc03 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 8 Dec 2024 15:49:30 -0800 Subject: [PATCH 086/113] annotate var --- Spore ModAPI/Spore/Simulator/cCollectableItems.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/cCollectableItems.h b/Spore ModAPI/Spore/Simulator/cCollectableItems.h index 8bdf8850..1db646fc 100644 --- a/Spore ModAPI/Spore/Simulator/cCollectableItems.h +++ b/Spore ModAPI/Spore/Simulator/cCollectableItems.h @@ -112,6 +112,7 @@ namespace Simulator /* 0Ch */ bool field_C; // true /// Stores a progression of unlockable items (for instance, all the mouths in the same row) /* 10h */ eastl::sp_fixed_map mUnlockableRows; + /// Maps the group/instance of a rigblock to its UnlockableItem data /* 148Ch */ eastl::sp_fixed_hash_map mUnlockableItems; /// Some flags /* 4D00h */ eastl::sp_fixed_hash_map mItemStatusInfos; @@ -159,6 +160,7 @@ namespace Simulator // return a valid new part ID to unlock, or call this func again until it returns a valid part. // // firstCall is always true ONLY on the first call of this function + // unk1 has something to do with how many times the function is called unsuccessfully; if it reaches 2 twice, unlockLevel is set to -1. // unlockLevel will be either a .prop unlockLevel value or -1 // // the cCollectableItemID return value is formatted as such: From 3d5d0c0fd03dfed32ccd85484332a0a73fc9f256 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 8 Dec 2024 15:49:51 -0800 Subject: [PATCH 087/113] Editor::field_14C set to uint32 --- Spore ModAPI/Spore/Editors/Editor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index fb8e143e..3feccf9e 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -300,7 +300,7 @@ namespace Editors /* 143h */ bool field_143; // not initialized /* 144h */ bool field_144; // true /* 148h */ ObjectPtr field_148; - /* 14Ch */ int field_14C; // vertebra? only present in creature-like editor + /* 14Ch */ uint32_t field_14C; // vertebra? only present in creature-like editor /* 150h */ cEditorSkinPtr mpEditorSkin; // something related with painting? uses sub_4C3E70 to return something that parts also use /* 154h */ cEditorSkinPtr field_154; From 2895833f16347fc7cdc80f2de7affe7866353441 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 20 Jan 2025 15:56:13 -0800 Subject: [PATCH 088/113] change PaletteUIPtr to Palettes::PaletteUI* in thumbnail capture --- .../Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index 1becac6a..a0b31734 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -46,7 +46,7 @@ ThumbnailCaptureScript::~ThumbnailCaptureScript() //--------------------------------------------------- // Detours -PaletteUIPtr pLastPalette; +Palettes::PaletteUI* pLastPalette; // Editor parts palette loading func, PaletteUI::Load. Used to pull the ingame palettes member_detour(PaletteUILoad_detour, Palettes::PaletteUI, void(Palettes::PaletteMain*, UTFWin::IWindow*, bool, Palettes::PaletteInfo*)) { From 8ccda3c9a8d95e3c082c3148af2827a0db2125e5 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sat, 22 Mar 2025 12:51:01 -0700 Subject: [PATCH 089/113] add kHandheldItemTrgWildHorn to HandheldItem enum --- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index 90778478..981e8b73 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -814,8 +814,8 @@ namespace Simulator kHandheldItemTrgRepairMallet = 19, /// trg_water_bucket kHandheldItemTrgWaterBucket = 20, - /// 0xA8F747AE, some tribal horn - kHandheldItemUnk21 = 21, + /// trg_wildhorn + kHandheldItemTrgWildHorn = 21, /// trg_firebomb kHandheldItemTrgFireBomb = 22, /// trg_eating_egg From 6ba7df2a2d0c4b94716040acc5d31de17e678c9a Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 24 Mar 2025 14:27:46 -0700 Subject: [PATCH 090/113] add -help param to animeditor, rename cCreatureCitizen::field_FFC to mCurrentHandheldItem, fix typos, annotate vars/enums --- .../Example Projects/ModCreatorKit/AnimEditorMode.cpp | 6 +++++- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 8 ++++---- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 4 ++-- Spore ModAPI/Spore/Simulator/cCreatureCitizen.h | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp b/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp index 9028b90f..94f7bc44 100644 --- a/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp +++ b/Projects/Example Projects/ModCreatorKit/AnimEditorMode.cpp @@ -64,6 +64,10 @@ bool AnimEditorMode::Initialize(App::IGameModeManager* pManager) GameModeManager.SetActiveMode(MODE_ID); } else { + if (auto args = line.GetOption("help", 1)) + { + App::ConsolePrintF("Params: -add, -remove, -play [hash], -default, -help, -exit"); + } if (auto args = line.GetOption("remove", 1)) { int index = mpFormatParser->ParseInt(args[0]); @@ -75,7 +79,7 @@ bool AnimEditorMode::Initialize(App::IGameModeManager* pManager) request.shopperID = id("CreatureShopper"); Sporepedia::ShopperRequest::Show(request); } - else if (line.HasFlag("exit")) + else if (line.HasFlag("exit") || line.HasFlag("quit")) { GameModeManager.SetActiveMode(kGGEMode); } diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index 981e8b73..d8dffc5b 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -774,11 +774,11 @@ namespace Simulator enum HandheldItem { kHandheldItemNone = 0, - /// trg_hunting_tool1 + /// trg_hunting_tool1 - Allowed in combat kHandheldItemTrgHuntingTool1 = 1, - /// trg_hunting_tool2 + /// trg_hunting_tool2 - Allowed in combat kHandheldItemTrgHuntingTool2 = 2, - /// trg_hunting_tool3 + /// trg_hunting_tool3 - Allowed in combat kHandheldItemTrgHuntingTool3 = 3, /// trg_fishing_tool and related kHandheldItemTrgFishingTool = 4, @@ -806,7 +806,7 @@ namespace Simulator kHandheldItemTrgSocialDidgeridoo = 15, /// trg_gathering_treesmacker kHandheldItemTrgGatheringTreeSmacker = 16, - /// trg_chieftain_staff + /// trg_chieftain_staff - Allowed in combat kHandheldItemTrgChieftainStaff = 17, /// trg_healing_staff kHandheldItemTrgHealingStaff = 18, diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index 4bbc5484..cbfa9341 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -53,7 +53,7 @@ namespace Simulator /* 00h */ bool field_00; /* 01h */ bool field_01; /* 04h */ int field_04; - /* 08h */ ResourceID field_08; + /* 08h */ ResourceID field_08; // Ability resource? }; ASSERT_SIZE(cAbilityState, 0x10); // Maybe used in other places as well? @@ -140,7 +140,7 @@ namespace Simulator /// @param amount void ConsumeEnergy(float amount); - /// Returns the index to the first ability of the craeture that has the specified ability type. + /// Returns the index to the first ability of the creature that has the specified ability type. /// @param abilityType /// @returns Index to ability, or -1 if not found int GetAbilityIndexByType(int abilityType); diff --git a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h index d135837f..5feb2ff3 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h @@ -48,7 +48,7 @@ namespace Simulator /* FF0h */ int field_FF0; /* FF4h */ int mSelectionGroup; // -1 /* FF8h */ int field_FF8; // -1 - /* FFCh */ int field_FFC; + /* FFCh */ int mCurrentHandheldItem; // index of HandheldItem /* 1000h */ bool mAffectedByRecruiting; /* 1001h */ bool field_1001; // not initialized /* 1002h */ bool field_1002; // true From 7de9d8482fadb59e04e5df758d36b5756b1d55ab Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 24 Mar 2025 22:22:26 -0700 Subject: [PATCH 091/113] clarify raids and gifts in CitizenActions --- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index d8dffc5b..47f9034b 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -750,18 +750,18 @@ namespace Simulator kCitizenActionHeal = 5, kCitizenActionAttack = 7, - kCitizenActionRaid1 = 8, - kCitizenActionGift1 = 9, + kCitizenActionRaidFood = 8, + kCitizenActionGiftFood = 9, kCitizenActionHunt = 10, kCitizenActionMate = 11, - kCitizenActionParty = 12, + kCitizenActionParty = 12, // Dance around the fire, actionObject = fire pit kCitizenActionCollectEgg = 13, kCitizenActionBundle = 14, - kCitizenActionRaid2 = 15, + kCitizenActionRaidHuts = 15, kCitizenActionFeedWild = 20, - kCitizenActionGift2 = 21, + kCitizenActionGiftMember = 21, kCitizenActionRepair = 24, // actionObject = cTribeHut or cTribeTool kCitizenActionTame = 25, From 5e1b125aa34c71a35e9ba70edf5d4ec3958545e4 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 21 Apr 2025 17:22:58 -0700 Subject: [PATCH 092/113] Rename Unknowns, Annotate vars, fix typos --- Spore ModAPI/SourceCode/UTFWin/Tooltips.cpp | 8 +-- Spore ModAPI/Spore/Audio/AudioSystem.h | 2 +- Spore ModAPI/Spore/Palettes/StandardItemUI.h | 4 +- Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 14 ++-- Spore ModAPI/Spore/Simulator/cCombatant.h | 2 +- Spore ModAPI/Spore/Simulator/cCommunity.h | 2 +- .../Spore/Simulator/cCommunityLayout.h | 2 +- .../Spore/Simulator/cLocomotiveObject.h | 3 +- .../Spore/Simulator/cTribeInputStrategy.h | 2 +- Spore ModAPI/Spore/UI/SimulatorRollovers.h | 5 +- Spore ModAPI/Spore/UTFWin/Cursors.h | 68 ++++++++++++++----- Spore ModAPI/Spore/UTFWin/GlideEffect.h | 2 +- Spore ModAPI/Spore/UTFWin/IWindow.h | 20 +++++- Spore ModAPI/Spore/UTFWin/Image.h | 2 - Spore ModAPI/Spore/UTFWin/ImageDrawable.h | 9 +++ .../Spore/UTFWin/SporeTooltipWinProc.h | 5 +- 16 files changed, 107 insertions(+), 43 deletions(-) diff --git a/Spore ModAPI/SourceCode/UTFWin/Tooltips.cpp b/Spore ModAPI/SourceCode/UTFWin/Tooltips.cpp index 50986be8..2a83e6c6 100644 --- a/Spore ModAPI/SourceCode/UTFWin/Tooltips.cpp +++ b/Spore ModAPI/SourceCode/UTFWin/Tooltips.cpp @@ -33,8 +33,8 @@ namespace UTFWin , mDetailedText() , mOffsetPosition(0, 30.0f) , field_4C() - , field_50() - , field_54() + , mLocaleID() + , mLayoutGroupID() , field_58() , mBehaviour(TooltipBehaviour::Default) , field_60() @@ -58,8 +58,8 @@ namespace UTFWin , mDetailedText(pDetailedText) , mOffsetPosition(offsetPositon) , field_4C() - , field_50() - , field_54() + , mLocaleID() + , mLayoutGroupID() , field_58() , mBehaviour(behaviour) , field_60() diff --git a/Spore ModAPI/Spore/Audio/AudioSystem.h b/Spore ModAPI/Spore/Audio/AudioSystem.h index edc36e0a..09710938 100644 --- a/Spore ModAPI/Spore/Audio/AudioSystem.h +++ b/Spore ModAPI/Spore/Audio/AudioSystem.h @@ -32,7 +32,7 @@ namespace Audio class AudioSystem { - //PLACEHODER we might need to complete this + //PLACEHOLDER we might need to complete this /* 00h */ int func00h(); /* 04h */ int func04h(); diff --git a/Spore ModAPI/Spore/Palettes/StandardItemUI.h b/Spore ModAPI/Spore/Palettes/StandardItemUI.h index 1881c513..9fda01e3 100644 --- a/Spore ModAPI/Spore/Palettes/StandardItemUI.h +++ b/Spore ModAPI/Spore/Palettes/StandardItemUI.h @@ -43,9 +43,9 @@ namespace Palettes public: /* 0Ch */ PaletteItemPtr mpItem; - /* 10h */ uint32_t field_10; + /* 10h */ uint32_t field_10; // 0x1CEB6B70 /* 14h */ ItemViewerPtr mpViewer; - /* 18h */ IWindowPtr field_18; + /* 18h */ IWindowPtr mpWindow; // Main window. Holds the icon and detects focus /* 1Ch */ bool field_1C; }; ASSERT_SIZE(StandardItemUI, 0x20); diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index 47f9034b..8c5e978f 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -749,26 +749,28 @@ namespace Simulator kCitizenActionHeal = 5, - kCitizenActionAttack = 7, + kCitizenActionSleep = 6, // Sends the creature into the main tribe hut + + kCitizenActionAttack = 7, // Attack a citizen kCitizenActionRaidFood = 8, kCitizenActionGiftFood = 9, - kCitizenActionHunt = 10, + kCitizenActionHunt = 10, // Attack a wild animal kCitizenActionMate = 11, - kCitizenActionParty = 12, // Dance around the fire, actionObject = fire pit + kCitizenActionParty = 12, // Dance around the game object, actionObject = fire pit or other cTribeTool kCitizenActionCollectEgg = 13, kCitizenActionBundle = 14, - kCitizenActionRaidHuts = 15, + kCitizenActionRaidHuts = 15, // Attack huts or tools of this tribe, starting with the actionObject = cTribeHut or cTribeTool kCitizenActionFeedWild = 20, kCitizenActionGiftMember = 21, kCitizenActionRepair = 24, // actionObject = cTribeHut or cTribeTool kCitizenActionTame = 25, - kCitizenActionRecruit = 26, + kCitizenActionRecruit = 26, // Begin social minigame kCitizenActionGatherMeat = 27, - kCitizenActionUnk1 = 28, // common ID, actionObject = nullptr + kCitizenActionReturnToTribe = 28, // Sends the creature back to their tribe. actionObject = nullptr }; enum HandheldItem diff --git a/Spore ModAPI/Spore/Simulator/cCombatant.h b/Spore ModAPI/Spore/Simulator/cCombatant.h index 5500549c..fcdbc33e 100644 --- a/Spore ModAPI/Spore/Simulator/cCombatant.h +++ b/Spore ModAPI/Spore/Simulator/cCombatant.h @@ -79,7 +79,7 @@ namespace Simulator /* 14h */ virtual cSpaceToolData* GetWeapon(); /// Called when the combatant is attacked, takes the damage - /* 18h */ virtual int TakeDamage(float damage, uint32_t attackerPoliticalID, int, const Vector3&, cCombatant* pAttacker); // used to substract health? + /* 18h */ virtual int TakeDamage(float damage, uint32_t attackerPoliticalID, int, const Vector3&, cCombatant* pAttacker); // used to substract health /* 1Ch */ virtual void AddHostileUnit(cCombatant* combatant); /* 20h */ virtual Math::Vector3 func20h(); diff --git a/Spore ModAPI/Spore/Simulator/cCommunity.h b/Spore ModAPI/Spore/Simulator/cCommunity.h index e1f790bb..af0b52cf 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunity.h +++ b/Spore ModAPI/Spore/Simulator/cCommunity.h @@ -101,7 +101,7 @@ namespace Simulator /* ACh */ int field_AC; /* B0h */ cGonzagoTimer field_B0; /* D0h */ eastl::vector field_D0; // With release at C0h - /* E4h */ eastl::vector mCommunityMembers; + /* E4h */ eastl::vector mCommunityMembers; /* F8h */ eastl::string16 mName; /* 108h */ eastl::string16 mDescription; /* 118h */ int field_118; // -1 diff --git a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h index 6aff8d2a..13e12601 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunityLayout.h +++ b/Spore ModAPI/Spore/Simulator/cCommunityLayout.h @@ -44,7 +44,7 @@ namespace Simulator /* 20h */ float field_20; /* 24h */ int field_24; // not initialized /* 28h */ bool field_28; - /* 2Ch */ Quaternion field_2C; + /* 2Ch */ Quaternion field_2C; // Orientation? /* 3Ch */ eastl::vector field_3C; /* 50h */ eastl::vector mSlots; }; diff --git a/Spore ModAPI/Spore/Simulator/cLocomotiveObject.h b/Spore ModAPI/Spore/Simulator/cLocomotiveObject.h index d1e3f06d..ab6ca4be 100644 --- a/Spore ModAPI/Spore/Simulator/cLocomotiveObject.h +++ b/Spore ModAPI/Spore/Simulator/cLocomotiveObject.h @@ -71,7 +71,8 @@ namespace Simulator /* D8h */ virtual float funcD8h() const; /* DCh */ virtual void funcDCh(int); // some kind of movement request? sets mInTransitTime = 0 // the bool might be "relative" position? - /* E0h */ virtual void MoveTo(const Vector3& dst, float goalStopDistance = 1.0f, float acceptableStopDistance = 2.0f, bool=false); + // setting it to true makes vehicles move properly in straight lines. + /* E0h */ virtual void MoveTo(const Vector3& dst, float goalStopDistance = 1.0f, float acceptableStopDistance = 2.0f, bool unk1 = false); /* E4h */ virtual void funcE4h(const Vector3&, int); /* E8h */ virtual void funcE8h(const Vector3&, float, float); /* ECh */ virtual void StopMovement(); diff --git a/Spore ModAPI/Spore/Simulator/cTribeInputStrategy.h b/Spore ModAPI/Spore/Simulator/cTribeInputStrategy.h index 1ee73892..a9b9c388 100644 --- a/Spore ModAPI/Spore/Simulator/cTribeInputStrategy.h +++ b/Spore ModAPI/Spore/Simulator/cTribeInputStrategy.h @@ -41,7 +41,7 @@ namespace Simulator /// Sets the current cursor, and maybe shows a rollover, depending on the current object /// pointed at by the mouse cursor. The object will be cGameViewManager::GetHoveredObject() - /// The method will do nothing is IsInEditor() returns true. + /// The method will do nothing if IsInEditor() returns true. void SetHoverObjectCursorAndRollover(); /// Returns true if the player has gone to the creature outfitter editor, false otherwise. diff --git a/Spore ModAPI/Spore/UI/SimulatorRollovers.h b/Spore ModAPI/Spore/UI/SimulatorRollovers.h index a34bf8e5..fe1d1fa2 100644 --- a/Spore ModAPI/Spore/UI/SimulatorRollovers.h +++ b/Spore ModAPI/Spore/UI/SimulatorRollovers.h @@ -8,7 +8,10 @@ namespace UI { enum class SimulatorRolloverID { - + // Invalid / Dead, 0 health no information + Invalid = 0, + /// No rollover + None = 1, /// Rollover_TribeTool TribeTool = 2, /// Rollover_TribeCitizen diff --git a/Spore ModAPI/Spore/UTFWin/Cursors.h b/Spore ModAPI/Spore/UTFWin/Cursors.h index 0c040d74..2dd9289d 100644 --- a/Spore ModAPI/Spore/UTFWin/Cursors.h +++ b/Spore ModAPI/Spore/UTFWin/Cursors.h @@ -116,13 +116,13 @@ namespace UTFWin /// STD_Center-alpha09 StdCenterAlpha09 = 0x1023, + ///------------------- + /// Simulator Cursors + ///------------------- /// cursor-no-opt NoOptions = 0x3a204b0, - /// cursor_goodie-hut - QuestionHut = 0x56e3a22, - // cursor-object-translate Pan = 0x600cd69, @@ -132,6 +132,14 @@ namespace UTFWin /// cursor-ban-mode BanMode = 0x5ecbdffd, + + ///------------------- + /// CRG Cursors + ///------------------- + + /// cur_ClaimNest + ClaimNest = 0x7542cdb5, + /// cursor_skeleton2 UnlockSkeleton = 0x342d221f, @@ -159,6 +167,23 @@ namespace UTFWin /// cursor_friend Friend = 0x755c4eb5, + /// cursor-crg-pickup + Pickup = 0x3b360dc, + + /// cursor-crg-putdown + Putdown = 0x3b360df, + + /// cursor-crg-throw + Throw = 0x3b360e4, + + + ///------------------- + /// TRG Cursors + ///------------------- + + /// cursor-dance + Dance = 0x3febe3d, + /// cursor-trg-domesticate Domesticate = 0xe382f00e, @@ -180,15 +205,6 @@ namespace UTFWin /// cursor-gather Gather = 0x3febe40, - /// cursor-crg-pickup - Pickup = 0x3b360dc, - - /// cursor-crg-putdown - Putdown = 0x3b360df, - - /// cursor-crg-throw - Throw = 0x3b360e4, - /// cursor_pickup-maracas PickupMaracas = 0x63fe8d4, @@ -216,15 +232,21 @@ namespace UTFWin /// cursor_pickup-heal PickupHealing = 0x3febe3b, - /// cursor-dance - Dance = 0x3febe3d, + + ///------------------- + /// CVG Cursors + ///------------------- /// cursor-claim-spicemine ClaimSpice = 0x5d53800, - /// cur_ClaimNest - ClaimNest = 0x7542cdb5, + /// cursor_goodie-hut + QuestionHut = 0x56e3a22, + + ///------------------- + /// SPG Cursors + ///------------------- /// cursor-spg-sculpting-norm SpgSculpting = 0x682102e, @@ -259,6 +281,20 @@ namespace UTFWin /// cursor-spg-atmospheric-norm SpgAtmosphere = 0x6821042, + + ///------------------- + /// EP1 Cursors + ///------------------- + + /// cursor-object-scale + ObjectScale = 0xe84563d4, + + /// cursor-translate-XY + TranslateXY = 0xf728e452, + + /// cursor-translate-Z + TranslateZ = 0x7391920b, + }; } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/UTFWin/GlideEffect.h b/Spore ModAPI/Spore/UTFWin/GlideEffect.h index a193f116..66b7bda2 100644 --- a/Spore ModAPI/Spore/UTFWin/GlideEffect.h +++ b/Spore ModAPI/Spore/UTFWin/GlideEffect.h @@ -25,7 +25,7 @@ namespace UTFWin { - class IGlideEffect : public UTFWinObject + class IGlideEffect : public IBiStateEffect { public: /// diff --git a/Spore ModAPI/Spore/UTFWin/IWindow.h b/Spore ModAPI/Spore/UTFWin/IWindow.h index 18a691f6..1606ba2c 100644 --- a/Spore ModAPI/Spore/UTFWin/IWindow.h +++ b/Spore ModAPI/Spore/UTFWin/IWindow.h @@ -196,7 +196,7 @@ namespace UTFWin /* 58h */ virtual void SetState(int state) = 0; /// - /// Returns the color modulation value. This color acts as a tint: after the window is painted, it gets multiplied by this color. + /// Sets the color modulation value. This color acts as a tint: after the window is painted, it gets multiplied by this color. /// @param color The color to use as the 'shadeColor' property. /// /* 5Ch */ virtual void SetShadeColor(Math::Color color) = 0; @@ -544,20 +544,34 @@ namespace UTFWin } /// - /// Tells whether the window is visible. This is equivalent to GetFlags() & kWinFlagEnabled. + /// Tells whether the window is enabled. This is equivalent to GetFlags() & kWinFlagEnabled. /// inline bool IsEnabled() const { return GetFlags() & kWinFlagEnabled; } /// - /// Switches the visibility of this window. This is equivalent to SetFlag(kWinFlagEnabled, bEnabled). + /// Switches the enabled state of this window. This is equivalent to SetFlag(kWinFlagEnabled, bEnabled). /// inline void SetEnabled(bool bEnabled) { SetFlag(kWinFlagEnabled, bEnabled); } + /// + /// Tells whether the window ignores the mouse. This is equivalent to GetFlags() & kWinFlagIgnoreMouse. + /// + inline bool IsIgnoringMouse() const + { + return GetFlags() & kWinFlagIgnoreMouse; + } + /// + /// Switches whether the window ignores the mouse. This is equivalent to SetFlag(kWinFlagIgnoreMouse, bEnabled). + /// + inline void SetIgnoreMouse(bool bIgnoreMouse) + { + SetFlag(kWinFlagIgnoreMouse, bIgnoreMouse); + } /// /// Sets the given UTFWin::IWindow to fit the entire area of its parent. diff --git a/Spore ModAPI/Spore/UTFWin/Image.h b/Spore ModAPI/Spore/UTFWin/Image.h index 3f2554c9..7e29e84c 100644 --- a/Spore ModAPI/Spore/UTFWin/Image.h +++ b/Spore ModAPI/Spore/UTFWin/Image.h @@ -82,8 +82,6 @@ namespace UTFWin /// /// The method will try to use the existing drawable of the window; if there's no drawable or it's not an StdDrawable or /// an ImageDrawable, one will be created; by default an ImageDrawable will be created, unless an image index is specified. - /// - /// To detour this method, you must use GetAddress(Image, SetBackground_2). /// /// @param pWindow The IWindow whose drawable will change. /// @param imageName The ResourceKey that points to the image file that will be displayed in the window. diff --git a/Spore ModAPI/Spore/UTFWin/ImageDrawable.h b/Spore ModAPI/Spore/UTFWin/ImageDrawable.h index a090bb7a..39f6ecb3 100644 --- a/Spore ModAPI/Spore/UTFWin/ImageDrawable.h +++ b/Spore ModAPI/Spore/UTFWin/ImageDrawable.h @@ -193,6 +193,14 @@ namespace UTFWin virtual void SetAlignmentVertical(AlignmentV alignment) override; virtual AlignmentV GetAlignmentVertical() const override; + inline OutlineFormat GetImageOutline() { + return mImageOutline; + } + + inline OutlineFormat SetImageOutline(OutlineFormat outline) { + mImageOutline = outline; + } + protected: /* 10h */ float mfScale; @@ -238,6 +246,7 @@ namespace UTFWin DeclareAddress(SetImageForWindow); // 0xE2F550 0xE2F590 } + inline ImageDrawable::ImageDrawable() : mfScale(1.0f) , mnFlags() diff --git a/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h b/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h index a1ae890d..767f2069 100644 --- a/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h +++ b/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h @@ -78,8 +78,9 @@ namespace UTFWin /// The offset of the tooltip window relative to the cursor, by default (0, 30). /* 44h */ Math::Point mOffsetPosition; // (0, 30) /* 4Ch */ int field_4C; - /* 50h */ int field_50; - /* 54h */ int field_54; + /* 50h */ uint32_t mLocaleID; + /// layout group ID, by default 0x40464100 / layouts~ + /* 54h */ uint32_t mLayoutGroupID; // 0x40464100 /* 58h */ bool field_58; /// Sets the tooltip display behavior. /* 5Ch */ TooltipBehaviour mBehaviour; From 796ab7cdd17f2b596f41e3ad35babfb49cceed26 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 21 Apr 2025 17:24:08 -0700 Subject: [PATCH 093/113] Add GetOrientationYawTowards to cSpatialObject --- .../SourceCode/Simulator/cSpatialObject.cpp | 21 +++++++++++++++++++ Spore ModAPI/Spore/Simulator/cSpatialObject.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/Spore ModAPI/SourceCode/Simulator/cSpatialObject.cpp b/Spore ModAPI/SourceCode/Simulator/cSpatialObject.cpp index c1e4d662..976cf073 100644 --- a/Spore ModAPI/SourceCode/Simulator/cSpatialObject.cpp +++ b/Spore ModAPI/SourceCode/Simulator/cSpatialObject.cpp @@ -29,5 +29,26 @@ namespace Simulator void cLocomotiveObject::SetVelocity(const Vector3& velocity) { this->mVelocity = velocity; } + + Math::Quaternion cSpatialObject::GetOrientationYawTowards(const Vector3& targetpos) + { + Vector3 upVector = GetPosition().Normalized(); // Local up axis + + // Compute direction to the target + Vector3 direction = (targetpos - GetPosition()).Normalized(); + + // Project onto the X-Z plane (perpendicular to upVector) + direction = (direction - upVector * direction.Dot(upVector)).Normalized(); + + // Project forward vector onto the same X-Z plane + Vector3 forward = (GetDirection() - upVector * GetDirection().Dot(upVector)).Normalized(); + + // Compute the yaw rotation needed + Quaternion yawRotation; + yawRotation = yawRotation.GetRotationTo(forward, direction); + + // Apply the yaw rotation while maintaining the original pitch and roll + return (yawRotation * GetOrientation()); + } } #endif diff --git a/Spore ModAPI/Spore/Simulator/cSpatialObject.h b/Spore ModAPI/Spore/Simulator/cSpatialObject.h index f14f9290..01b5f404 100644 --- a/Spore ModAPI/Spore/Simulator/cSpatialObject.h +++ b/Spore ModAPI/Spore/Simulator/cSpatialObject.h @@ -113,6 +113,9 @@ namespace Simulator /* BCh */ virtual int AddRef() = 0; /* C0h */ virtual int Release() = 0; + // Return a new orientation towards a target pos, preserving the pitch and roll of the current orientation + Math::Quaternion GetOrientationYawTowards(const Math::Vector3& targetpos); + public: /* 04h */ Math::Vector3 mPosition; From 1c61d15b5eba9aae31a5a2eb9a0f6310704f24a7 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 21 Apr 2025 17:26:01 -0700 Subject: [PATCH 094/113] Update the Mod Creator Kit to use new variable names --- .../ModCreatorKit/ThumbnailCaptureScript.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index a0b31734..82084a59 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -199,8 +199,8 @@ void ThumbnailCaptureScript::InjectListeners() { // standard editor/planner if (pageUI.page->mStandardItems.size() > 0) { for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { - itemUI->field_18->AddWinProc(this); - mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + itemUI->mpWindow->AddWinProc(this); + mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); } } // adventure editor @@ -208,7 +208,7 @@ void ThumbnailCaptureScript::InjectListeners() { else { for (eastl::intrusive_ptr itemUI : pageUI.page->mAdvancedItems) { itemUI->mpWindow - mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); } }*/ @@ -219,8 +219,8 @@ void ThumbnailCaptureScript::InjectListeners() { else { for (auto pageUI : catUI->mPageUIs) { for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { - itemUI->field_18->AddWinProc(this); - mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get(); + itemUI->mpWindow->AddWinProc(this); + mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); } } } @@ -247,14 +247,14 @@ void ThumbnailCaptureScript::RemoveListeners() { // standard editor/planner if (pageUI.page->mStandardItems.size() > 0) { for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { - itemUI->field_18->RemoveWinProc(this); + itemUI->mpWindow->RemoveWinProc(this); } } /* // adventure editor else { for (StandardItemUIPtr itemUI : pageUI.page->mpPage->mItems) { - itemUI->field_18->RemoveWinProc(this); + itemUI->mpWindow->RemoveWinProc(this); } } */ @@ -265,8 +265,8 @@ void ThumbnailCaptureScript::RemoveListeners() { else { for (auto pageUI : catUI->mPageUIs) { for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { - if (itemUI && itemUI->field_18) { - itemUI->field_18->RemoveWinProc(this); + if (itemUI && itemUI->mpWindow) { + itemUI->mpWindow->RemoveWinProc(this); } } } From 36d8196550e3ea843240392dc5a3ce9e7d77a860 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 21 Apr 2025 17:27:04 -0700 Subject: [PATCH 095/113] Add Mod Creator Kit cheats devSFXLog and devPlaySound --- .../Example Projects/ModCreatorKit/Cheats.cpp | 4 +++ .../ModCreatorKit/ModCreatorKit.vcxproj | 16 ++++++++++ .../ModCreatorKit.vcxproj.filters | 12 +++++++ .../ModCreatorKit/PlaySoundCheat.cpp | 27 ++++++++++++++++ .../ModCreatorKit/PlaySoundCheat.h | 20 ++++++++++++ .../ModCreatorKit/SFXLogCheat.cpp | 31 +++++++++++++++++++ .../ModCreatorKit/SFXLogCheat.h | 16 ++++++++++ .../ModCreatorKit/dllmain.cpp | 4 +++ 8 files changed, 130 insertions(+) create mode 100644 Projects/Example Projects/ModCreatorKit/PlaySoundCheat.cpp create mode 100644 Projects/Example Projects/ModCreatorKit/PlaySoundCheat.h create mode 100644 Projects/Example Projects/ModCreatorKit/SFXLogCheat.cpp create mode 100644 Projects/Example Projects/ModCreatorKit/SFXLogCheat.h diff --git a/Projects/Example Projects/ModCreatorKit/Cheats.cpp b/Projects/Example Projects/ModCreatorKit/Cheats.cpp index 2d40edc2..a3d3a2fc 100644 --- a/Projects/Example Projects/ModCreatorKit/Cheats.cpp +++ b/Projects/Example Projects/ModCreatorKit/Cheats.cpp @@ -23,10 +23,12 @@ #include "AddressCheat.h" #include "AnimLogCheat.h" #include "EffectLogCheat.h" +#include "SFXLogCheat.h" #include "PackageCheat.h" #include "PrintCursorCheat.h" #include "UILogCheat.h" #include "UIInspectCheat.h" +#include "PlaySoundCheat.h" #include #include @@ -49,11 +51,13 @@ void AddCheats() { CheatManager.AddCheat("devContext", new ContextCheat()); CheatManager.AddCheat("devAnimLog", new AnimLogCheat()); + CheatManager.AddCheat("devSFXLog", new SFXLogCheat()); CheatManager.AddCheat("devEffectLog", new EffectLogCheat()); CheatManager.AddCheat("devPackage", new PackageCheat()); CheatManager.AddCheat("devLogUI", new UILogCheat()); CheatManager.AddCheat("devInspectUI", new UIInspectCheat()); CheatManager.AddCheat("devPrintCursor", new PrintCursorCheat()); + CheatManager.AddCheat("devPlaySound", new PlaySoundCheat()); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x1498444, 0x1493E5C)), "devRaid"); AddressCheat::AddCheat(Address(ModAPI::ChooseAddress(0x149845C, 0x1493E74)), "devSpace"); diff --git a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj index 778effef..8175f68a 100644 --- a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj +++ b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj @@ -126,10 +126,18 @@ + + + + + + + + @@ -174,10 +182,18 @@ + + + + + + + + Create Create diff --git a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters index 5658ab39..c18d1f32 100644 --- a/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters +++ b/Projects/Example Projects/ModCreatorKit/ModCreatorKit.vcxproj.filters @@ -94,6 +94,12 @@ ModCreatorKit\Cheats + + ModCreatorKit\Cheats + + + ModCreatorKit\Cheats + @@ -165,6 +171,12 @@ ModCreatorKit\Cheats + + ModCreatorKit\Cheats + + + ModCreatorKit\Cheats + diff --git a/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.cpp b/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.cpp new file mode 100644 index 00000000..12ad7aae --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.cpp @@ -0,0 +1,27 @@ +#include "stdafx.h" +#include "PlaySoundCheat.h" + +PlaySoundCheat::PlaySoundCheat() +{ +} + + +PlaySoundCheat::~PlaySoundCheat() +{ +} + + +void PlaySoundCheat::ParseLine(const ArgScript::Line& line) +{ + mParameter = line.GetArguments(1)[0]; + if (string16(mParameter).find(u"0x") == 0) { + Audio::PlayAudio(mpFormatParser->ParseUInt(mParameter)); + } + + Audio::PlayAudio(id(mParameter)); +} + +const char* PlaySoundCheat::GetDescription(ArgScript::DescriptionMode mode) const +{ + return "Plays an SNR sound file by name or hash."; +} diff --git a/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.h b/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.h new file mode 100644 index 00000000..5dfc7a9f --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/PlaySoundCheat.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +class PlaySoundCheat + : public ArgScript::ICommand +{ +public: + PlaySoundCheat(); + ~PlaySoundCheat(); + + // Called when the cheat is invoked + void ParseLine(const ArgScript::Line& line) override; + + // Returns a string containing the description. If mode != DescriptionMode::Basic, return a more elaborated description + const char* GetDescription(ArgScript::DescriptionMode mode) const override; +private: + const char* mParameter; +}; + diff --git a/Projects/Example Projects/ModCreatorKit/SFXLogCheat.cpp b/Projects/Example Projects/ModCreatorKit/SFXLogCheat.cpp new file mode 100644 index 00000000..42716d55 --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/SFXLogCheat.cpp @@ -0,0 +1,31 @@ +#include "stdafx.h" +#include "SFXLogCheat.h" + + +bool SFXLogCheat::IsEnabled = false; + +// Detour the audio playing func +static_detour(PlayAudio_detour, void(uint32_t, Audio::AudioTrack)) { + void detoured(uint32_t soundID, Audio::AudioTrack track) { + original_function(soundID, track); + if (SFXLogCheat::IsEnabled && soundID != 0) + { + App::ConsolePrintF("devSFXLog: playing Audio ID: 0x%x", soundID); + } + } +}; + +void SFXLogCheat::AttachDetour() { + PlayAudio_detour::attach(GetAddress(Audio, PlayAudio)); +} + +void SFXLogCheat::ParseLine(const ArgScript::Line& line) +{ + auto args = line.GetArguments(1); + SFXLogCheat::IsEnabled = mpFormatParser->ParseBool(args[0]); +} + +const char* SFXLogCheat::GetDescription(ArgScript::DescriptionMode mode) const +{ + return "Usage: sfxLog on/off. If enabled, every time a UI sound effect is played it will print its ID. Does not include creature voices or world sounds."; +} diff --git a/Projects/Example Projects/ModCreatorKit/SFXLogCheat.h b/Projects/Example Projects/ModCreatorKit/SFXLogCheat.h new file mode 100644 index 00000000..dd42b25a --- /dev/null +++ b/Projects/Example Projects/ModCreatorKit/SFXLogCheat.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +class SFXLogCheat + : public ArgScript::ICommand +{ +public: + void ParseLine(const ArgScript::Line& line) override; + const char* GetDescription(ArgScript::DescriptionMode mode) const override; + + static bool IsEnabled; + + static void AttachDetour(); +}; + diff --git a/Projects/Example Projects/ModCreatorKit/dllmain.cpp b/Projects/Example Projects/ModCreatorKit/dllmain.cpp index 39d9f68f..be431285 100644 --- a/Projects/Example Projects/ModCreatorKit/dllmain.cpp +++ b/Projects/Example Projects/ModCreatorKit/dllmain.cpp @@ -8,6 +8,8 @@ #include "Cheats.h" #include "ThumbnailCaptureScript.h" #include "AnimLogCheat.h" +#include "EffectLogCheat.h" +#include "SFXLogCheat.h" #include "UILogCheat.h" #include "AnimEditorMode.h" @@ -108,6 +110,8 @@ void AttachDetours() Debugging::AttachDetour(); cEffectsManager_detour::attach(GetAddress(Swarm::cSwarmManager, GetDirectoryAndEffectIndex)); AnimLogCheat::AttachDetour(); + EffectLogCheat::AttachDetour(); + SFXLogCheat::AttachDetour(); UILogCheat::AttachDetour(); ThumbnailCaptureScript::AttachDetour(); } From ba13c57843f441684d7fc442694a84ba21e581b8 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Fri, 25 Apr 2025 12:52:18 -0700 Subject: [PATCH 096/113] fix typo --- Spore ModAPI/Spore/Anim/AnimatedCreature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Anim/AnimatedCreature.h b/Spore ModAPI/Spore/Anim/AnimatedCreature.h index cd63aaeb..c3341a2a 100644 --- a/Spore ModAPI/Spore/Anim/AnimatedCreature.h +++ b/Spore ModAPI/Spore/Anim/AnimatedCreature.h @@ -74,7 +74,7 @@ namespace Anim /* 18h */ virtual bool StartAnimation(AnimIndex index) = 0; /* 1Ch */ virtual bool func1Ch(AnimIndex index, float) = 0; - /// Enables or disables looping in this animation, which is repating the animation once it ends playing. + /// Enables or disables looping in this animation, which is repeating the animation once it ends playing. /// SetLoopTimes() must also be called to set how many times /// the animation is looped, setting it to -1 loops it indefinitely. /// @param index Index of the animation From 0f28d7e9935b60ee4e8a1619675aacd1c146dc19 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 22 Jun 2025 13:14:20 -0700 Subject: [PATCH 097/113] Annotate Editor Camera vars --- .../SourceCode/Editors/EditorCamera.cpp | 2 +- Spore ModAPI/Spore/Editors/EditorCamera.h | 22 ++++++++++++------- Spore ModAPI/Spore/Editors/EditorLimits.h | 2 +- Spore ModAPI/Spore/Palettes/PaletteCategory.h | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Spore ModAPI/SourceCode/Editors/EditorCamera.cpp b/Spore ModAPI/SourceCode/Editors/EditorCamera.cpp index 03476f6e..c8d36378 100644 --- a/Spore ModAPI/SourceCode/Editors/EditorCamera.cpp +++ b/Spore ModAPI/SourceCode/Editors/EditorCamera.cpp @@ -54,7 +54,7 @@ namespace Editors , mbEditorCameraTurntableStyle() , field_94() , field_98() - , field_9C() + , mbFOVisCurrent() , mInput() , mpViewer(nullptr) { diff --git a/Spore ModAPI/Spore/Editors/EditorCamera.h b/Spore ModAPI/Spore/Editors/EditorCamera.h index 95a0c821..51aa8786 100644 --- a/Spore ModAPI/Spore/Editors/EditorCamera.h +++ b/Spore ModAPI/Spore/Editors/EditorCamera.h @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** * Copyright (C) 2019 Eric Mor * * This file is part of Spore ModAPI. @@ -71,16 +71,22 @@ namespace Editors /* 24h */ float field_24; /* 28h */ float mfInitialZoom; // 1.0 /* 2Ch */ bool field_2C; - /* 30h */ float field_30; // cameraInitialHeading + /* 30h */ float field_30; // cameraInitialHeading (unclamped float Camera heading) /* 34h */ float field_34; // cameraInitialPitch /* 38h */ float mfZoom; // 10.0 // cameraInitialZoom - /* 3Ch */ float field_3C; // cameraInitialOffsetX - /* 40h */ float field_40; // cameraInitialOffsetY + /* 3Ch */ float field_3C; // cameraInitialOffsetX (desired) + /* 40h */ float field_40; // cameraInitialOffsetY (desired) + + /// field_44 is Camera heading in positive and negative radians + // range -pi to -0 facing creature front (☻) + // range pi to 0 facing creature back (•) + // +pi/2 creature facing screen right -> + // -pi/2 creature facing screen left <- /* 44h */ float field_44; // cameraInitialHeading /* 48h */ float field_48; // cameraInitialPitch /* 4Ch */ float field_4C; // cameraInitialZoom - /* 50h */ float field_50; // cameraInitialOffsetX - /* 54h */ float field_54; // cameraInitialOffsetY + /* 50h */ float field_50; // cameraInitialOffsetX (current/lerp from?) + /* 54h */ float field_54; // cameraInitialOffsetY (current/lerp from?) /* 58h */ float mfMinZoomDistance; // 5.0 /* 5Ch */ float mfMaxZoomDistance; // 25.0 /* 60h */ float mfMinPitch; @@ -89,12 +95,12 @@ namespace Editors /* 6Ch */ float mfFarClip; // -1 /* 70h */ float mfInitialFOV; // 57.29578 /* 74h */ Vector3 mCameraPosition; - /* 80h */ Vector3 field_80; + /* 80h */ Vector3 field_80; // also camera pos, one is probably current and one is desired... /* 8Ch */ float field_8C; // 1.0 /* 90h */ bool mbEditorCameraTurntableStyle; /* 94h */ float field_94; /* 98h */ float field_98; - /* 9Ch */ bool field_9C; + /* 9Ch */ bool mbFOVisCurrent; // change to false to update camera FOV to mfInitialFOV's value /* A0h */ GameInput mInput; /* E8h */ App::cViewer* mpViewer; }; diff --git a/Spore ModAPI/Spore/Editors/EditorLimits.h b/Spore ModAPI/Spore/Editors/EditorLimits.h index 4bd0aa37..cce2e5fd 100644 --- a/Spore ModAPI/Spore/Editors/EditorLimits.h +++ b/Spore ModAPI/Spore/Editors/EditorLimits.h @@ -38,7 +38,7 @@ namespace Editors /// Limits the value at the given index so that it's not greater than the limit. /* 1Ch */ virtual void EnsureLimit(int index); - /// Adds a certain amount to the value of the given index. The total value will be capped at its limit. + /// Adds a certain amount to the value of the given EditorLimitType index. The total value will be capped at its limit. /// A message of type `0x3150C27` will be sent /* 20h */ virtual void AddValue(int index, int value); /// Sets a certain value of the given index. The total value will be capped at its limit. diff --git a/Spore ModAPI/Spore/Palettes/PaletteCategory.h b/Spore ModAPI/Spore/Palettes/PaletteCategory.h index 44bbcf1f..c9062c6e 100644 --- a/Spore ModAPI/Spore/Palettes/PaletteCategory.h +++ b/Spore ModAPI/Spore/Palettes/PaletteCategory.h @@ -40,7 +40,7 @@ namespace Palettes /// /// Loads the configuration .prop file of this category; this does not load the pages nor the subcategories - /// contained on it. If the groupID of the ResourceKey given is 0, 0x406B0100 will be used as folder instead. + /// contained on it. If the groupID of the ResourceKey given is 0, 0x406B0100 (palette_config~) will be used as folder instead. /// /// @param name The ResourceKey that points to the .prop file. /// @param defaultLayoutID The default instance ID of the layout file that the category will use, if no layout is specified in the .prop file. From b883416ba5c92a9fa827978f558f09d131ad7fba Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 22 Jun 2025 13:14:31 -0700 Subject: [PATCH 098/113] Add Lerp() Math util --- Spore ModAPI/Spore/MathUtils.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/Spore/MathUtils.h b/Spore ModAPI/Spore/MathUtils.h index 81406b47..11c01ad0 100644 --- a/Spore ModAPI/Spore/MathUtils.h +++ b/Spore ModAPI/Spore/MathUtils.h @@ -105,6 +105,8 @@ namespace Math /// @param other float Dot(const Vector2& other) const; + Vector2 Lerp(const Vector2& other, float mix) const; + Vector2& operator+=(const Vector2&); Vector2& operator+=(float); Vector2& operator-=(const Vector2&); @@ -158,6 +160,8 @@ namespace Math /// @param orientationAxis static float OrientedAngle(const Vector3& v1, const Vector3& v2, const Vector3& orientationAxis); + Vector3 Lerp(const Vector3& other, float mix) const; + Vector3& operator+=(const Vector3&); Vector3& operator+=(float); Vector3& operator-=(const Vector3&); @@ -196,6 +200,8 @@ namespace Math /// @param other float Dot(const Vector4& other) const; + Vector4 Lerp(const Vector4& other, float mix) const; + Vector4& operator+=(const Vector4&); Vector4& operator+=(float); Vector4& operator-=(const Vector4&); @@ -1197,14 +1203,11 @@ namespace Math return x * other.x + y * other.y + z * other.z + w * other.w; } - - inline Vector3 BoundingBox::GetCenter() const { return (lower + upper) / 2.0f; } - inline bool Vector2::operator==(const Vector2& b) const { return x == b.x && y == b.y; } @@ -1357,6 +1360,21 @@ namespace Math inline ColorRGBA lerp(const ColorRGBA& a, const ColorRGBA& b, float mix) { return { lerp(a.r, b.r, mix), lerp(a.g, b.g, mix), lerp(a.b, b.b, mix), lerp(a.a, b.a, mix) }; } + + // Vector Lerps + + inline Vector2 Vector2::Lerp(const Vector2& other, float mix) const { + return { lerp(x, other.x, mix), lerp(y, other.y, mix) }; + } + + inline Vector3 Vector3::Lerp(const Vector3& other, float mix) const { + return { lerp(x, other.x, mix), lerp(y, other.y, mix), lerp(z, other.z, mix) }; + } + + inline Vector4 Vector4::Lerp(const Vector4& other, float mix) const { + return { lerp(x, other.x, mix), lerp(y, other.y, mix), lerp(z, other.z, mix), lerp(w, other.w, mix) }; + } + } #ifdef SDK_TO_GHIDRA From cd8b0ce2109c0cddcd4ce00f230ed9635a8de2f3 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 31 Jul 2025 17:53:29 -0700 Subject: [PATCH 099/113] Add names to Editor Palette vars --- Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp | 9 ++++++++- Spore ModAPI/Spore/Palettes/IItemFrameUI.h | 3 +++ Spore ModAPI/Spore/Palettes/PaletteCategory.h | 2 +- Spore ModAPI/Spore/Palettes/PalettePageUI.h | 2 +- Spore ModAPI/Spore/Palettes/PaletteUI.h | 13 +++++++------ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp index e8bd3837..fbe287c7 100644 --- a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp +++ b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp @@ -233,7 +233,7 @@ namespace Palettes , mpCategoryContent() , mpPalette(nullptr) , mCategories() - , field_48() + , mCategorySlots() , field_5C() , field_60() , mpActiveCategory() @@ -278,6 +278,13 @@ namespace Palettes return paint; } + void PaletteUI::SetActiveCategory(int categoryIndex) + { + CALL(GetAddress(PaletteUI, SetActiveCategory), void, + Args(PaletteUI*, int), + Args(this, categoryIndex)); + } + auto_METHOD_VOID(PaletteUI, Load, Args(PaletteMain* pPalette, UTFWin::IWindow* pWindow, bool arg_8, PaletteInfo* arg_C), Args(pPalette, pWindow, arg_8, arg_C)); diff --git a/Spore ModAPI/Spore/Palettes/IItemFrameUI.h b/Spore ModAPI/Spore/Palettes/IItemFrameUI.h index 64541022..c0e6e38c 100644 --- a/Spore ModAPI/Spore/Palettes/IItemFrameUI.h +++ b/Spore ModAPI/Spore/Palettes/IItemFrameUI.h @@ -51,6 +51,9 @@ namespace Palettes uint32_t mFrameTypeID; }; +#define IAdvancedItemUIPtr eastl::intrusive_ptr +#define DefaultItemFrameUIPtr eastl::intrusive_ptr + class IAdvancedItemUI : public IItemFrameUI, public UTFWin::IWinProc {}; class DefaultItemFrameUI diff --git a/Spore ModAPI/Spore/Palettes/PaletteCategory.h b/Spore ModAPI/Spore/Palettes/PaletteCategory.h index c9062c6e..29536706 100644 --- a/Spore ModAPI/Spore/Palettes/PaletteCategory.h +++ b/Spore ModAPI/Spore/Palettes/PaletteCategory.h @@ -64,7 +64,7 @@ namespace Palettes PalettePage* GetPageAt(size_t nIndex); /// - /// Tells whether the given subcategory is a children of this subcategory. + /// Tells whether the given subcategory is a children of this subcategory. /// @param pCategory bool HasCategory(PaletteCategory* pCategory); diff --git a/Spore ModAPI/Spore/Palettes/PalettePageUI.h b/Spore ModAPI/Spore/Palettes/PalettePageUI.h index 97bd624c..2dba08cc 100644 --- a/Spore ModAPI/Spore/Palettes/PalettePageUI.h +++ b/Spore ModAPI/Spore/Palettes/PalettePageUI.h @@ -85,7 +85,7 @@ namespace Palettes /* 18h */ float field_18; /* 1Ch */ float field_1C; /* 20h */ eastl::vector mStandardItems; - /* 34h */ eastl::vector> mAdvancedItems; + /* 34h */ eastl::vector mAdvancedItems; }; ASSERT_SIZE(PalettePageUI, 0x48); diff --git a/Spore ModAPI/Spore/Palettes/PaletteUI.h b/Spore ModAPI/Spore/Palettes/PaletteUI.h index 137c8a2d..d9dac9c1 100644 --- a/Spore ModAPI/Spore/Palettes/PaletteUI.h +++ b/Spore ModAPI/Spore/Palettes/PaletteUI.h @@ -91,11 +91,11 @@ namespace Palettes /// The layout of the palette, loaded using the ID in Palettes::PaletteMain::mLayoutID. /* 0Ch */ UILayoutPtr mpLayout; /// The window that contains the category selection buttons. - /* 10h */ UTFWin::IWindow* mpCategoryButtonsWindow; // 0x72DF4CEE - /* 14h */ UTFWin::IWindow* field_14; // 0xBA83C461 - /* 18h */ UTFWin::IWindow* field_18; // 0x90D4AADC - /* 1Ch */ UTFWin::IWindow* field_1C; // 0x05AEFF7F - /* 20h */ UTFWin::SporeAnimatedIconWin* mpAnimatedWindow; + /* 10h */ UTFWin::IWindow* mpCategoryButtonsWindow; // 0x72DF4CEE Buttons stored in reverse order + /* 14h */ UTFWin::IWindow* mpWindowLeft; // 0xBA83C461 + /* 18h */ UTFWin::IWindow* mpWindowRight; // 0x90D4AADC + /* 1Ch */ UTFWin::IWindow* mpWindowBehind; // 0x05AEFF7F + /* 20h */ UTFWin::SporeAnimatedIconWin* mpAnimatedWindow; // 0x49AFE6A1 highlight tab? /// The window that is used to display the category content (e.g. its pages) /* 24h */ UTFWin::IWindow* mpCategoryContent; // 0x93019DBC /// The main window of the UILayout, with ControlID 0xFFFFFFFF. @@ -105,7 +105,8 @@ namespace Palettes /* 30h */ PaletteInfoPtr mpPaletteInfo; /// The UI objects for all categories contained in the palette. They are in the same order as the PaletteMain::mCategories field. /* 34h */ eastl::vector mCategories; - /* 48h */ eastl::vector field_48; // intrusive_ptrs too, but it's never used? + /// The category SLOTS activated by and behind the category buttons. Must be cleared before reloading palette + /* 48h */ eastl::vector mCategorySlots; // intrusive_ptr to unknown class. /* 5Ch */ int field_5C; /* 60h */ int field_60; /* 64h */ PaletteCategoryUIPtr mpActiveCategory; From 6a28e66c9719a03570813dd01e6f99815267eaba Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 31 Jul 2025 17:53:36 -0700 Subject: [PATCH 100/113] minor fixes to thumbnail script --- .../ModCreatorKit/ThumbnailCaptureScript.cpp | 26 ++++++++++++------- .../ModCreatorKit/ThumbnailCaptureScript.h | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index 82084a59..3fe17d08 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -34,7 +34,7 @@ ThumbnailCaptureScript::ThumbnailCaptureScript() , mItemViewers() , mpItemViewer(nullptr) , mFolderPath() - , mIsEnabled(false) + , mbIsEnabled(false) { } @@ -206,9 +206,13 @@ void ThumbnailCaptureScript::InjectListeners() { // adventure editor /* else { - for (eastl::intrusive_ptr itemUI : pageUI.page->mAdvancedItems) { - itemUI->mpWindow - mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); + for (IAdvancedItemUIPtr itemUI : pageUI.page->mAdvancedItems) { + auto item = object_cast(itemUI.get()); + if (item && item->mpWindow) { + item->mpWindow->AddWinProc(this); + mItemViewers[item->mpWindow.get()] = itemUI->mpViewer.get(); + } + } }*/ @@ -218,9 +222,11 @@ void ThumbnailCaptureScript::InjectListeners() { // simple category else { for (auto pageUI : catUI->mPageUIs) { - for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { - itemUI->mpWindow->AddWinProc(this); - mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); + if (pageUI.page->mStandardItems.size() > 0) { + for (StandardItemUIPtr itemUI : pageUI.page->mStandardItems) { + itemUI->mpWindow->AddWinProc(this); + mItemViewers[itemUI->mpWindow.get()] = itemUI->mpViewer.get(); + } } } } @@ -279,10 +285,10 @@ void ThumbnailCaptureScript::RemoveListeners() { } void ThumbnailCaptureScript::ParseLine(const ArgScript::Line& line) { - if (mIsEnabled) { + if (mbIsEnabled) { RemoveListeners(); App::ConsolePrintF("Icon capture disabled."); - mIsEnabled = false; + mbIsEnabled = false; return; } @@ -327,7 +333,7 @@ void ThumbnailCaptureScript::ParseLine(const ArgScript::Line& line) { InjectListeners(); App::ConsolePrintF("Icon capture enabled: hover a palette item and wait until it starts rotating to generate the icon."); - mIsEnabled = true; + mbIsEnabled = true; } const char* ThumbnailCaptureScript::GetDescription(ArgScript::DescriptionMode mode) const { diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h index f68fcf84..d79e567c 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.h @@ -73,6 +73,6 @@ class ThumbnailCaptureScript ColorRGB mOldColor; ColorRGB mIdentityColor; string16 mFolderPath; - bool mIsEnabled; + bool mbIsEnabled; }; From d96f8cde96502d15a12a67ae1122cbe9a96acfbc Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 31 Jul 2025 18:18:43 -0700 Subject: [PATCH 101/113] clarify comments --- Spore ModAPI/Spore/Simulator/cCreatureCitizen.h | 2 +- Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h index 5feb2ff3..4b81083b 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h @@ -48,7 +48,7 @@ namespace Simulator /* FF0h */ int field_FF0; /* FF4h */ int mSelectionGroup; // -1 /* FF8h */ int field_FF8; // -1 - /* FFCh */ int mCurrentHandheldItem; // index of HandheldItem + /* FFCh */ int mCurrentHandheldItem; // HandheldItem index /* 1000h */ bool mAffectedByRecruiting; /* 1001h */ bool field_1001; // not initialized /* 1002h */ bool field_1002; // true diff --git a/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h b/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h index 767f2069..2126578a 100644 --- a/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h +++ b/Spore ModAPI/Spore/UTFWin/SporeTooltipWinProc.h @@ -79,8 +79,7 @@ namespace UTFWin /* 44h */ Math::Point mOffsetPosition; // (0, 30) /* 4Ch */ int field_4C; /* 50h */ uint32_t mLocaleID; - /// layout group ID, by default 0x40464100 / layouts~ - /* 54h */ uint32_t mLayoutGroupID; // 0x40464100 + /* 54h */ uint32_t mLayoutGroupID; // 0x40464100 (layouts~) /* 58h */ bool field_58; /// Sets the tooltip display behavior. /* 5Ch */ TooltipBehaviour mBehaviour; From f9cd6cc44b98a1d23b22a4ed87613cc6a0fc8789 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 6 Aug 2025 16:27:16 -0700 Subject: [PATCH 102/113] Update comments, fix compile error --- Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp | 6 +++--- Spore ModAPI/Spore/Editors/EditorModel.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp index fbe287c7..046b3da1 100644 --- a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp +++ b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp @@ -226,9 +226,9 @@ namespace Palettes PaletteUI::PaletteUI() : mpLayout(nullptr) , mpCategoryButtonsWindow() - , field_14() - , field_18() - , field_1C() + , mpWindowLeft() + , mpWindowRight() + , mpWindowBehind() , mpAnimatedWindow(nullptr) , mpCategoryContent() , mpPalette(nullptr) diff --git a/Spore ModAPI/Spore/Editors/EditorModel.h b/Spore ModAPI/Spore/Editors/EditorModel.h index cac79983..e1c3f3ff 100644 --- a/Spore ModAPI/Spore/Editors/EditorModel.h +++ b/Spore ModAPI/Spore/Editors/EditorModel.h @@ -89,9 +89,9 @@ namespace Editors /* 5Ch */ eastl::string16 mName; /* 6Ch */ eastl::string16 mDescription; // message 0x14418C3F ? /* 7Ch */ eastl::string16 mAcceptedName; // the name after removing illegal characters - /* 8Ch */ int mSkinEffectIDs[3]; + /* 8Ch */ int mSkinEffectIDs[3]; // Skinpaint IDs /* 98h */ int mSkinEffectSeeds[3]; // 1234 - /* A4h */ ColorRGB mColors[3]; + /* A4h */ ColorRGB mColors[3]; // Skinpaint Colors /* C8h */ eastl::vector field_C8; /* DCh */ int mZCorpScore; // not initialized }; From 7c271e8cfa31afe617a8dda2c41072ef6dc4a9d6 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Thu, 7 Aug 2025 11:20:13 -0700 Subject: [PATCH 103/113] change mSkinEffectIDs to uint32_t --- Spore ModAPI/Spore/Editors/EditorModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Editors/EditorModel.h b/Spore ModAPI/Spore/Editors/EditorModel.h index e1c3f3ff..fc6baf4e 100644 --- a/Spore ModAPI/Spore/Editors/EditorModel.h +++ b/Spore ModAPI/Spore/Editors/EditorModel.h @@ -89,7 +89,7 @@ namespace Editors /* 5Ch */ eastl::string16 mName; /* 6Ch */ eastl::string16 mDescription; // message 0x14418C3F ? /* 7Ch */ eastl::string16 mAcceptedName; // the name after removing illegal characters - /* 8Ch */ int mSkinEffectIDs[3]; // Skinpaint IDs + /* 8Ch */ uint32_t mSkinEffectIDs[3]; // Skinpaint IDs /* 98h */ int mSkinEffectSeeds[3]; // 1234 /* A4h */ ColorRGB mColors[3]; // Skinpaint Colors /* C8h */ eastl::vector field_C8; From 6a693bbef27551e4d0422f642b64f42a4b3b6bf8 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 14 Sep 2025 06:34:04 -0700 Subject: [PATCH 104/113] Document + rename numerous vars, add funcs, fix typos --- .../ModCreatorKit/ThumbnailCaptureScript.cpp | 4 +- .../SourceCode/Editors/EditorPalettes.cpp | 38 +++++----- .../SourceCode/Simulator/CommManager.cpp | 21 +++++- Spore ModAPI/Spore/Anim/AnimatedCreature.h | 11 ++- Spore ModAPI/Spore/Anim/IAnimWorld.h | 2 +- Spore ModAPI/Spore/CommonIDs.h | 2 + Spore ModAPI/Spore/Editors/Editor.h | 2 +- Spore ModAPI/Spore/Editors/EditorPlayMode.h | 2 +- Spore ModAPI/Spore/Editors/PlayModeActor.h | 6 +- .../Spore/Palettes/AdvancedItemViewer.h | 4 +- Spore ModAPI/Spore/Palettes/ItemViewer.h | 47 +++++++------ Spore ModAPI/Spore/Simulator/SimulatorEnums.h | 70 +++++++++++++++++++ .../Spore/Simulator/SubSystem/CommManager.h | 52 ++++++++++++-- .../SubSystem/cRelationshipManager.h | 12 +++- Spore ModAPI/Spore/Simulator/cCommEvent.h | 1 + Spore ModAPI/Spore/Simulator/cCommunity.h | 2 +- .../Spore/Simulator/cCreatureGameData.h | 2 +- Spore ModAPI/Spore/Simulator/cCultureSet.h | 1 + Spore ModAPI/Spore/Simulator/cGameDataUFO.h | 2 +- Spore ModAPI/Spore/Simulator/cTribe.h | 6 +- Spore ModAPI/Spore/UTFWin/Image.h | 10 +++ Spore ModAPI/Spore/UTFWin/UILayout.h | 2 +- 22 files changed, 231 insertions(+), 68 deletions(-) diff --git a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp index 3fe17d08..534ef4b3 100644 --- a/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp +++ b/Projects/Example Projects/ModCreatorKit/ThumbnailCaptureScript.cpp @@ -90,7 +90,7 @@ void ThumbnailCaptureScript::DrawLayer(int flags, int layerIndex, App::cViewer** mOldColorSet = true; } - mpItemViewer->field_16A = false; + mpItemViewer->mbRotationEnabled = false; auto viewer = mpItemViewer->mpLayeredObject->GetViewer(); viewer->SetBackgroundColor(ColorRGBA(0, 0, 0, 0)); @@ -114,7 +114,7 @@ void ThumbnailCaptureScript::DrawLayer(int flags, int layerIndex, App::cViewer** if (mpItemViewer->mZoom == mpItemViewer->mFinalZoom) { CaptureImage(); // We will only do it once, also restore the rotation - mpItemViewer->field_16A = true; + mpItemViewer->mbRotationEnabled = true; mpItemViewer = nullptr; model->mColor = ColorRGBA(mOldColor, 1.0f); diff --git a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp index 046b3da1..75779623 100644 --- a/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp +++ b/Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp @@ -531,17 +531,17 @@ namespace Palettes auto_METHOD_VOID(AdvancedItemViewer, SetAutoRotate, Args(bool arg), Args(arg)); auto_METHOD_VOID(AdvancedItemViewer, SetZoom, Args(float zoom), Args(zoom)); - void AdvancedItemViewer::func2Ch(bool value) { - field_166 = value; + void AdvancedItemViewer::SetShowModelOnHover(bool value) { + mbShowModelOnHover = value; } - bool AdvancedItemViewer::func30h() const { - return field_166; + bool AdvancedItemViewer::GetShowModelOnHover() const { + return mbShowModelOnHover; } UTFWin::IWindow* AdvancedItemViewer::GetWindow() const { return mpWindow.get(); } void AdvancedItemViewer::Set3dPreview(bool value) { - field_EA = value; + mb3DPreviewEnabled = value; } Anim::AnimatedCreature* AdvancedItemViewer::GetAnimatedCreature() const { return mpCreature.get(); @@ -607,32 +607,32 @@ namespace Palettes , field_34() , field_38() , field_3C() - , field_40() - , field_44() - , field_48() + , mInstanceID() + , mTypeID() + , mGroupID() , mFileName() , mpWindow() - , field_60() - , mZoom(1.0f) + , mpWindowUnk1() + , mInitialZoom(1.0f) , mRotation(0.0f) - , field_6C(0.0f) + , mInitialRotation(0.0f) + , mZoom(1.0f) , mFinalZoom(1.0f) - , field_94(1.0f) , field_98(Matrix3().SetIdentity()) , field_BC() , field_C0() , field_C4() , field_C8(-1) , field_CC(-1) - , field_D0(u"ui_material_blink") - , field_D4(u"ui_material_blink") + , mUIMaterialUnk1(u"ui_material_blink") + , mUIMaterialUnk2(u"ui_material_blink") , field_D8() , field_DC() , field_E0(-1) - , field_E4(u"ui_material_blink") + , mUIMaterialUnk3(u"ui_material_blink") , field_E8(true) , field_E9() - , field_EA(true) + , mb3DPreviewEnabled(true) , field_EB() , field_EC() , mpCreature() @@ -640,7 +640,7 @@ namespace Palettes , field_F8() , field_FC(true) , field_FD() - , field_100(0x71FA7D3F) + , mTriggerBehavior(TriggerBehaviors::Drag) , field_104() , mpModel() , field_11C() @@ -654,10 +654,10 @@ namespace Palettes , mbCreationIsBaked() , field_164() , field_165(true) - , field_166(true) + , mbShowModelOnHover(true) , field_167() , field_169() - , field_16A(true) + , mbRotationEnabled(true) , mShowTooltip(true) , mbOmitBackground() , field_170() diff --git a/Spore ModAPI/SourceCode/Simulator/CommManager.cpp b/Spore ModAPI/SourceCode/Simulator/CommManager.cpp index 38c6f8e7..40928b4c 100644 --- a/Spore ModAPI/SourceCode/Simulator/CommManager.cpp +++ b/Spore ModAPI/SourceCode/Simulator/CommManager.cpp @@ -11,7 +11,7 @@ namespace Simulator auto_METHOD(cCommManager, cCommEvent*, CreateSpaceCommEvent, Args(uint32_t source, PlanetID planetKey, uint32_t fileID, - uint32_t dialogID, void* pMission, int priority, unsigned int duration), + uint32_t dialogID, cMission* pMission, int priority, unsigned int duration), Args(source, planetKey, fileID, dialogID, pMission, priority, duration)); auto_METHOD_VOID(cCommManager, ShowCommEvent, Args(cCommEvent* pEvent), Args(pEvent)); @@ -19,12 +19,27 @@ namespace Simulator auto_METHOD_const_(cCommManager, bool, IsCommScreenActive); auto_METHOD_VOID(cCommManager, HandleCivCommAction, - Args(const CnvAction& action, void* pUnk, cCity* pSourceCity, cCity* pTargetCity), + Args(const CnvAction& action, cCivilization* pUnk, cCity* pSourceCity, cCity* pTargetCity), Args(action, pUnk, pSourceCity, pTargetCity)); auto_METHOD_VOID(cCommManager, HandleSpaceCommAction, - Args(const CnvAction& action, uint32_t source, PlanetID planetKey, void* pMission), + Args(const CnvAction& action, uint32_t source, PlanetID planetKey, cMission* pMission), Args(action, source, planetKey, pMission)); + + + UTFWin::IWindow* cCommManager::GetCommBackgroundWindow() { return GetCommWindow(kWindowBackground); } + + UTFWin::IWindow* cCommManager::GetCommWindow(uint32_t windowid) { + if (CommManager.IsCommScreenActive()) { + auto window = WindowManager.GetMainWindow()->FindWindowByID(0x01C3BB0C); + return window->FindWindowByID(uint32_t(windowid)); + } + return nullptr; + } + + UTFWin::IButton* cCommManager::GetCommButton(uint32_t buttonid) { + return object_cast(GetCommWindow(buttonid)); + } } #endif \ No newline at end of file diff --git a/Spore ModAPI/Spore/Anim/AnimatedCreature.h b/Spore ModAPI/Spore/Anim/AnimatedCreature.h index c3341a2a..36ff4aeb 100644 --- a/Spore ModAPI/Spore/Anim/AnimatedCreature.h +++ b/Spore ModAPI/Spore/Anim/AnimatedCreature.h @@ -107,11 +107,14 @@ namespace Anim /* 64h */ virtual int func64h() = 0; /* 68h */ virtual int func68h() = 0; /* 6Ch */ virtual int func6Ch() = 0; - /* 70h */ virtual Graphics::IModelWorld* GetAnimWorld() = 0; + /* 70h */ virtual Graphics::IModelWorld* zGetModelWorld() = 0; // Broken. /* 74h */ virtual int func74h() = 0; /* 78h */ virtual int func78h() = 0; // returns main anim_query? /* 7Ch */ virtual ~AnimatedCreature(); + IAnimWorld* GetAnimWorld() { return (mpAnimWorld); } + Graphics::IModelWorld* GetModelWorld() { return GetModel() ? GetModel()->GetModelWorld() : nullptr; } + static bool IsIdleWalkLookatStart(uint32_t animID); static bool IsIdleWalkStop(uint32_t animID); static bool IsIdleWalk(uint32_t animID); @@ -124,12 +127,14 @@ namespace Anim /* 04h */ Vector3 mPosition; /* 10h */ Quaternion mOrientation; - /* 20h */ char padding_20[0x154 - 0x20]; + /* 20h */ char padding_20[0x74 - 0x20]; // 3Ch scale? // 70h flags? - // 74h ColorRGBA that gets copied to model color + /* 74h */ ColorRGBA mColor; // gets copied to model color initially. At runtime, color should be applied directly to the mpModel. + + /* 84h */ char padding_84[0x154 - 0x84]; /* 154h */ int field_154; /* 158h */ int field_158; diff --git a/Spore ModAPI/Spore/Anim/IAnimWorld.h b/Spore ModAPI/Spore/Anim/IAnimWorld.h index 2db73f21..dc9d5a1e 100644 --- a/Spore ModAPI/Spore/Anim/IAnimWorld.h +++ b/Spore ModAPI/Spore/Anim/IAnimWorld.h @@ -35,7 +35,7 @@ namespace Anim /* 28h */ virtual void UpdateCreatures(float deltaTime, App::cViewer* = nullptr) = 0; /* 2Ch */ virtual void PostUpdateCreatures(float deltaTime, App::cViewer* = nullptr) = 0; // model is not visible by default - /* 30h */ virtual AnimatedCreature* LoadCreature(const ResourceKey& key, int = 2, const Vector3& = Vector3(), const Quaternion& = Quaternion(), bool = true) = 0; + /* 30h */ virtual AnimatedCreature* LoadCreature(const ResourceKey& key, int = 2, const Vector3& position = Vector3(), const Quaternion& orientation = Quaternion(), bool = true) = 0; /* 34h */ virtual int func34h(int, int, int, int, int) = 0; // Loads a *.blocks file /* 38h */ virtual int LoadCreatureByName(const char*, int, int, int, int, int) = 0; diff --git a/Spore ModAPI/Spore/CommonIDs.h b/Spore ModAPI/Spore/CommonIDs.h index 71eac4b9..e5606ce1 100644 --- a/Spore ModAPI/Spore/CommonIDs.h +++ b/Spore ModAPI/Spore/CommonIDs.h @@ -147,6 +147,8 @@ namespace TypeIDs flr = 0x438F6347, /// City Music Planner (Anthems) cmp = 0x04F684A4, + /// Conversation + cnv = 0x055ADA24, /// Binary Editor Model bem = 0x1A99B06B, /// Spore Materials diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index 26251dfa..e24ed370 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -556,7 +556,7 @@ namespace Editors /* 4ACh */ int mRenderingQuality; // 1 /* 4B0h */ bool field_4B0; // true /* 4B1h */ bool field_4B1; // true - /* 4B2h */ bool field_4B2; + /* 4B2h */ bool field_4B2; // Something to do with skinpaint? /* 4B3h */ bool field_4B3; // not initialized /* 4B4h */ bool field_4B4; // not initialized /* 4B5h */ bool field_4B5; diff --git a/Spore ModAPI/Spore/Editors/EditorPlayMode.h b/Spore ModAPI/Spore/Editors/EditorPlayMode.h index 2aec563c..9fa3018d 100644 --- a/Spore ModAPI/Spore/Editors/EditorPlayMode.h +++ b/Spore ModAPI/Spore/Editors/EditorPlayMode.h @@ -70,7 +70,7 @@ namespace Editors /* 0Ch */ PlayModeUIPtr mpUI; /* 10h */ char padding_10[0x7C - 0x10]; - /* 7Ch */ PlayModeActor** mpMainActor; // at 10h, AnimatedCreatureController + /* 7Ch */ PlayModeActor* mpMainActor; // at 10h, AnimatedCreatureController /* 80h */ char padding_80[0xC8 - 0x80]; /* C8h */ IPlayModeModule* mModules[4]; /* D8h */ char padding_D8[0x3588 - 0xD8]; diff --git a/Spore ModAPI/Spore/Editors/PlayModeActor.h b/Spore ModAPI/Spore/Editors/PlayModeActor.h index 777762b9..68b28b1c 100644 --- a/Spore ModAPI/Spore/Editors/PlayModeActor.h +++ b/Spore ModAPI/Spore/Editors/PlayModeActor.h @@ -16,11 +16,11 @@ namespace Editors /* 14h */ int field_14; // not initialized /* 18h */ int field_18; // not initialized /* 1Ch */ int field_1C; // not initialized - /* 20h */ float field_20; - /* 24h */ float field_24; + /* 20h */ float field_20; // set to 1.0 Does not affect speed? + /* 24h */ float field_24; // set to 0.5. Something to do with acceleration and look dir? Higher values make acceleration faster and head not turn down. /* 28h */ bool field_28; /* 29h */ bool field_29; - /* 2Ah */ bool field_2A; + /* 2Ah */ bool field_2A; // set to true /* 2Bh */ bool field_2B; }; diff --git a/Spore ModAPI/Spore/Palettes/AdvancedItemViewer.h b/Spore ModAPI/Spore/Palettes/AdvancedItemViewer.h index ab500f6e..2e8d1e1c 100644 --- a/Spore ModAPI/Spore/Palettes/AdvancedItemViewer.h +++ b/Spore ModAPI/Spore/Palettes/AdvancedItemViewer.h @@ -50,8 +50,8 @@ namespace Palettes /* 20h */ virtual void Update(int time) override; /* 24h */ virtual void Load(const ResourceKey& fileName) override; /* 28h */ virtual void SetName(const ResourceKey& fileName) override; - /* 2Ch */ virtual void func2Ch(bool) override; - /* 30h */ virtual bool func30h() const override; + /* 2Ch */ virtual void SetShowModelOnHover(bool enabled) override; + /* 30h */ virtual bool GetShowModelOnHover() const override; /* 34h */ virtual UTFWin::IWindow* GetWindow() const override; /* 38h */ virtual void Set3dPreview(bool enabled) override; /* 3Ch */ virtual Anim::AnimatedCreature* GetAnimatedCreature() const override; diff --git a/Spore ModAPI/Spore/Palettes/ItemViewer.h b/Spore ModAPI/Spore/Palettes/ItemViewer.h index 0faef850..591737f5 100644 --- a/Spore ModAPI/Spore/Palettes/ItemViewer.h +++ b/Spore ModAPI/Spore/Palettes/ItemViewer.h @@ -32,6 +32,13 @@ namespace Palettes { + enum class TriggerBehaviors : uint32_t + { + None = 0x2CA33BDB, + Drag = 0x71FA7D3, + Click = 0x5E71AB9B, + }; + class ItemViewer : public UTFWin::IWinProc , public DefaultRefCounted @@ -52,8 +59,8 @@ namespace Palettes /* 24h */ virtual void Load(const ResourceKey& fileName) = 0; /* 28h */ virtual void SetName(const ResourceKey& fileName) = 0; - /* 2Ch */ virtual void func2Ch(bool) = 0; - /* 30h */ virtual bool func30h() const = 0; + /* 2Ch */ virtual void SetShowModelOnHover(bool enabled) = 0; + /* 30h */ virtual bool GetShowModelOnHover() const = 0; /* 34h */ virtual UTFWin::IWindow* GetWindow() const = 0; /* 38h */ virtual void Set3dPreview(bool enabled) = 0; /* 3Ch */ virtual Anim::AnimatedCreature* GetAnimatedCreature() const = 0; //PLACEHOLDER GetAnimatedCreature() @@ -84,34 +91,34 @@ namespace Palettes /* 34h */ ObjectPtr field_34; /* 38h */ ObjectPtr field_38; /* 3Ch */ int field_3C; - /* 40h */ int field_40; - /* 44h */ int field_44; - /* 48h */ int field_48; - /* 4Ch */ ResourceKey mFileName; - /* 58h */ int field_58; // not initialized + /* 40h */ uint32_t mInstanceID; // Item instanceID + /* 44h */ uint32_t mTypeID; // Item typeID + /* 48h */ uint32_t mGroupID; // Item groupID + /* 4Ch */ ResourceKey mFileName; // Item Key + /* 58h */ uint32_t mTypeIDUnk1; // not initialized, usually set to 'prop' hash /* 5Ch */ IWindowPtr mpWindow; - /* 60h */ IWindowPtr field_60; - /* 64h */ float mZoom; // 1 + /* 60h */ IWindowPtr mpWindowUnk1; // Same as above? + /* 64h */ float mInitialZoom; // 1 /* 68h */ float mRotation; // 0 - /* 6Ch */ float field_6C; // 0 - /* 70h */ float mFinalZoom; // 1 + /* 6Ch */ float mInitialRotation; // 0 + /* 70h */ float mZoom; // 1 // Current zoom? /* 74h */ char _padding_74[0x20]; - /* 94h */ float field_94; // 1 - /* 98h */ Math::Matrix3 field_98; + /* 94h */ float mFinalZoom; // 1 // Desired zoom + /* 98h */ Math::Matrix3 field_98; // Something to do with model transforms /* BCh */ bool field_BC; /* C0h */ float field_C0; /* C4h */ float field_C4; /* C8h */ int field_C8; // -1 /* CCh */ int field_CC; // -1 - /* D0h */ const char16_t* field_D0; // "ui_material_blink" - /* D4h */ const char16_t* field_D4; // "ui_material_blink" + /* D0h */ const char16_t* mUIMaterialUnk1; // "ui_material_blink" + /* D4h */ const char16_t* mUIMaterialUnk2; // "ui_material_blink" /* D8h */ float field_D8; /* DCh */ float field_DC; /* E0h */ int field_E0; // -1 - /* E4h */ const char16_t* field_E4; // "ui_material_blink" + /* E4h */ const char16_t* mUIMaterialUnk3; // "ui_material_blink" /* E8h */ bool field_E8; // true /* E9h */ bool field_E9; - /* EAh */ bool field_EA; // true + /* EAh */ bool mb3DPreviewEnabled; // true // If set to false, model will not show when hovered /* EBh */ bool field_EB; /* ECh */ bool field_EC; /* F0h */ AnimatedCreaturePtr mpCreature; @@ -119,7 +126,7 @@ namespace Palettes /* F8h */ int field_F8; /* FCh */ bool field_FC; // true /* FDh */ bool field_FD; - /* 100h */ uint32_t field_100; // 0x71FA7D3F ('drag') + /* 100h */ TriggerBehaviors mTriggerBehavior; // TriggerBehaviors::Drag /* 104h */ eastl::vector field_104; /* 118h */ ModelPtr mpModel; /* 11Ch */ eastl::vector field_11C; @@ -134,11 +141,11 @@ namespace Palettes /* 163h */ bool mbCreationIsBaked; /* 164h */ bool field_164; /* 165h */ bool field_165; // true - /* 166h */ bool field_166; // true + /* 166h */ bool mbShowModelOnHover; // true /* 167h */ bool field_167; /* 168h */ bool field_168; // not initialized /* 169h */ bool field_169; - /* 16Ah */ bool field_16A; // true // mbRotationEnabled ? + /* 16Ah */ bool mbRotationEnabled; // true /* 16Bh */ bool mShowTooltip; // true /// If true, no background image will be set in the preview. /* 16Ch */ bool mbOmitBackground; diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index 8c5e978f..62c68991 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -391,6 +391,19 @@ namespace Simulator StealFood = 10 }; + /// NOTE: RelationshipEvents corresponds to configurations in 0x0568DE14 (space_npc_relationship_effects~) which abide by the below format: + /// All values x10. + /* + floats RelationshipEventName + [initial bonus] (value x10, one-time) + [add value] (value x10, adds this value each time, including initially) + [min value] (returns max(relation, this x10) ) + [max value] (returns min(relation, this x10) ) + [decay amount] (returns relation + [add value] x [this]) (over time decay scale of addition value. Negative values decay down, Positive up.) + [decay frequency] lower values = faster decay + end + */ + /// Properties of relationships between communities (tribes, civilizations, empires) enum RelationshipEvents { @@ -475,6 +488,63 @@ namespace Simulator kRelationshipEventTribeSocialPower = 0x54EAB4B3 }; + // Default Spore CNV actions + enum CnvActions { + kCnvCommExit = 0x01994745, // "exit" + kCnvCommcontinue = 0xCAFF0F72, // "continue" + kCnvCommEvent = 0x02D5DCEC, // runs a comm event from the key + + kCnvInsult = 0x26B14441, + kCnvCompliment = 0x70C14C34, + + kCnvAttackCity1 = 0x18646F3F, + kCnvAttackCity2 = 0x18646F3C, + kCnvAttackCity3 = 0x18646F3D, + kCnvAttackCity4 = 0x18646F3A, + kCnvAttackCity5 = 0x18646F3B, + kCnvAttackCity6 = 0x18646F38, + kCnvAttackCity7 = 0x18646F39, + kCnvAttackCity8 = 0x18646F36, + kCnvAttackCity9 = 0x18646F37, + kCnvAttackCity10 = 0xA51B201D, + + kCnvAcceptSurrender = 0x3EF09234, + + kCnvBuyCityFor3200 = 0x758330B8, + kCnvBuyCityFor2400 = 0x758330BB, + kCnvBuyCityFor1600 = 0x758330BA, + kCnvBuyCityFor8000 = 0x758330BD, + kCnvBuyCityFor4000 = 0x758330BC, + kCnvCancelBuy = 0xA3C1D501, + + kCnvCaptureCitybyMilitary = 0x6BA64250, + kCnvCityBuyAccepted = 0x8650BD5B, + kCnvCityBuyAcceptedHigh = 0x6668560E, + + kCnvLargeGift = 0xD648ED4D, // 4000 + kCnvMediumGift = 0x5EA6D3ED, // 2000 + kCnvSmallGift = 0x410C4A65, // 1000 + + kCnvTradeRouteAccept = 0xCADAC8A0, + kCnvTradeRouteDeny = 0x1125D6A9, + kCnvAllianceAccept = 0x24E1525D, + kCnvAllianceRequestMoney = 0x9F0FF4CB, + kCnvAllianceRefuse = 0x0764C336, + + kCnvEmbargoAccept = 0xD50A1A6D, + kCnvEmbargoRequestMoney = 0xE7977907, + kCnvEmbargoRefuse = 0x789418DC, + kCnvPlayerBidTooLow = 0x96508A98, + kCnvDemandAccept = 0x23A2D684, + kCnvDemandDeny = 0x764EA37C, + + kCnvUnk1 = 0x6BA64250, // Civ War/capture related + kCnvUnk2 = 0xBF3B803A, // Civ buy offer refused? + kCnvUnk3 = 0x015BC92B, // Civ NPC-to-player buy offer related + kCnvUnk4 = 0x7E41D64A, // Civ NPC-to-player buy offer related + kCnvUnk5 = 0x91386D6C, // Civ attack city counter? + }; + /// Possible genres of an adventure, used by Simulator::cScenarioModeData enum class ScenarioGenre : uint32_t { diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/CommManager.h b/Spore ModAPI/Spore/Simulator/SubSystem/CommManager.h index 3170f5c3..93d4e515 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/CommManager.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/CommManager.h @@ -3,11 +3,50 @@ #include #include #include +#include +#include +#include #define CommManager (*Simulator::cCommManager::Get()) namespace Simulator { + // Corresponds to window controlIDs in CommScreen-3.spui + enum CommWindowIDs { + // Panels containing windows + kWindowPanelViewport = 0x06429C80, + kWindowPanelLower = 0x05E4E5F0, + + // Windows inside panels + kWindowBackground = 0x05EDFF88, + //kCnvWindowViewport = 0x06243260, // Needs verification + kWindowTrading = 0x05E62A48, + kWindowText = 0x018072CB, + + }; + + // Corresponds to button controlIDs in CommScreen-3.spui + enum CommButtonIDs { + + // Space only Buttons + kBtnTrade = 0x057DF5CA, + kBtnRepair = 0x057DF5C8, + kBtnRecharge = 0x057DF5C9, + + kBtnMissions = 0x05E51D28, + kBtnDiplomacy = 0x05E51D30, + + kBtnMenu = 0x05DFF098, // Satellite icon + kBtnExit = 0x05E4F778, // Goodbye + + kBtnAccept = 0x05E4F788, // Red in spui + kBtnDecline = 0x05E4F770, + + kBtnTradeBuy = 0x04C1510A, + kBtnTradeSell = 0x04C1510C, + }; + + class cCommManager : public cStrategy { @@ -15,16 +54,21 @@ namespace Simulator cCommEvent* CreateCivCommEvent(cCivilization* pSourceCivilization, cCity* pTargetCity, PlanetID planetKey, uint32_t fileID, uint32_t dialogID, int priority = 0); - cCommEvent* CreateSpaceCommEvent(uint32_t sourceEmpire, PlanetID planetKey, uint32_t fileID, - uint32_t dialogID, void* pMission = nullptr, int priority = 0, unsigned int duration = 0); + cCommEvent* CreateSpaceCommEvent(uint32_t sourceEmpireID, PlanetID planetKey, uint32_t fileID, + uint32_t dialogID, cMission* pMission = nullptr, int priority = 0, unsigned int duration = 0); void ShowCommEvent(cCommEvent* pEvent); bool IsCommScreenActive() const; - void HandleCivCommAction(const CnvAction& action, void* pSourceCiv, cCity* pSourceCity, cCity* pTargetCity); + void HandleCivCommAction(const CnvAction& action, cCivilization* pSourceCiv, cCity* pSourceCity, cCity* pTargetCity); + + void HandleSpaceCommAction(const CnvAction& action, uint32_t sourceEmpireID, PlanetID planetKey, cMission* pMission); + - void HandleSpaceCommAction(const CnvAction& action, uint32_t source, PlanetID planetKey, void* pMission); + UTFWin::IWindow* GetCommBackgroundWindow(); + UTFWin::IWindow* GetCommWindow(uint32_t windowid); + UTFWin::IButton* GetCommButton(uint32_t buttonid); public: /* 20h */ cCommEventPtr mCurrentCommEvent; diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/cRelationshipManager.h b/Spore ModAPI/Spore/Simulator/SubSystem/cRelationshipManager.h index 90d2440c..c2286ef5 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/cRelationshipManager.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/cRelationshipManager.h @@ -52,7 +52,7 @@ namespace Simulator /* 00h */ float mValue; // Flag 0x1 is at war, 0x2 allied? /* 04h */ int mFlags; - /* 08h */ eastl::map mRelationshipEvents; + /* 08h */ eastl::map mRelationshipEvents; // map of RelationshipEvents to their values. }; /// Handles relationships between political entities. @@ -149,13 +149,21 @@ namespace Simulator /// @returns float GetRelationshipEventValue(uint32_t politicalID1, uint32_t politicalID2, uint32_t relationshipID); + /// Returns the cRelationshipData between 2 political entities. + /// NOTE: order of the IDs does not matter. + cRelationshipData* GetRelationshipData(uint32_t politicalID1, uint32_t politicalID2) { + eastl::pair key = eastl::make_pair(politicalID1, politicalID2); + auto it = mRelationships.find(key); + if (it != mRelationships.end()) { return &(it->second); } { return nullptr; } + } + public: /* 10h */ float field_10; /* 14h */ float field_14; /* 18h */ float field_18; /* 1Ch */ float field_1C; /* 20h */ bool mbIsInitialized; - /* 24h */ eastl::map, cRelationshipData> mRelationships; // map of maps? + /* 24h */ eastl::map, cRelationshipData> mRelationships; // map of maps? seems to tie pairs of political IDs to relationship data /* 40h */ int field_40; /* 44h */ int field_44; /* 48h */ eastl::vector field_48; diff --git a/Spore ModAPI/Spore/Simulator/cCommEvent.h b/Spore ModAPI/Spore/Simulator/cCommEvent.h index ac794cd0..08499e32 100644 --- a/Spore ModAPI/Spore/Simulator/cCommEvent.h +++ b/Spore ModAPI/Spore/Simulator/cCommEvent.h @@ -22,6 +22,7 @@ namespace Simulator /* 0Ch */ cCommEventType mEventType; // -1 /* 10h */ int field_10; /* 14h */ int field_14; + // These values don't seem to be empire political IDs /* 18h */ uint32_t mSource; // -1 /* 1Ch */ uint32_t mTarget; // -1 /* 20h */ cCityPtr mpSourceCity; diff --git a/Spore ModAPI/Spore/Simulator/cCommunity.h b/Spore ModAPI/Spore/Simulator/cCommunity.h index af0b52cf..b461797d 100644 --- a/Spore ModAPI/Spore/Simulator/cCommunity.h +++ b/Spore ModAPI/Spore/Simulator/cCommunity.h @@ -76,7 +76,7 @@ namespace Simulator /* 64h */ virtual Vector3& func64h(); /* 68h */ virtual void func68h(); /* 6Ch */ virtual cCityWalls* GetCityWalls(); // returns 0 - /* 70h */ virtual eastl::vector& GetPopulation(); + /* 70h */ virtual eastl::vector& GetPopulation(); /* 74h */ virtual int GetPopulationCount(); // returns the count of vector returned by GetPopulation() /* 78h */ virtual void func78h(); /* 7Ch */ virtual eastl::string16& GetCommunityName(); diff --git a/Spore ModAPI/Spore/Simulator/cCreatureGameData.h b/Spore ModAPI/Spore/Simulator/cCreatureGameData.h index 775a7dae..86f6f057 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureGameData.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureGameData.h @@ -62,7 +62,7 @@ namespace Simulator /* 11h */ bool field_11; /* 14h */ int field_14; /* 18h */ Math::Vector3 field_18; - /* 24h */ AbilityMode mAbilityMode; + /* 24h */ AbilityMode mAbilityMode; // Social / Attack stance /* 28h */ float mEvolutionPoints; /* 30h */ uint64_t DEPRECATED_mLearnedAbilities; /* 38h */ int mLearnedAbilities[3]; diff --git a/Spore ModAPI/Spore/Simulator/cCultureSet.h b/Spore ModAPI/Spore/Simulator/cCultureSet.h index c83ca83b..fffc625c 100644 --- a/Spore ModAPI/Spore/Simulator/cCultureSet.h +++ b/Spore ModAPI/Spore/Simulator/cCultureSet.h @@ -26,6 +26,7 @@ namespace Simulator { /// Contains the IDs of all the creation types of a specific "culture" or civilization/empire. This maps /// each member of the ModelTypes enum to a creation ID. + /// Note: Does not store creature data. class cCultureSet { public: diff --git a/Spore ModAPI/Spore/Simulator/cGameDataUFO.h b/Spore ModAPI/Spore/Simulator/cGameDataUFO.h index b7b38fbd..8d1df49a 100644 --- a/Spore ModAPI/Spore/Simulator/cGameDataUFO.h +++ b/Spore ModAPI/Spore/Simulator/cGameDataUFO.h @@ -81,7 +81,7 @@ namespace Simulator /* 6D0h */ cGonzagoTimer field_6D0; /* 6F0h */ cGonzagoTimer field_6F0; /* 710h */ int field_710; - /// 0 is player UFO + /// 0 is player UFO. See UfoType enum. /* 714h */ int mUFOType; // -1 /* 718h */ Vector3 mNextPosition; /* 724h */ Vector3 mNextVelocity; diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 831c257d..40f63207 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -69,10 +69,10 @@ namespace Simulator /// Generates the tribe food mat and tribe members /* 8Ch */ virtual void SpawnTribe(const Math::Vector3& position, int numMembers, int, bool); - /// Returns the vector with the members of the tribe + /// Returns the vector with the members of the tribe, including non-selectables /* 90h */ virtual eastl::vector& GetTribeMembers(); - /// Returns a vector of all selectable members of the tribe - /* 94h */ virtual eastl::vector& GetSelectableMembers(); + /// Returns a vector of all selectable members of the tribe (excludes baby creatures + /* 94h */ virtual eastl::vector& GetSelectableMembers(); /* 98h */ virtual cCreatureCitizen* SpawnMember(int age); /// Removes a member of the tribe. index seems to cause issues if not 0. /* 9Ch */ virtual void func9Ch(int index, bool); diff --git a/Spore ModAPI/Spore/UTFWin/Image.h b/Spore ModAPI/Spore/UTFWin/Image.h index 7e29e84c..9e89b7f0 100644 --- a/Spore ModAPI/Spore/UTFWin/Image.h +++ b/Spore ModAPI/Spore/UTFWin/Image.h @@ -57,6 +57,8 @@ namespace UTFWin const Math::Rectangle& GetTexCoords() const; const Math::Dimensions& GetDimensions() const; + void SetTexCoords(const Math::Rectangle& coords); + void SetDimensions(const Math::Dimensions& dimensions); /// /// Creates an UTFWin::Image instance with the image extracted from the file specified. @@ -127,5 +129,13 @@ namespace UTFWin { return mDimensions; } + inline void Image::SetTexCoords(const Math::Rectangle& coords) + { + mTexCoords = coords; + } + inline void Image::SetDimensions(const Math::Dimensions& dimensions) + { + mDimensions = dimensions; + } } diff --git a/Spore ModAPI/Spore/UTFWin/UILayout.h b/Spore ModAPI/Spore/UTFWin/UILayout.h index e4fbeb33..6a1414c9 100644 --- a/Spore ModAPI/Spore/UTFWin/UILayout.h +++ b/Spore ModAPI/Spore/UTFWin/UILayout.h @@ -61,7 +61,7 @@ namespace UTFWin /// (undocumented) .xml format. A new IWindow will be created and added to the main window; the main windows /// of the user interface loaded will be added as children of that new container window. /// This method will just process the resource name and call UILayout::Load(). - /// @param pResourceName The name of the layour file (no extension or group needed). + /// @param pResourceName The name of the layout file (no extension or group needed). /// @param groupID [Optional] The ID of the group where the file is stored, usually UILayout::kDefaultGroup. /// bool LoadByName(const char16_t* pLayoutName, uint32_t groupID = kDefaultGroup, bool = true, uint32_t = kDefaultParameter); From f54aeae0a440da8b2a7e6b3387d1ecfd93f962d5 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 14 Sep 2025 17:02:40 -0700 Subject: [PATCH 105/113] fix comment typos --- Spore ModAPI/Spore/Palettes/PaletteMain.h | 6 +++--- Spore ModAPI/Spore/Simulator/SimulatorMessages.h | 2 +- Spore ModAPI/Spore/Simulator/cCollectableItems.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI/Spore/Palettes/PaletteMain.h b/Spore ModAPI/Spore/Palettes/PaletteMain.h index 0f083eba..aa0407ab 100644 --- a/Spore ModAPI/Spore/Palettes/PaletteMain.h +++ b/Spore ModAPI/Spore/Palettes/PaletteMain.h @@ -52,11 +52,11 @@ namespace Palettes /// @param creationTypeID The ID that represents the type of creation of the editor, such as 'creature'. /// @param arg_8 Sets the field_34 value; it's a folder ID used for icons, but only on very specific occasions. /// @param layoutID The default instance ID of the layout file that the palette must use. If this is specified, the - /// 'palettePaletteLayoutID' property willbe ignored. + /// 'palettePaletteLayoutID' property will be ignored. /// @param categoryLayoutID An instance ID that points to the layout categories must use. If this is specified, the - /// 'paletteCategoryLayoutFile' property on each category will be ignored. + /// 'paletteCategoryLayoutFile' property on each category will be ignored. /// @param pageLayoutID An instance ID that points to the layout pages must use. If this is specified, the - /// 'palettePageLayoutFile' property on each page will be ignored. + /// 'palettePageLayoutFile' property on each page will be ignored. /// @param arg_18 A value that will be set in field_2C. /// @returns True if the .prop file existed and was read, false otherwise. /// diff --git a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h index a74b6430..95afd177 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorMessages.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorMessages.h @@ -32,7 +32,7 @@ namespace Simulator /// Simulator::EnterEditorMessage; Enters the correct editor modifying the specified creation. kMsgEnterEditor = 0x53850BAE, - /// Switches the editor. Use the desired editor ID as the message data . + /// Switches the editor. Use the desired editor ID as the message data. kMsgSwitchEditor = 0x0212D3E7, kMsgSwitchGameMode = 0x0212D3E7, diff --git a/Spore ModAPI/Spore/Simulator/cCollectableItems.h b/Spore ModAPI/Spore/Simulator/cCollectableItems.h index 1db646fc..a1764669 100644 --- a/Spore ModAPI/Spore/Simulator/cCollectableItems.h +++ b/Spore ModAPI/Spore/Simulator/cCollectableItems.h @@ -82,7 +82,7 @@ namespace Simulator void AddUnlockableItem(uint32_t instanceID, uint32_t groupID, int itemUnlockLevel, uint32_t categoryID, int row, int column, int pageIndex, float itemUnlockFindPercentage, uint32_t itemUnlockEffect); /// Reads the prop file, checks the `itemUnlockLevel`, `itemUnlockEffect` and `itemUnlockFindPercentage` properties, and calls AddUnlockableItem(). - /// If itemUnlockFindPercentage is greater or equal than 1, it unlocks the item. + /// If itemUnlockFindPercentage is greater than or equal to 1, it unlocks the item. /// @param key /// @param categoryID /// @param row From 50e74f514d7be9ecb5d54f2ea22829d85ae089b9 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 14 Sep 2025 17:03:16 -0700 Subject: [PATCH 106/113] add Game Mode checks, add note on strategy game modes --- .../Simulator/SubSystem/GameModeManager.h | 30 +++++++++++++++++++ .../Spore/Simulator/SubSystem/cStrategy.h | 1 + 2 files changed, 31 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h b/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h index 5e926024..1f46f039 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h @@ -122,6 +122,36 @@ namespace Simulator return GetGameModeID() == kLoadGameMode; } + /// Returns true if the game is currently in one of the ingame "X Stage" modes + inline bool IsStageGameMode() { + switch (GetGameModeID()) + { + case kGameCell: + case kGameCreature: + case kGameTribe: + case kGameCiv: + case kGameSpace: + return true; + default: + return false; + } + } + + /// Returns true if the game is currently in one of the Simulator modes + inline bool IsSimulatorGameMode() { + switch (GetGameModeID()) + { + case kGameCreature: + case kGameTribe: + case kGameCiv: + case kGameSpace: + case kScenarioMode: + return true; + default: + return false; + } + } + namespace Addresses(cGameModeManager) { DeclareAddress(Get); diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/cStrategy.h b/Spore ModAPI/Spore/Simulator/SubSystem/cStrategy.h index 367b043b..39c45dd7 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/cStrategy.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/cStrategy.h @@ -81,6 +81,7 @@ namespace Simulator public: /* 08h */ int mnRefCount; + // NOTE: These 2 mode values can sometimes appear swapped when changing modes. /* 0Ch */ uint32_t mLastGameMode; // -1 /* 10h */ uint32_t mCurrentGameMode; // -1 /* 14h */ uint32_t field_14; // -1 From fb6e56c17ca4db879b5c5054149a0e112bc85743 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 14 Sep 2025 17:59:25 -0700 Subject: [PATCH 107/113] Update EditorRequest.h --- Spore ModAPI/Spore/Editors/EditorRequest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Editors/EditorRequest.h b/Spore ModAPI/Spore/Editors/EditorRequest.h index ed95d23a..3a65ac56 100644 --- a/Spore ModAPI/Spore/Editors/EditorRequest.h +++ b/Spore ModAPI/Spore/Editors/EditorRequest.h @@ -73,7 +73,7 @@ namespace Editors void SetDefaultValidation(); - /// When this method is executed, the given request will be processed and + /// When this method is executed, the given request will be processed and open the editor. static bool Submit(EditorRequest* request); protected: @@ -115,7 +115,7 @@ namespace Editors /* 60h */ float field_60; /* 64h */ bool field_64; - /* 65h */ bool field_65; // show (unused) play button? + /* 65h */ bool field_65; // show (unused) play button /* 66h */ bool field_66; /* 68h */ int field_68; /* 6Ch */ bool field_6C; From 75394a8beee87aa3cb9feaff543698d2f0276023 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 21 Sep 2025 23:54:28 -0700 Subject: [PATCH 108/113] annotate vars, fix itemviewer zoom vars --- Spore ModAPI/Spore/Editors/Editor.h | 2 +- Spore ModAPI/Spore/Palettes/ItemViewer.h | 6 +++--- Spore ModAPI/Spore/Simulator/cCreatureDisplayStrategy.h | 4 ++-- Spore ModAPI/Spore/UTFWin/ITextEdit.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Spore ModAPI/Spore/Editors/Editor.h b/Spore ModAPI/Spore/Editors/Editor.h index e24ed370..136696c2 100644 --- a/Spore ModAPI/Spore/Editors/Editor.h +++ b/Spore ModAPI/Spore/Editors/Editor.h @@ -192,7 +192,7 @@ namespace Editors // Editor::ScalePart(EditorRigblock *, int, int) - bool sub_581F70(EditorRigblock* part, void* activeHandle, int value); + bool sub_581F70(EditorRigblock* part, void* activeHandle, int value); // MorphPart? // loc_573BB1 -> set part is hovered? diff --git a/Spore ModAPI/Spore/Palettes/ItemViewer.h b/Spore ModAPI/Spore/Palettes/ItemViewer.h index 591737f5..59aeb0c7 100644 --- a/Spore ModAPI/Spore/Palettes/ItemViewer.h +++ b/Spore ModAPI/Spore/Palettes/ItemViewer.h @@ -98,12 +98,12 @@ namespace Palettes /* 58h */ uint32_t mTypeIDUnk1; // not initialized, usually set to 'prop' hash /* 5Ch */ IWindowPtr mpWindow; /* 60h */ IWindowPtr mpWindowUnk1; // Same as above? - /* 64h */ float mInitialZoom; // 1 + /* 64h */ float mZoom; // 1 /* 68h */ float mRotation; // 0 /* 6Ch */ float mInitialRotation; // 0 - /* 70h */ float mZoom; // 1 // Current zoom? + /* 70h */ float mFinalZoom; // 1 // Desired zoom /* 74h */ char _padding_74[0x20]; - /* 94h */ float mFinalZoom; // 1 // Desired zoom + /* 94h */ float mInitialZoom; // 1 /* 98h */ Math::Matrix3 field_98; // Something to do with model transforms /* BCh */ bool field_BC; /* C0h */ float field_C0; diff --git a/Spore ModAPI/Spore/Simulator/cCreatureDisplayStrategy.h b/Spore ModAPI/Spore/Simulator/cCreatureDisplayStrategy.h index d4aced3a..a155024a 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureDisplayStrategy.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureDisplayStrategy.h @@ -45,9 +45,9 @@ namespace Simulator /* 17Ch */ float field_17C; /* 180h */ float field_180; /* 184h */ float field_184; // true - /// Effect 0x36099ACF + /// Effect 0x36099ACF, something related to low health? vignette effect /* 188h */ IVisualEffectPtr field_188; - /// Effect 0xAAA2AC3C + /// Effect 0xAAA2AC3C, something related to low health? red drops effect /* 18Ch */ IVisualEffectPtr field_18C; /* 190h */ char field_190[0x320 - 0x190]; }; diff --git a/Spore ModAPI/Spore/UTFWin/ITextEdit.h b/Spore ModAPI/Spore/UTFWin/ITextEdit.h index cf5a1595..e4c139dd 100644 --- a/Spore ModAPI/Spore/UTFWin/ITextEdit.h +++ b/Spore ModAPI/Spore/UTFWin/ITextEdit.h @@ -91,14 +91,14 @@ namespace UTFWin /// Gets the component color for the given text type. /// @param index The type of text affected by the color, in the TextColors enum. /// - /* 1Ch */ virtual Color GetColor(TextColors index) const = 0; + /* 1Ch */ virtual Math::Color GetColor(TextColors index) const = 0; /// /// Specifies the component colors for the given text mode. /// @param index The type of text affected by this color, in the TextColors enum. /// @param color The new Color. /// - /* 20h */ virtual void SetColor(TextColors index, Color color) = 0; + /* 20h */ virtual void SetColor(TextColors index, Math::Color color) = 0; /* 24h */ virtual const Math::Rectangle& GetBorderWidth() const = 0; /* 28h */ virtual void SetBorderWidth(const Math::Rectangle& widths) = 0; From 81667c198fc5ccd637f38ef29fb54c346ce9f8a1 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 21 Sep 2025 23:54:47 -0700 Subject: [PATCH 109/113] add IsEditorMode() --- Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h b/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h index 1f46f039..d4312294 100644 --- a/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h +++ b/Spore ModAPI/Spore/Simulator/SubSystem/GameModeManager.h @@ -122,6 +122,11 @@ namespace Simulator return GetGameModeID() == kLoadGameMode; } + /// Returns true if the game is currently in the editor + inline bool IsEditorMode() { + return GetGameModeID() == kEditorMode; + } + /// Returns true if the game is currently in one of the ingame "X Stage" modes inline bool IsStageGameMode() { switch (GetGameModeID()) From 397a92c222be6f8c86c085e47a4dc4ae2dec9d44 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Sun, 21 Sep 2025 23:55:50 -0700 Subject: [PATCH 110/113] add UnlockPart, LockPart, etc, rename + annotate vars --- .../SourceCode/DLL/AddressesSimulator.cpp | 6 + .../SourceCode/Simulator/SimulatorMisc.cpp | 18 +++ .../Spore/App/cCreatureModeStrategy.h | 119 +++++++++++++++++- .../Spore/Simulator/cCollectableItems.h | 68 +++++++--- 4 files changed, 194 insertions(+), 17 deletions(-) diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index 821a8e8d..4c907da4 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -1128,9 +1128,15 @@ namespace Simulator namespace Addresses(cCollectableItems) { + DefineAddress(sub_5976E0, SelectAddress(0x5976E0, 0x597A20)); DefineAddress(LoadConfig, SelectAddress(0x599100, 0x599440)); DefineAddress(AddUnlockableItem, SelectAddress(0x598A70, 0x598DB0)); DefineAddress(AddUnlockableItemFromProp, SelectAddress(0x598B50, 0x598E90)); + + DefineAddress(UnlockPart, SelectAddress(0x596A60, 0x596DA0)); + DefineAddress(LockPart, SelectAddress(0x596AD0, 0x596E10)); + DefineAddress(sub_594010, SelectAddress(0x594010, 0x5942E0)); + DefineAddress(sub_597BC0, SelectAddress(0x597BC0, 0x597F00)); DefineAddress(sub_597390, SelectAddress(0x597390, 0x5976D0)); } diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp index a21bb8af..fe41fcc9 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp @@ -155,6 +155,24 @@ namespace Simulator Args(struct ResourceKey key, uint32_t categoryID, int row, int column, int pageIndex), Args(key, categoryID, row, column, pageIndex)); + + auto_METHOD_VOID_(cCollectableItems, sub_5976E0); + + auto_METHOD_VOID(cCollectableItems, UnlockPart, + Args(uint32_t instanceID, uint32_t groupID, int unk), + Args(instanceID, groupID, unk)); + + auto_METHOD_VOID(cCollectableItems, LockPart, + Args(uint32_t instanceID, uint32_t groupID), + Args(instanceID, groupID)); + + auto_METHOD_VOID_(cCollectableItems, sub_594010); + + auto_METHOD_VOID(cCollectableItems, sub_597BC0, + Args(UnkCategoryHashMap& dst, int unk, const ResourceKey& speciesKey), + Args(dst, unk, speciesKey)); + + auto_METHOD_VOID(cCollectableItems, sub_597390, Args(eastl::vector& dst, struct cCollectableItemID itemID, int unk), Args(dst, itemID, unk)); diff --git a/Spore ModAPI/Spore/App/cCreatureModeStrategy.h b/Spore ModAPI/Spore/App/cCreatureModeStrategy.h index 8d5e6b1e..8d91d4ac 100644 --- a/Spore ModAPI/Spore/App/cCreatureModeStrategy.h +++ b/Spore ModAPI/Spore/App/cCreatureModeStrategy.h @@ -7,6 +7,7 @@ #include #include #include +#include #define cCreatureModeStrategyPtr eastl::intrusive_ptr #define ICreatureModeActionHandlerPtr eastl::intrusive_ptr @@ -82,21 +83,133 @@ namespace App #endif namespace CreatureModeStrategies { + using namespace Simulator; struct Interact { static const uint32_t ID = 0xD3353638; - Simulator::cCreatureBase* creature; - Simulator::cGameData* interactableObject; + cCreatureBase* creature; + cInteractableObject* interactableObject; int count; // ? + void* unk1; // unknown class }; + + struct EatFruit { + static const uint32_t ID = 0xD335362B; + cCreatureBase* creature; + cInteractableObject* food; + int field_8; // 0 + int field_16; // 0 + void* unk1; // unknown class? + }; + + struct EatMeat { + static const uint32_t ID = 0xD335362D; + + cCreatureBase* creature; + cInteractableObject* food; + int field_8; // 0 + void* unk1; // unknown class? + }; + struct UnlockPart { static const uint32_t ID = 0x5371F11; - Simulator::cCreatureBase* creature; + cCreatureBase* creature; int field_4; int unlockLevel; }; + + struct Mate { + static const uint32_t ID = 0xD335362C; + + cCreatureBase* creature; + cCreatureBase* targetcreature; + int field_8; // 0 + void* unk1; // unknown class? + }; + + struct LayEgg { + static const uint32_t ID = 0xD335362C; + + cCreatureBase* creature; + cCreatureBase* targetcreature; + int field_8; // 0 + void* unk1; // unknown class? + }; + + struct Pickup { + static const uint32_t ID = 0xD335362C; + + cCreatureBase* creature; + cInteractableObject* item; + int field_8; // 0 + void* unk1; // unknown class? + }; + + /// Unknowns /// + + + struct UnkActionCombat1 { // something to do with combat? + static const uint32_t ID = 0xD3353637; + + uint32_t field_4; // 0 + int field_8; // usually 1 + uint32_t field_12; // 0 + uint32_t field_16; // large value + uint32_t field_20; + }; + + struct UnkActionRelation1 { // Called when socializing or killing successfully? + static const uint32_t ID = 0x45AB96E; + + cCreatureBase* creature; + int field_4; + // struct, class, or pointer? Not cGameData + uint32_t field_8; + int field_12; // usually 1 + uint32_t field_16; + uint32_t field_20; + }; + + struct UnkActionSocial1 { // Called when socializing successfully, after UnkActionRelation1 + static const uint32_t ID = 0x60B4123; + + cCreatureBase* creature; + cCreatureBase* targetcreature; + uint32_t field_8; + uint32_t field_12; + uint32_t field_16; + uint32_t field_20; + uint32_t field_24; + uint32_t field_28; + }; + + struct UnkActionKill1 { // Called when killing successfully, after UnkActionRelation1 + static const uint32_t ID = 0xD335362C; + + cCreatureBase* creature; + cCreatureBase* targetcreature; + uint32_t field_8; + uint32_t field_12; + uint32_t field_16; + uint32_t field_20; + uint32_t field_24; + uint32_t field_28; + }; + + struct UnkActionKill2 { // Called when killing successfully, after UnkActionKill1 + static const uint32_t ID = 0xD3353637; + + cCreatureBase* creature; + cCreatureBase* targetcreature; + uint32_t field_12; // large value + uint32_t field_16; // large value + uint32_t field_20; + uint32_t field_24; + uint32_t field_28; + }; + } } diff --git a/Spore ModAPI/Spore/Simulator/cCollectableItems.h b/Spore ModAPI/Spore/Simulator/cCollectableItems.h index a1764669..da0e0423 100644 --- a/Spore ModAPI/Spore/Simulator/cCollectableItems.h +++ b/Spore ModAPI/Spore/Simulator/cCollectableItems.h @@ -19,6 +19,7 @@ namespace Simulator { Unlocked = 1, + // Highlighted = 2 ??? // NotUnlockable = 4 ??? }; @@ -26,6 +27,11 @@ namespace Simulator uint32_t instanceID; uint32_t groupID; }; + struct alignas(8) cCollectableRowID { + uint16_t rowIndex; + uint16_t pageIndex; + uint32_t categoryID; + }; constexpr cCollectableItemID COLLECTABLE_ITEM_NULL_ID = { -1, -1 }; } @@ -38,6 +44,11 @@ namespace eastl { size_t operator()(const Simulator::cCollectableItemID& val) const { return static_cast(val.instanceID); } }; + /// A necessary structure to be able to use cCollectableRowID on containers such as hash_map. + template <> struct hash + { + size_t operator()(const Simulator::cCollectableRowID& val) const { return static_cast(val.pageIndex & 0xFFFF + val.rowIndex); } + }; } #endif @@ -54,17 +65,28 @@ namespace Simulator inline cCollectableItemsRowID GetCollectableItemsRowID(uint32_t categoryID, int pageIndex, int row) { return ((uint64_t)categoryID) << 32 | (pageIndex << 16) | row; } - + + /// One of these structs per unlockable page struct UnkHashtableItem { - int field_0; - int field_4; + //int field_0; // generally stays the same as parts are unlocked, but not always + //int field_4; // decreases as parts are unlocked + + uint16_t field_0; // some type of storage size. usually 1 value below some power of 2. generally stays the same as parts are unlocked, but not always + uint16_t field_2; + uint16_t field_4; // decreases to 0 as parts are unlocked + uint16_t field_6; // usually 0? }; ASSERT_SIZE(UnkHashtableItem, 8); - typedef eastl::sp_fixed_hash_map UnkHastable; - ASSERT_SIZE(UnkHastable, 0xDC); - typedef eastl::sp_fixed_hash_map UnkHashMap; - ASSERT_SIZE(UnkHashMap, 0x888); + /// Map {value, pageindex} to the UnkHashtableItem + /// Before all parts are unlocked, 'value' = 0x3e09800e + /// After all parts are unlocked, 'value' = 0x5c225570 + typedef eastl::sp_fixed_hash_map UnkPageHashtable; + ASSERT_SIZE(UnkPageHashtable, 0xDC); + + /// maps categoryID to UnkPageHashtable for each unlockable category + typedef eastl::sp_fixed_hash_map UnkCategoryHashMap; + ASSERT_SIZE(UnkCategoryHashMap, 0x888); class cCollectableItems : public ISimulatorSerializable @@ -77,6 +99,7 @@ namespace Simulator using Object::Release; using Object::Cast; + void sub_5976E0(); void LoadConfig(uint32_t configGroupID, uint32_t configInstanceID, uint32_t itemsGroupID); void AddUnlockableItem(uint32_t instanceID, uint32_t groupID, int itemUnlockLevel, uint32_t categoryID, int row, int column, int pageIndex, float itemUnlockFindPercentage, uint32_t itemUnlockEffect); @@ -90,9 +113,19 @@ namespace Simulator /// @param pageIndex bool AddUnlockableItemFromProp(struct ResourceKey key, uint32_t categoryID, int row, int column, int pageIndex); + // UnlockPart and LockPart do not update the part visiblity when called in the editor. + void UnlockPart(uint32_t instanceID, uint32_t groupID, int = 0); + void LockPart(uint32_t instanceID, uint32_t groupID); + + // Called after UnlockPart and LockPart, then UnlockPart is called again after this to add the highlighted "new" parts + void sub_594010(); + // called at the start of creature stage with an int of "1" and a nullptr speciesKey - void sub_597BC0(UnkHashMap& dst, int, const ResourceKey& speciesKey); + // populates the category hash map? + void sub_597BC0(UnkCategoryHashMap& dst, int, const ResourceKey& speciesKey); + // called when cCreatureModeStrategy::ExecuteAction calls with an 'UnlockPart' action + // currently cannot be detoured without crashing? void sub_597390(eastl::vector& dst, struct cCollectableItemID itemID, int); public: @@ -109,12 +142,12 @@ namespace Simulator ASSERT_SIZE(UnlockableItem, 0x1C); #ifndef SDK_TO_GHIDRA - /* 0Ch */ bool field_C; // true + /* 0Ch */ bool field_C; // true (set to false after LoadConfig and before UnlockPart/LockPart) /// Stores a progression of unlockable items (for instance, all the mouths in the same row) /* 10h */ eastl::sp_fixed_map mUnlockableRows; /// Maps the group/instance of a rigblock to its UnlockableItem data /* 148Ch */ eastl::sp_fixed_hash_map mUnlockableItems; - /// Some flags + /// Some flags. mItemStatusInfos->reset_lose_memory() makes all items hidden in the editor. /* 4D00h */ eastl::sp_fixed_hash_map mItemStatusInfos; /* 6D5Ch */ eastl::vector mUnlocksPerLevel; /* 6D70h */ int mUnlockPoints; @@ -122,7 +155,7 @@ namespace Simulator /* 6D78h */ float mFindPercentageLevelMultiplier; // 1.0 /* 6D7Ch */ float mGlobalFindPercentageMultiplier; // 1.0 /* 6D80h */ eastl::list mUnlockedItems; - /* 6D8Ch */ eastl::hash_map field_6D8C; + /* 6D8Ch */ eastl::hash_map field_6D8C; // empty? #else // SDKtoGHIDRA does not support sp_fixed_ structures with alignment 8 /* 0Ch */ bool field_C; // true @@ -148,6 +181,11 @@ namespace Simulator DeclareAddress(AddUnlockableItem); // 0x598A70 0x598DB0 DeclareAddress(AddUnlockableItemFromProp); // 0x598B50 0x598E90 + DeclareAddress(sub_5976E0); // 0x5976E0 0x597A20 + DeclareAddress(UnlockPart); // 0x596A60 0x596DA0 + DeclareAddress(LockPart); // 0x596AD0 0x596E10 + DeclareAddress(sub_594010); // 0x594010 0x5942E0 + DeclareAddress(sub_597BC0); // 0x597BC0 0x597F00 DeclareAddress(sub_597390); // 0x597390 0x5976D0 } @@ -156,6 +194,7 @@ namespace Simulator class CreatureGamePartUnlocking { public: + // Given an (unknown) hashmap (the creature parts one always is size 56), // return a valid new part ID to unlock, or call this func again until it returns a valid part. // @@ -163,10 +202,11 @@ namespace Simulator // unk1 has something to do with how many times the function is called unsuccessfully; if it reaches 2 twice, unlockLevel is set to -1. // unlockLevel will be either a .prop unlockLevel value or -1 // - // the cCollectableItemID return value is formatted as such: + // The cCollectableRowID return value is formatted as such: // groupID: category name (eg: ce_category_mouths) - // instanceID: part placement in category by page index and part row (eg: a part on page 4 and row 5 would have a hex of 0x30004) - struct cCollectableItemID sub_D3B460(UnkHashMap& unk0, bool firstCall, int unk1, int unlockLevel); + // instanceID: part placement in category by page index and part row index (eg: a part on page 4 and row 5 would have a hex of 0x30004) + // (column is unspecified because it returns the next unlocked part in the row) + struct cCollectableRowID sub_D3B460(UnkCategoryHashMap& unk0, bool firstCall, int unk1, int unlockLevel); }; namespace Addresses(CreatureGamePartUnlocking) From fef58f7faf419d448b51ca88cafe130f727ba0c7 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 22 Sep 2025 00:42:12 -0700 Subject: [PATCH 111/113] add AnimatedCreature::PlayAnimation Address --- Spore ModAPI/SourceCode/DLL/AddressesAnim.cpp | 5 +++++ Spore ModAPI/Spore/Anim/AnimatedCreature.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Spore ModAPI/SourceCode/DLL/AddressesAnim.cpp b/Spore ModAPI/SourceCode/DLL/AddressesAnim.cpp index 5e213d55..f74c300a 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesAnim.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesAnim.cpp @@ -4,6 +4,11 @@ namespace Anim { + namespace Addresses(AnimatedCreature) + { + DefineAddress(PlayAnimation, SelectAddress(0xA0C5D0, 0xA0C5D0)); + } + namespace Addresses(IAnimManager) { DefineAddress(Get, SelectAddress(0x67CC70, 0x67CAE0)); diff --git a/Spore ModAPI/Spore/Anim/AnimatedCreature.h b/Spore ModAPI/Spore/Anim/AnimatedCreature.h index 36ff4aeb..e628caac 100644 --- a/Spore ModAPI/Spore/Anim/AnimatedCreature.h +++ b/Spore ModAPI/Spore/Anim/AnimatedCreature.h @@ -154,6 +154,11 @@ namespace Anim }; ASSERT_SIZE(AnimatedCreature, 0x19C); + namespace Addresses(AnimatedCreature) + { + DeclareAddress(PlayAnimation); // 0xA0C5D0 0xA0C5D0 + } + struct anim_query { struct AnimReference { From c37b20acb9dccb5f2521a3398a4dc31a840ecf52 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 24 Dec 2025 01:01:49 -0800 Subject: [PATCH 112/113] set TakeDamage int to damagetype --- Spore ModAPI/Spore/Simulator/cCombatant.h | 3 ++- Spore ModAPI/Spore/Simulator/cCreatureBase.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Spore ModAPI/Spore/Simulator/cCombatant.h b/Spore ModAPI/Spore/Simulator/cCombatant.h index 91957d67..e9a487f5 100644 --- a/Spore ModAPI/Spore/Simulator/cCombatant.h +++ b/Spore ModAPI/Spore/Simulator/cCombatant.h @@ -79,7 +79,8 @@ namespace Simulator /* 14h */ virtual cSpaceToolData* GetWeapon(); /// Called when the combatant is attacked, takes the damage - /* 18h */ virtual int TakeDamage(float damage, uint32_t attackerPoliticalID, int, const Vector3&, cCombatant* pAttacker); // used to substract health + /// Vector3 may be knockback direction? + /* 18h */ virtual int TakeDamage(float damage, uint32_t attackerPoliticalID, int damagetype, const Vector3&, cCombatant* pAttacker); // used to substract health /* 1Ch */ virtual void AddHostileUnit(cCombatant* combatant); /* 20h */ virtual Math::Vector3 func20h(); diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index 751b7418..512cdd67 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -115,7 +115,7 @@ namespace Simulator // sub_C1BE40 WALK TO?? // arg_8 is normalized vector - void WalkTo(int speedState, const Vector3& dstPos, const Vector3& arg_8, float goalStopDistance=1.0f, float acceptableStopDistance=2.0f); + void WalkTo(int speedState, const Vector3& dstPos, const Vector3& arg_8, float goalStopDistance = 1.0f, float acceptableStopDistance = 2.0f); //TODO loc_D315AE know how much distance advances with WASD From 6c12298d50c5897901b8b9b030960e922a6ebc52 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Wed, 24 Dec 2025 01:07:59 -0800 Subject: [PATCH 113/113] fix typo --- Spore ModAPI/Spore/Simulator/cTribe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spore ModAPI/Spore/Simulator/cTribe.h b/Spore ModAPI/Spore/Simulator/cTribe.h index 40f63207..6c372749 100644 --- a/Spore ModAPI/Spore/Simulator/cTribe.h +++ b/Spore ModAPI/Spore/Simulator/cTribe.h @@ -71,7 +71,7 @@ namespace Simulator /* 8Ch */ virtual void SpawnTribe(const Math::Vector3& position, int numMembers, int, bool); /// Returns the vector with the members of the tribe, including non-selectables /* 90h */ virtual eastl::vector& GetTribeMembers(); - /// Returns a vector of all selectable members of the tribe (excludes baby creatures + /// Returns a vector of all selectable members of the tribe (excludes baby creatures) /* 94h */ virtual eastl::vector& GetSelectableMembers(); /* 98h */ virtual cCreatureCitizen* SpawnMember(int age); /// Removes a member of the tribe. index seems to cause issues if not 0.