Skip to content

Commit ae4602c

Browse files
committed
Added cGameBundle, added methods to cTribe, added SpawnNpcTribe()
1 parent 02f7a36 commit ae4602c

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#include <Spore\Simulator\cSpaceDefenseMissile.h>
8383
#include <Spore\Simulator\cDefaultToolProjectile.h>
8484
#include <Spore\Simulator\cPlanetaryArtifact.h>
85+
#include <Spore\Simulator\cTribe.h>
8586
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
8687
#include <Spore\Simulator\SubSystem\GameBehaviorManager.h>
8788
#include <Spore\Simulator\SubSystem\GameInputManager.h>
@@ -137,6 +138,8 @@ namespace Addresses(Simulator)
137138
DefineAddress(sCreatureGameUnlockCategoriesCount, SelectAddress(0x1587278, 0x1583298));
138139

139140
DefineAddress(CreateUFO, SelectAddress(0x102BB50, 0x102AC60));
141+
142+
DefineAddress(SpawnNpcTribe, SelectAddress(0xC92860, 0xC932F0));
140143

141144
#ifndef SDK_TO_GHIDRA
142145
DefineAddress(LightingWorld_ptr, SelectAddress(0x1682CD4, 0x167EA54));
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#ifndef MODAPI_DLL_EXPORT
22
#include <Spore\Simulator\cTribeArchetype.h>
3+
#include <Spore\Simulator\cTribe.h>
34

45
namespace Simulator
56
{
67
auto_STATIC_METHOD(cTribeArchetype, cTribeArchetype*, GetTribeArchetype,
78
Args(uint32_t archetype), Args(archetype));
9+
10+
11+
auto_STATIC_METHOD(Simulator, cTribe*, SpawnNpcTribe,
12+
Args(const Math::Vector3& position, int tribeArchetype, int numMembers, int arg0, bool arg1, cSpeciesProfile* species),
13+
Args(position, tribeArchetype, numMembers, arg0, arg1, species));
814
}
915
#endif

Spore ModAPI/Spore/Simulator/cGameBundleContainer.h

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
#pragma once
2020

2121
#include <Spore\Simulator\cGameData.h>
22+
#include <Spore\Simulator\cSpatialObject.h>
23+
#include <Spore\Simulator\cBehaviorList.h>
2224
#include <EASTL\vector.h>
2325

26+
#define cGameBundleContainerPtr eastl::intrusive_ptr<Simulator::cGameBundleContainer>
27+
#define cGameBundlePtr eastl::intrusive_ptr<Simulator::cGameBundle>
28+
2429
namespace Simulator
2530
{
2631
#ifdef SDK_TO_GHIDRA
@@ -32,14 +37,38 @@ namespace Simulator
3237
class cGameBundle; //TODO
3338
#endif
3439

40+
class cGameBundleContainer;
41+
42+
class cGameBundle
43+
/* 00h */ : public cGameData
44+
/* 34h */ , public cSpatialObject
45+
/* 108h */ , public cBehaviorList
46+
{
47+
public:
48+
static const uint32_t TYPE = 0x4FFCDEDA;
49+
static const uint32_t NOUN_ID = 0x18C431C;
50+
51+
public:
52+
/* 120h */ int field_120;
53+
/* 124h */ bool mLoose;
54+
/* 128h */ cGameBundleContainerPtr mpContainer;
55+
/* 12Ch */ int mType;
56+
/* 130h */ int mDisplayType;
57+
/* 134h */ int mAmountInBundle; // not initialized
58+
/* 138h */ bool field_138;
59+
};
60+
ASSERT_SIZE(cGameBundle, 0x13C);
61+
3562
class cGameBundleContainer
3663
{
3764
public:
65+
static const uint32_t TYPE = 0x135B1E8;
66+
3867
//PLACEHOLDER
3968
virtual ~cGameBundleContainer();
4069

4170
public:
42-
/* 04h */ eastl::vector<cGameBundle> mBundleList;
71+
/* 04h */ eastl::vector<cGameBundlePtr> mBundleList;
4372
/* 18h */ cGameDataPtr mpOwner;
4473
/* 1Ch */ int mContainerCapacity;
4574
/* 20h */ int mBundleCapacity;

Spore ModAPI/Spore/Simulator/cTribe.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ namespace Simulator
4040
using Object::Release;
4141
using Object::Cast;
4242

43+
/// Generates the tribe food mat and tribe members
44+
/* 8Ch */ virtual void SpawnTribe(const Math::Vector3& position, int numMembers, int, bool);
45+
/// Returns the vector with the members of the tribe
46+
/* 90h */ virtual eastl::vector<cCreatureCitizenPtr>& GetTribeMembers();
47+
/// Returns a vector of all selectable members of the tribe
48+
/* 94h */ virtual eastl::vector<cSpatialObjectPtr>& GetSelectableMembers();
49+
/* 98h */ virtual cCreatureCitizen* SpawnMember();
50+
/* 9Ch */ virtual void func9Ch(int, bool);
51+
/// Calls func9Ch() with second parameter true
52+
/* A0h */ virtual void funcA0h(int);
53+
/* A4h */ virtual int GetTotalFood();
54+
/* A8h */ virtual void funcA8h();
55+
/* ACh */ virtual cTribeHut* GetHut();
56+
/* B0h */ virtual cTribeHut* funcB0h();
57+
/// Creates a cCreatureCitizen*
58+
/* B4h */ virtual cCreatureCitizen* funcB4h(int);
59+
/* B8h */ virtual void funcB8h(int);
60+
/* BCh */ virtual eastl::vector<cTribeToolPtr>& GetTools();
61+
/* C0h */ virtual eastl::vector<cTribeToolPtr>& funcC0h();
62+
4363
public:
4464
/* 260h */ cTribeFoodMatPtr mpFoodMat;
4565
/* 264h */ bool mbMotiveCheatOn;
@@ -138,4 +158,10 @@ namespace Simulator
138158
/* 19D8h */ int mPurchasedTools;
139159
};
140160
ASSERT_SIZE(cTribe, 0x19E0);
161+
162+
cTribe* SpawnNpcTribe(const Math::Vector3& position, int tribeArchetype, int numMembers, int, bool, cSpeciesProfile* species);
163+
}
164+
165+
namespace Addresses(Simulator) {
166+
DeclareAddress(SpawnNpcTribe); // 0xC92860 0xC932F0
141167
}

0 commit comments

Comments
 (0)