1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
//=============================================================================
// Copyright (C) 2002 Radical Entertainment Ltd. All rights reserved.
//
// File: missionscriptloader.h
//
// Description: Blahblahblah
//
// History: 12/06/2002 + Created -- NAME
//
//=============================================================================
#ifndef MISSIONSCRIPTLOADER_H
#define MISSIONSCRIPTLOADER_H
//========================================
// Nested Includes
//========================================
#include <loading/filehandlerenum.h>
#include <loading/loadingmanager.h>
#include <memory/srrmemory.h>
#include <mission/objectives/missionobjective.h>
#include <mission/conditions/missioncondition.h>
#include <worldsim/ped/pedestrianmanager.h>
#include <console/console.h>
#include <constants/directionalarrowenum.h>
//========================================
// Forward References
//========================================
class TrafficModelGroup;
class EventLocator;
class Mission;
class MissionStage;
class VehicleAI;
//=============================================================================
//
// Synopsis: Blahblahblah
//
//=============================================================================
class MissionScriptLoader : public Console::ExecuteScriptCallback
{
public:
// Static Methods for accessing this singleton.
static MissionScriptLoader* CreateInstance();
static MissionScriptLoader* GetInstance();
static void DestroyInstance();
void Register();
void LoadScript( char* filename );
void LoadScriptAsync( char* filename, LoadingManager::ProcessRequestsCallback* callback = NULL );
void SetFileHander( FileHandlerEnum handler ) { mFileHandler = handler; }
void OnExecuteScriptComplete( void* pUserData );
//Making ptr to this Struct public cuz of dusits damn structs
PedestrianManager::ModelGroup* mp_ModelGroup;
int mPedGroupID;
TrafficModelGroup* mp_TrafficGroup;
private:
MissionScriptLoader();
virtual ~MissionScriptLoader();
//Prevent wasteful constructor creation.
MissionScriptLoader( const MissionScriptLoader& missionscriptloader );
MissionScriptLoader& operator=( const MissionScriptLoader& missionscriptloader );
//
// *** for GameCube only ***
//
static void SetLanguage( int argc, char** argv );
//
// Level functions
//
static void InitLevelPlayerVehicle( int argc, char** argv );
static void PlacePlayerCar( int argc, char** argv );
/*
static void DisableTraffic (int argc, char** argv );
static void EnableTraffic (int argc, char** argv );
*/
static void AddPurchaseCarReward( int argc, char** argv );
static void SetPostLevelFMV( int argc, char** argv );
static void AddGlobalProp(int argc,char** argv );
//Ped Group
static void CreatePedGroup(int argc, char** argv );
static void AddPed(int argc, char** argv );
static void ClosePedGroup (int argc, char** argv );
static void UsePedGroup( int argc, char** argv );
//Reward Binding
static void BindReward(int argc, char** argv);
static void SetCarAttributes(int argc, char** argv);
//Wasps and Gags (in rewards script)
static void SetTotalGags(int argc, char** argv);
static void SetTotalWasps(int argc, char** argv);
//Traffic Group
static void CreateTrafficGroup(int argc, char** argv);
static void AddTrafficModel(int argc, char** argv);
static void CloseTrafficGroup(int argc, char** argv);
//
//Chase/Harrass AI Car functions
//
static void CreateChaseManager(int argc ,char** argv );
static void DisableHitAndRun(int argc,char** argv );
static void EnableHitAndRun(int argc,char** argv );
static void SetHitAndRunMeter(int argc,char** argv );
static void SetNumChaseCars(int argc,char** argv );
static void SetChaseSpawnRate(int argc, char** argv );
static void KillAllChaseAI(int argc,char** argv);
static void ResetHitAndRun(int argc,char** argv );
static void SetHitAndRunDecay(int argc,char** argv );
static void SetHitAndRunDecayInterior(int argc,char** argv );
//
// Mission functions
//
static void AddMission( int argc, char** argv );
static void AddBonusMission( int argc, char** argv );
static void SelectMission( int argc, char** argv );
static void SetMissionNameIndex( int argc, char** argv );
//static void InitMissionPlayerVehicle( int argc, char** argv );
static void SetMissionResetPlayerInCar( int argc, char** argv );
static void SetMissionResetPlayerOutCar( int argc, char** argv );
static void SetDynaLoadData( int argc, char** argv );
static void AddBonusObjective( int argc, char** argv );
static void SetForcedCar( int argc, char** argv );
static void CloseMission( int argc, char** argv );
static void SetDemoLoopTime( int argc, char** argv ); //This isn't really dependant on the mission.
static void StreetRacePropsLoad(int argc, char** argv);
static void StreetRacePropsUnload(int argc, char** argv);
static void UseElapsedTime(int argc,char** argv);
static void AttachStatePropCollectible(int argc,char** argv);
static void ShowHUD(int argc,char** argv);
static void SetNumValidFailureHints(int argc,char** argv);
//
// Mission Stage functions
//
static void AddStage( int argc, char** argv );
static void SetStageMessageIndex( int argc, char** argv );
static void SetStageTime( int argc, char** argv );
static void AddStageTime( int argc, char** argv );
static void AddStageVehicle( int argc, char** argv );
static void AddStageWaypoint( int argc, char** argv );
static void AddStageCharacter( int argc, char** argv );
static void AddStageMusicChange( int argc, char** argv );
static void SetStageMusicAlwaysOn( int argc, char** argv );
static void SetStageStartMusicEvent( int argc, char** argv );
static void SetCompletionDialog( int argc, char** argv );
static void SetMusicState( int argc, char** argv );
static void SetStageCamera( int argc, char** argv );
static void MoveStageVehicle( int argc, char** argv );
static void ActivateVehicle(int argc, char** argv );
static void ResetToThisStage( int argc, char** argv );
static void SetTrafficDensity( int argc, char** argv );
static void AddSafeZone ( int argc, char** argv );
static void SetBonusMissionStart( int argc, char** argv );
static void ShowStageComplete( int argc, char** argv );
static void SetHUDIcon( int argc, char** argv );
static void SetIrisWipe( int argc, char** argv );
static void SetFadeOut( int argc, char** argv );
static void CloseStage( int argc, char** argv );
static void SetVehicleAIParams( int argc, char** argv );
static void SetCoinFee(int argc,char** argv);
static void PutMFPlayerInCar(int argc,char** argv);
static void SetStatepropShadow(int argc,char** argv);
static void SwapInDefaultCar(int argc,char** argv);
static void SetSwapPlayerRespawnLocatorName(int argc,char** argv);
static void SetSwapDefaultCarRespawnLocatorName(int argc,char** argv);
static void SetSwapForcedCarRespawnLocatorName(int argc,char** argv);
static void NoTrafficForStage(int argc,char** argv);
static void ClearTrafficForStage(int argc,char** argv);
static void PlacePlayerAtLocatorName(int argc,char** argv);
static void msPlacePlayerCarAtLocatorName(int argc,char** argv);
static void SetCharacterToHide(int argc,char** argv);
static void SetLevelOver(int argc,char** argv);
static void SetGameOver(int argc, char** argv);
static void StayInBlack(int argc,char** argv);
static void AllowMissionAbort(int argc,char** argv);
static void SetStageAIRaceCatchupParams( int argc, char** argv );
static void SetStageAIEvadeCatchupParams( int argc, char** argv );
static void SetStageAITargetCatchupParams( int argc, char** argv );
//Gamble Race Specific Commands
static void SetParTime(int argc, char** argv);
static void SetRaceEnteryFee(int argc, char** argv);
//
// Objective methods
//
static void AddObjective( int argc, char** argv );
static void AddCollectible( int argc, char** argv );
static void AddCollectibleStateProp( int argc, char** argv );
static void SetCollectibleEffect( int argc, char** argv );
static void SetDestination( int argc, char** argv );
static void SetObjTargetVehicle( int argc, char** argv );
static void SetObjTargetBoss( int argc, char** argv );
static void SetPickupTarget( int argc, char** argv );
static void SetObjDistance( int argc, char** argv );
static void AddNPC( int argc, char** argv );
static void RemoveNPC( int argc, char** argv );
static void AddDriver( int argc, char** argv );
static void RemoveDriver( int argc, char** argv );
static void SetTalkToTarget( int argc, char** argv );
static void SetDialogueInfo( int argc, char** argv );
static void SetDialoguePositions( int argc, char** argv );
static void SetFMVInfo( int argc, char** argv );
static void SetRaceLaps( int argc, char** argv );
static void BindCollectibleToWaypoint( int argc, char** argv );
static void AllowUserDump( int argc, char** argv );
static void SetVehicleToLoad( int argc, char** argv );
static void AllowRockOut( int argc, char** argv );
static void TurnGotoDialogOff( int argc, char** argv );
static void SetPauseDuration(int argc,char** argv );
static void MustActionTrigger( int argc, char** argv );
static void CloseObjective( int argc, char** argv );
//
// Condition methods
//
static void AddCondition( int argc, char** argv );
static void SetCondTargetVehicle( int argc, char** argv );
static void SetFollowDistances( int argc, char** argv );
static void SetCondMinHealth( int argc, char** argv );
static void SetConditionPosition( int argc, char** argv );
static void SetCondTime( int argc, char** argv );
static void SetHitNRun( int argc, char** argv );
static void CloseCondition( int argc, char** argv );
//
// Conversation/Presentation methods
//
static void CharacterIsChild ( int argc, char** argv );
static void SetConversationCamName ( int argc, char** argv );
static void SetConversationCamPcName ( int argc, char** argv );
static void SetConversationCamNpcName ( int argc, char** argv );
static void SetConversationCam ( int argc, char** argv );
static void SetConversationCamDistance( int argc, char** argv );
static void SetConversationCamAngle ( int argc, char** argv );
static void SetPresentationBitmap ( int argc, char** argv );
static void EnableTutorialMode ( int argc, char** argv );
static void AmbientAnimationRandomize ( int argc, char** argv );
static void ClearAmbientAnimations ( int argc, char** argv );
static void AddAmbientNpcAnimation ( int argc, char** argv );
static void AddAmbientPcAnimation ( int argc, char** argv );
static void SetAnimatedCameraMulticontrollerName( int argc, char** argv );
static void SetAnimatedCameraName ( int argc, char** argv );
static void SetMissionStartMulticontrollerName( int argc, char** argv );
static void SetMissionStartCameraName ( int argc, char** argv );
static void SetCamBestSide ( int argc, char** argv );
static void StartCountdown ( int argc, char** argv );
static void AddToCountdownSequence ( int argc, char** argv );
static void SetCarStartCamera ( int argc, char** argv );
static void GoToPattyAndSelmaScreenWhenDone( int argc, char** argv );
//SuperSprint methods
static void SetPlayerCarName( int argc, char** argv );
//
// Loading methods
//
public:
//Use to load cars that can be unloaded from memory easily. like the Default Car and Forced cars, and AI cars.
static void LoadDisposableCar(int argc, char** argv );
//spew text on the screen in for Ps2
static void TreeOfWoeErrorMsg(const char* outputbuffer);
private:
static void LoadP3DFile( int argc, char** argv );
static void AddCharacter( int argc, char** argv );
static void AddNPCCharacterBonusMission( int argc, char** argv );
static void SetBonusMissionDialoguePositions( int argc, char** argv );
static void AddAmbientCharacter( int argc, char** argv );
// adding waypoints for NPCs to walk on
static void AddBonusMissionNPCWaypoint( int argc, char** argv );
static void AddObjectiveNPCWaypoint( int argc, char** argv ); // syntax: name locatorName
static void AddAmbientNPCWaypoint( int argc, char** argv );
static void AddPurchaseCarNPCWaypoint( int argc, char** argv );
static void ActivateTrigger( int argc, char** argv );
static void DeactivateTrigger( int argc, char** argv );
static void CreateAnimPhysObject( int argc, char** argv );
static void CreateActionEventTrigger( int argc, char** argv );
static void LinkActionToObjectJoint( int argc, char** argv );
static void LinkActionToObject( int argc, char** argv );
static void SetCoinDrawable( int argc, char** argv );
static void SetParticleTexture( int argc, char** argv );
//used to set respawnrate of wrenches and nitro etc.
static void SetRespawnRate (int argc,char** argv );
//
// Helper methods
//
static bool AddNPCWaypoint( const char* npcName, const char* locName );
Locator* GetLocator( char* name );
Vehicle* GetVehicleByName( const char* name );
// Return the type of directional arrow from the given string
// returns true if the arrow is valid, false if not
static bool GetDirectionalArrowType( const char* arg, DirectionalArrowEnum::TYPE* outArrowType );
GameMemoryAllocator mMissionHeap;
Mission* mpMission;
MissionStage* mpStage;
MissionObjective* mpObjective;
MissionObjective::ObjectiveTypeEnum mObjType;
MissionCondition* mpCondition;
MissionCondition::ConditionTypeEnum mCondType;
FileHandlerEnum mFileHandler;
bool mFirstObjective;
static MissionScriptLoader* spInstance;
};
// A little syntactic sugar for getting at this singleton.
inline MissionScriptLoader* GetMissionScriptLoader() { return( MissionScriptLoader::GetInstance() ); }
#endif //MISSIONSCRIPTLOADER_H
|