From 908feb98dec02d381abf5538914c97cf02d02d26 Mon Sep 17 00:00:00 2001 From: Allison Ghost Date: Mon, 8 Jan 2024 19:16:04 -0800 Subject: [PATCH 01/49] 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 02/49] 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 03/49] 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 04/49] 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 05/49] 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 06/49] 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 07/49] 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 08/49] 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 09/49] 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 10/49] 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 11/49] 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 12/49] 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 13/49] 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 14/49] 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 15/49] 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 16/49] 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 17/49] 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 18/49] 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 19/49] 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 20/49] 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 21/49] 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 22/49] 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 23/49] 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 24/49] 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 25/49] 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 26/49] 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 27/49] 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 28/49] 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 29/49] 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 30/49] 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 31/49] 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 32/49] 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 33/49] 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 34/49] 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 35/49] 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 36/49] 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 37/49] 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 38/49] 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 39/49] 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 40/49] 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 41/49] 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 42/49] 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 43/49] 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 44/49] 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 45/49] 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 46/49] 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 47/49] 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 48/49] 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 49/49] 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;