Skip to content

Commit 596c6aa

Browse files
authored
Added 7 new functions and more documentation to class cScenarioPlayMode (#64)
* Added SetState to cScenarioPlayMode * Added 6 new functions to cScenarioPlayMode. 4 member functions and 2 static functions. If anything goes wrong when calling these, feel free to adjust them where necessary. - Special thanks to Rosalie and ERROR in their help with researching these earlier.
1 parent cd03938 commit 596c6aa

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,13 @@ namespace Simulator
796796
DefineAddress(Initialize, SelectAddress(0xF1F450, 0xF1F060));
797797
DefineAddress(SetCurrentAct, SelectAddress(0xF1F260, 0xF1EE70));
798798
DefineAddress(JumpToAct, SelectAddress(0xF1F7B0, 0xF1F3C0));
799+
DefineAddress(SetState, SelectAddress(0xF1ADB0, 0xF1A9C0));
800+
DefineAddress(UpdateGoals, SelectAddress(0xF1C780, 0xF1C390));
801+
DefineAddress(Update, SelectAddress(0xF1FD50, 0xF1F960));
802+
DefineAddress(CompleteAct, SelectAddress(0xF1F680, 0xF1F290));
803+
DefineAddress(CheckGoalProgress, SelectAddress(0xF1F8D0, 0xF1F4E0));
804+
DefineAddress(RemoveInvisibleClasses, SelectAddress(0xF1AFD0, 0xF1ABE0));
805+
DefineAddress(ReadScenarioTuning, SelectAddress(0xF1E2F0, 0xF1DF00));
799806
}
800807

801808
namespace Addresses(cPlanetRecord)

Spore ModAPI/SourceCode/Simulator/Scenario.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,12 @@ namespace Simulator
7474
auto_METHOD_VOID(cScenarioPlayMode, SetCurrentAct, Args(int index, bool arg), Args(index, arg));
7575
auto_METHOD_VOID(cScenarioPlayMode, JumpToAct, Args(int actIndex), Args(actIndex));
7676
auto_METHOD_VOID_(cScenarioPlayMode, Initialize);
77+
auto_METHOD_VOID(cScenarioPlayMode, SetState, Args(ScenarioPlayModeState state), Args(state));
78+
auto_METHOD_(cScenarioPlayMode, bool, UpdateGoals);
79+
auto_METHOD_VOID(cScenarioPlayMode, Update, Args(int deltaTime), Args(deltaTime));
80+
auto_METHOD_VOID_(cScenarioPlayMode, CompleteAct);
81+
auto_METHOD_VOID_(cScenarioPlayMode, CheckGoalProgress);
82+
auto_STATIC_METHOD_VOID_(cScenarioPlayMode, RemoveInvisibleClasses);
83+
auto_STATIC_METHOD_VOID_(cScenarioPlayMode, ReadScenarioTuning);
7784
}
7885
#endif

Spore ModAPI/Spore/Simulator/cScenarioPlayMode.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,28 @@ namespace Simulator
5656
public:
5757
//TODO check sub_F1EFC0
5858

59+
/// Called when starting the adventure in Play Mode.
5960
void Initialize();
61+
/// Sets the current act index of the active adventure.
6062
void SetCurrentAct(int actIndex, bool = false);
63+
/// Skips the adventure up to the given act index. Also works in reverse, i. e. going back to previous acts in the adventure.
64+
/// Using the same index as the current act will reset the adventure to the beginning of said act.
6165
void JumpToAct(int actIndex);
66+
/// Sets the active state of the adventure.
67+
void SetState(ScenarioPlayModeState state);
68+
/// Updates the current, active goals of the adventure.
69+
bool UpdateGoals();
70+
/// Update function of the adventure.
71+
void Update(int deltaTime);
72+
/// Completes the act, then moves the adventure into the next act. If in the last act, the adventure completes.
73+
void CompleteAct();
74+
/// Called by Update(). Checks if the current goals are clearable or not.
75+
void CheckGoalProgress();
76+
77+
/// Removes objects that are supposed to be invisible during the current act.
78+
static void RemoveInvisibleClasses();
79+
static void ReadScenarioTuning();
80+
6281

6382
public:
6483
/* 0Ch */ cScenarioPlaySummary mSummary;
@@ -111,7 +130,15 @@ namespace Simulator
111130
namespace Addresses(cScenarioPlayMode)
112131
{
113132
DeclareAddress(Initialize); // 0xF1F450, 0xF1F060
114-
DeclareAddress(SetCurrentAct); // 0xF1F260, 0xF1EE70
133+
DeclareAddress(SetCurrentAct); // 0xF1F260, 0xF1EE70
115134
DeclareAddress(JumpToAct); // 0xF1F7B0, 0xF1F3C0
135+
DeclareAddress(SetState); // 0xF1ADB0, 0xF1A9C0
136+
DeclareAddress(UpdateGoals); // 0xF1C780, 0xF1C390
137+
DeclareAddress(Update); // 0xF1FD50, 0xF1F960
138+
DeclareAddress(CompleteAct); // 0xF1F680, 0xF1F290
139+
DeclareAddress(CheckGoalProgress); // 0xF1F8D0, 0xF1F4E0
140+
141+
DeclareAddress(RemoveInvisibleClasses); // 0xF1AFD0, 0xF1ABE0
142+
DeclareAddress(ReadScenarioTuning); // 0xF1E2F0, 0xF1DF00
116143
}
117144
}

0 commit comments

Comments
 (0)