Skip to content

Commit 4a4e52a

Browse files
authored
Simulator Messages, Typo fixes, Tribe documentation, button funcs (#73)
* add function definition for AddCreature * Add MouthTypes to CommonIDs.h * Add name for Unk10 in enum CreaturePersonality * Add definitions to Cursors.h * Fix typo, remove duplicate of auto_METHOD(cEditor, bool, AddCreature, add comment to funcC0h in cTribe.h * Add enum of identity colors to cIdentityColorable * Add several more cursors * ammend comment * remove mouthtypes commit * Add space game cursors * fix compile error in cursors.h * remove erroneous comment * change mIDColorID to use IdentityColors * 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. * fix improper effects detour * document several part unlocking related fields * add comment to cCollectibleItems::sub_597BC0 * Add cursors, Document string format for CursorManager::Load * fix typo * Add Math::GetDistance * Revert "Add Math::GetDistance" This reverts commit cc145ad. * Begin redoing EP1 object system * Revert "change mIDColorID to use IdentityColors" This reverts commit 489f3ad. * Update cIdentityColorable.h * cTribeHut - Document field_218 * cTribeHut - document field_21C * Resolve 4/5 PR change requests * add 'class' to identitycolor enum * SpawnNpcTribe's 4rd interger arg = foodAmount * fix typo * fix typo in LoadBackgroundFiles * Add message enums to SimulatorMessages.h, organize by stage * fix typo * Clarify new simulator messages * Clarify more messages * Add messages, change 1 type * Update SimulatorMessages.h * Update SimulatorMessages.h * fix typo * Document tribe vars * Document cTribe.mbMembersFlee, add Button funcs, fix documentation comments * Annotate unknown func * Resolve PR issues * Revert cTribeTool temp fix
1 parent 5c09b0a commit 4a4e52a

File tree

11 files changed

+198
-26
lines changed

11 files changed

+198
-26
lines changed

Spore ModAPI/SourceCode/DLL/AddressesEditors.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ namespace Editors
177177
DefineAddress(DisableBackground, SelectAddress(0x62F900, 0x62F950));
178178
DefineAddress(Load, SelectAddress(0x62FC70, 0x62FCC0));
179179
DefineAddress(LoadBackgroudFiles, SelectAddress(0x62FBA0, 0x62FBF0));
180+
DefineAddress(LoadBackgroundFiles, SelectAddress(0x62FBA0, 0x62FBF0));
180181
DefineAddress(HandleUIButton, SelectAddress(0x62F7D0, 0x62F820));
181182
DefineAddress(ToggleBackgroundButtonHighlights, SelectAddress(0x62F320, 0x62F370));
182183
DefineAddress(UpdatePageNumbers, SelectAddress(0x62F520, 0x62F570));

Spore ModAPI/SourceCode/Editors/EditorPlayMode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace Editors
111111
Args(PlayModeUI* a1, uint32_t a2, uint32_t a3, Graphics::ILightingWorld* a4, int8_t a5),
112112
Args(a1, a2, a3, a4, a5));
113113

114-
auto_METHOD_VOID(PlayModeBackgrounds, LoadBackgroudFiles,
114+
auto_METHOD_VOID(PlayModeBackgrounds, LoadBackgroundFiles,
115115
Args(int8_t backgroundSet), Args(backgroundSet));
116116

117117
auto_METHOD(PlayModeBackgrounds, bool, HandleUIButton,

Spore ModAPI/SourceCode/UTFWin/Window.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <Spore\UTFWin\Window.h>
2121
#include <Spore\UTFWin\IWindowManager.h>
2222
#include <Spore\UTFWin\IWinProc.h>
23+
#include <Spore\UTFWin\IButton.h>
2324
#include <Spore\UTFWin\Constants.h>
2425
#include <Spore\UTFWin\WindowIterators.h>
2526
#include <EASTL\internal\thread_support.h>
@@ -436,4 +437,14 @@ namespace UTFWin
436437
return true;
437438
}, pWinProc);
438439
}
440+
441+
// Button Funcs
442+
443+
void IButton::SetButtonPressed(bool bValue) {
444+
this->SetButtonFlag(kBtnStateSelected, bValue);
445+
}
446+
447+
bool IButton::IsButtonPressed() {
448+
return this->GetButtonStateFlags() & kBtnStateSelected;
449+
}
439450
}

Spore ModAPI/Spore/Editors/PlayModeBackgrounds.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace Editors
2929

3030
void Load(PlayModeUI* playModeUI, uint32_t entryEffectID, uint32_t crossFadeSnapEffectID, Graphics::ILightingWorld* lightingWorld, int8_t backgroundSet);
3131

32-
void LoadBackgroudFiles(int8_t backgroundSet);
32+
void LoadBackgroundFiles(int8_t backgroundSet);
3333

3434
bool HandleUIButton(uint32_t controlID);
3535

@@ -65,7 +65,8 @@ namespace Editors
6565
DeclareAddress(SwitchBackground);
6666
DeclareAddress(DisableBackground);
6767
DeclareAddress(Load); // 0x62FC70 0x62FCC0
68-
DeclareAddress(LoadBackgroudFiles); // 0x62FBA0 0x62FBF0
68+
DeclareAddress(LoadBackgroundFiles); // 0x62FBA0 0x62FBF0
69+
DeclareAddress(LoadBackgroudFiles); // legacy
6970
DeclareAddress(HandleUIButton); // 0x62F7D0 0x62F820
7071
DeclareAddress(ToggleBackgroundButtonHighlights); // 0x62F320 0x62F370
7172
DeclareAddress(UpdatePageNumbers); // 0x62F520 0x62F570

Spore ModAPI/Spore/Palettes/StandardItemUI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Palettes
4343

4444
public:
4545
/* 0Ch */ PaletteItemPtr mpItem;
46-
/* 10h */ int field_10;
46+
/* 10h */ uint32_t field_10;
4747
/* 14h */ ItemViewerPtr mpViewer;
4848
/* 18h */ IWindowPtr field_18;
4949
/* 1Ch */ bool field_1C;

Spore ModAPI/Spore/Simulator/SimulatorMessages.h

Lines changed: 166 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ namespace Simulator
3232
/// Simulator::EnterEditorMessage; Enters the correct editor modifying the specified creation.
3333
kMsgEnterEditor = 0x53850BAE,
3434

35+
/// Switches the editor. Use the desired editor ID as the message data .
36+
kMsgSwitchEditor = 0x0212D3E7,
37+
3538
kMsgSwitchGameMode = 0x0212D3E7,
3639

3740
/// Saves the game, pausing the game and showing a dialog on success. Use with message data `1` (as in, an integer).
3841
kMsgSaveGame = 0x1CD20F0,
3942

43+
/// Sent when loading a saved game.
44+
kMessageLoadGame = 0xf8b1a2af,
45+
4046
/// Simulator::GameNounStatusChangedMessage
4147
kMsgGameNounStatusChanged = 0x1A0219E,
4248

@@ -46,6 +52,125 @@ namespace Simulator
4652
/// Simulator::CombatantKilledMessage; called when a combatant is killed
4753
kMsgCombatantKilled = 0x1622184,
4854

55+
/// kills persistant swarm effects. Used at the end of certain stages
56+
kMsgKillPersistentEffects = 0x0667af52,
57+
58+
/// Simulator::DoCinematicActionMessage ; sent to execute a single action within a cinematic stage
59+
kMsgDoCinematicAction = 0x4470A41,
60+
61+
//////////////////
62+
// Cell Stage
63+
//////////////////
64+
65+
// Sent when the cell stage intro cinematic effect ends
66+
kMsgCinematicGGE2CLGEnds = 0x04065b23,
67+
68+
/// Sent when cell stage has begun
69+
kMsgCellStageStart = 0x047c1d19,
70+
71+
/// Sent when cell stage is transitioning to creature stage
72+
kMsgCellToCreatureTransition = 0x02A4f8f0,
73+
74+
//////////////////
75+
// Creature Stage
76+
//////////////////
77+
78+
/// Hatches the avatar creature's egg in creature stage
79+
kMsgHatchAvatarEggs = 0x06566531,
80+
81+
/// Upgrades the player's nest to the current brain level(?) in creature stage. May be cutscene only.
82+
kMsgUpgradeNest = 0x06555abc,
83+
84+
/// Respawns the avatar creature at their nest in creature stage
85+
kMsgRestartAtNest = 0x04f60b92,
86+
87+
/// Loads the avatar into the creature editor
88+
kEnterCreatureEditor = 0x04d9686f,
89+
90+
/// TODO, uses data
91+
//kCinematicCRG2TRGPreload = 0x04b719d4,
92+
93+
/// Transitions from creature stage to tribal stage
94+
kMsgCreatureToTribeTransition = 0x0477f66c,
95+
96+
///////////////
97+
// Tribe Stage
98+
///////////////
99+
100+
/// Upgrades the player tribe's main hut (Cutscene only)
101+
kMsgTribeUpgradeHut = 0x0575116e,
102+
103+
/// Upgrades the player tribe's campfire and layout decal (Cutscene only)
104+
kMsgTribeUpgradeCampfire = 0x0575116f,
105+
106+
/// Upgrades the player tribe's totem base and food mat (Cutscene only)
107+
kMsgTribeUpgradeFoodMat = 0x05751170,
108+
109+
/// Sent to notify the game that a new tribal totem needs to be added (Cutscene only)
110+
kMsgNotifyTotemNeeded = 0x05cd5482,
111+
112+
/// Sent to notify the game that the tribal upgrade or totem placement has finished so that game can save (Cutscene only)
113+
kMsgNotifyUpgradeDone = 0x05cd5482,
114+
115+
/// Restarts the tribal stage (as though tribal hut has been destroyed)
116+
kMsgTribeRestart = 0x0420e32a,
117+
118+
/// Moves the tribal camera to point towards the center of your tribe
119+
kMsgTribeMoveCameraToTribe = 0x056cf231,
120+
121+
/// TRG2CVG - Shows the city hall (Cutscene only)
122+
kMsgCinematicTRG2CVGShowCityHall = 0x069479a8,
123+
124+
/// TRG2CVG - Hides the city hall (Cutscene only)
125+
kMsgCinematicTRG2CVGHideCityHall = 0x0694797d,
126+
127+
/////////////
128+
// Civ Stage
129+
/////////////
130+
131+
/// Sent when the cutscene for a new city appearing plays in civ stage
132+
kMsgCinematicNewCityAppears = 0x05668f43,
133+
134+
/// Sent when the captured city's buildings restart their runtime effects in civ stage
135+
kMsgCinematicCityChangeStartBuildingsEffects = 0x05f4d02a,
136+
137+
/// Sent when the captured city's buildings swap their models in civ stage
138+
kMsgCinematicCityChangeSwapBuildings = 0x05dfb77f,
139+
140+
/// Sent when the captured city's wall color changes in civ stage
141+
kMsgCinematicCityChangeChangeWallColor = 0x05dfb782,
142+
143+
/// Sent when the captured city's civilization ownership changes in civ stage
144+
kMsgCinematicCityChangeChangeCivilization = 0x05dbc31e,
145+
146+
/// Sent when a tier 3 superweapon cutscene begins in civ stage (?)
147+
kMsgCivTriggerSuperweapon = 0x06524f8f,
148+
149+
/// Sent when the UFO appears at the very end of civ stage
150+
kMsgShowUFOForTransition = 0x0590cd26,
151+
152+
///////////////
153+
// Space Stage
154+
///////////////
155+
156+
/// Sent when launching a space stage game form the main menu
157+
kMsgSpaceGameFromLaunchScreen = 0x02364016,
158+
159+
/// Sent when the player gets new tools in a space stage cutscene (TODO: Does this also get called outside of cutscenes?)
160+
kMsgCinematicSpaceGetTools = 0x06526395,
161+
162+
/// Sent from the cutscene where the player first picks up spice in space stage
163+
kMsgCinematicSpaceFirstSpicePickup = 0x06834927,
164+
165+
/// Plays the "UFO Effect" of swirly lights appearing around the player's ship in a space stage cutscene
166+
kMsgCinematicSpaceUFOEffect = 0x0665e639,
167+
168+
/// Sent when a new badge appears on the screen in space stage
169+
kMsgCinematicScreenBadgeEffect = 0x0665e1ab,
170+
171+
/// Sent when the atmosphere dome goes down on a space stage colony (TODO: Does this also get called outside of cutscenes?)
172+
kMsgCinematicSpaceColonyAtmosphereDomeDown = 0x065e622c,
173+
49174
/// Simulator::PlayerEmpireAlliedMessage; called when the player empire makes a new alliance
50175
kMsgPlayerEmpireAllied = 0x4445D43,
51176

@@ -58,17 +183,6 @@ namespace Simulator
58183
/// Simulator::ToolOnHitMessage; called when a space tool hits a target
59184
kMsgToolOnHit = 0x56690BB,
60185

61-
/// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode
62-
kMsgScenarioCreatureHealed = 0x7C789F8,
63-
64-
/// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy
65-
kMsgScenarioEnergyConsumed = 0x7C7A52E,
66-
67-
/// No data, called when pressing the undo button in the scenario editor
68-
kMsgScenarioUndo = 0xC9D86390,
69-
/// No data, called when pressing the redo button in the scenario editor
70-
kMsgScenarioRedo = 0xC9D86391,
71-
72186
/// Message emitted by the galaxy generation effect to create stars of StarType::StarG (yellow) type.
73187
kMsgGalaxyGenerateStarG = 0x35B2B15,
74188
/// Message emitted by the galaxy generation effect to create stars of StarType::StarO (blue) type.
@@ -102,8 +216,47 @@ namespace Simulator
102216
/// Sent when the ownership of some star changes. No parameters.
103217
kMsgStarOwnershipChanged = 0x55BD8F7,
104218

105-
/// Simulator::DoCinematicActionMessage ; sent to execute a single action within a cinematic stage
106-
kMsgDoCinematicAction = 0x4470A41,
219+
/////////////////
220+
// Scenario Mode
221+
/////////////////
222+
223+
/// Simulator::ScenarioCreatureHealedMessage; called when a creature is healed (either by natural heal rate, or using a medkit) in Scenario mode
224+
kMsgScenarioCreatureHealed = 0x7C789F8,
225+
226+
/// Simulator::ScenarioEnergyConsumedMessage; sent when the player consumes captain energy
227+
kMsgScenarioEnergyConsumed = 0x7C7A52E,
228+
229+
/// No data, called when pressing the undo button in the scenario editor
230+
kMsgScenarioUndo = 0xC9D86390,
231+
/// No data, called when pressing the redo button in the scenario editor
232+
kMsgScenarioRedo = 0xC9D86391,
233+
234+
/// Called when the captain is finished beaming down in scenario mode
235+
kMsgCinematicScenarioBeamDownComplete = 0x078eab55,
236+
237+
/// Removes the avatar from a scenario cutscene
238+
kMsgCinematicScenarioClearAvatar = 0x07b509fe,
239+
240+
/// 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?)
241+
kMsgCinematicTalkToSizeSetup = 0x07d0c530,
242+
243+
/// 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?)
244+
kMsgCinematicTalkToGreetSetup = 0x07da0410,
245+
246+
/// 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?)
247+
kMsgCinematicTalkToTextSetup = 0x0754ae8a,
248+
249+
/// 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?)
250+
kMsgCinematicTalkToAnimStyleSetup = 0x07688cad,
251+
252+
/// 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?)
253+
kMsgCinematicTalkToAnimEmotionSetup = 0x07688cad,
254+
255+
/// 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?)
256+
kMsgCinematicTalkToPageSetup = 0x0750d732,
257+
258+
/// Called when the talk-to dialogue skips a blank page
259+
kMsgCinematicTalkToSkipBlankPage = 0x07aaa58c,
107260
};
108261

109262
class IMessageParameters

Spore ModAPI/Spore/Simulator/cCityWalls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace Simulator
8989
/* 260h */ float mCityHallDiasHeight;
9090
/* 264h */ eastl::intrusive_ptr<cCity> mpCity;
9191
/* 268h */ Vector3 field_268; // 1, 1, 1
92-
/// A matrix teling which building slots are connected to which slots
92+
/// A matrix telling which building slots are connected to which slots
9393
/* 274h */ bool mBuildingLinks[MAX_LAYOUT_SLOTS][MAX_LAYOUT_SLOTS];
9494
/* 338h */ Vector3 mCenterAxis; // not initialized
9595
/* 344h */ uint32_t mStyle; // 0x9181A19

Spore ModAPI/Spore/Simulator/cCommunity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace Simulator
7777
/* 68h */ virtual void func68h();
7878
/* 6Ch */ virtual cCityWalls* GetCityWalls(); // returns 0
7979
/* 70h */ virtual eastl::vector<ObjectPtr>& GetPopulation();
80-
/* 74h */ virtual int GetPopulationCount(); // returns the count of vector returned by func70h
80+
/* 74h */ virtual int GetPopulationCount(); // returns the count of vector returned by GetPopulation()
8181
/* 78h */ virtual void func78h();
8282
/* 7Ch */ virtual eastl::string16& GetCommunityName();
8383
/* 80h */ virtual void func80h();

Spore ModAPI/Spore/Simulator/cTribe.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ namespace Simulator
7373
/// Returns a vector of all selectable members of the tribe
7474
/* 94h */ virtual eastl::vector<cSpatialObjectPtr>& GetSelectableMembers();
7575
/* 98h */ virtual cCreatureCitizen* SpawnMember();
76-
/* 9Ch */ virtual void func9Ch(int, bool);
76+
/// Removes a member of the tribe. index seems to cause issues if not 0.
77+
/* 9Ch */ virtual void func9Ch(int index, bool);
7778
/// Calls func9Ch() with second parameter true
78-
/* A0h */ virtual void funcA0h(int);
79+
/* A0h */ virtual void funcA0h(int index);
7980
/* A4h */ virtual int GetTotalFood();
8081
/* A8h */ virtual void funcA8h();
8182
/* ACh */ virtual cTribeHut* GetHut();
@@ -137,7 +138,7 @@ namespace Simulator
137138
/* 36Ch */ eastl::vector<cTribeToolPtr> mTools;
138139
/* 380h */ eastl::vector<cTribeToolPtr> mSocialTools;
139140
/* 394h */ eastl::hash_map<int, cCommunityLayout> field_394;
140-
/* 3B4h */ cCommunityLayout field_3B4;
141+
/* 3B4h */ cCommunityLayout mTribeLayout;
141142
/* 418h */ eastl::fixed_vector<int, 45> field_418;
142143
/* 4E4h */ eastl::hash_map<int, eastl::deque<ObjectPtr>> field_4E4;
143144
/* 504h */ int field_504; // not initialized
@@ -148,7 +149,7 @@ namespace Simulator
148149
/* 550h */ int mTribeArchetype; //TODO
149150
/* 554h */ bool field_554;
150151
/* 555h */ bool field_555;
151-
/* 556h */ bool field_556;
152+
/* 556h */ bool mbMembersFlee; // if true, creatures run away in fear
152153
/* 557h */ bool mGoodyPopped;
153154
/* 558h */ char _padding_558[0x1310];
154155
/* 1868h */ int field_1868;
@@ -171,7 +172,7 @@ namespace Simulator
171172
/* 18A4h */ int field_18A4; // -1
172173
/* 18A8h */ bool field_18A8;
173174
/* 18A9h */ bool field_18A9;
174-
/* 18ACh */ int field_18AC; // not initialized
175+
/* 18ACh */ uint32_t field_18AC; // not initialized
175176
/* 18B0h */ int field_18B0;
176177
/* 18B4h */ int field_18B4;
177178
/* 18B8h */ int field_18B8;

Spore ModAPI/Spore/UTFWin/IButton.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace UTFWin
3838
kBtnFlagFixedHeight = 0x00000004
3939
};
4040

41-
/// Flags relted to the state of a button that can be set to an UTFWin::IButton.
41+
/// Flags related to the state of a button that can be set to an UTFWin::IButton.
4242
enum ButtonStateFlags
4343
{
4444
kBtnStateSelected = 4
@@ -177,6 +177,11 @@ namespace UTFWin
177177
/// @param format
178178
/* 6Ch */ virtual void SetTextOutline(OutlineFormat& format) = 0;
179179

180+
/// Custom method that sets if the button is pressed or not.
181+
void SetButtonPressed(bool bValue);
182+
/// Custom method that returns if the button is pressed or not.
183+
bool IsButtonPressed();
184+
180185

181186
static IButton* Create();
182187
};

0 commit comments

Comments
 (0)