12#ifndef SCRIPTS_INCLUDE__SCRIPTS_H
13#define SCRIPTS_INCLUDE__SCRIPTS_H
17#error The renegade scripts.dll requires Microsoft Visual C++ in order to work
20class ScriptableGameObj;
21typedef ScriptableGameObj GameObject;
27enum ActionCompleteReason {
28 ACTION_COMPLETE_NORMAL,
29 ACTION_COMPLETE_LOW_PRIORITY,
30 ACTION_COMPLETE_PATH_BAD_START,
31 ACTION_COMPLETE_PATH_BAD_DEST,
32 ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE,
33 ACTION_COMPLETE_ATTACK_OUT_OF_RANGE,
34 ACTION_COMPLETE_CONVERSATION_ENDED,
35 ACTION_COMPLETE_CONVERSATION_INTERRUPTED,
36 ACTION_COMPLETE_CONVERSATION_UNABLE_TO_INIT,
37 MOVEMENT_COMPLETE_ARRIVED,
40class ScriptVariableClass {
42 ScriptVariableClass(
void * data_ptr,
int data_size,
int id, ScriptVariableClass * next ) : DataPtr( data_ptr ), DataSize( data_size ),ID( id ),Next( next ) {}
55 ScriptVariableClass *Get_Next()
63 ScriptVariableClass *Next;
67 SOUND_TYPE_OLD_WEAPON,
71 SOUND_TYPE_BULLET_HIT,
72 NUM_DEFINED_SOUND_TYPES,
73 SOUND_TYPE_DESIGNER01 = 991,
74 SOUND_TYPE_DESIGNER02,
75 SOUND_TYPE_DESIGNER03,
76 SOUND_TYPE_DESIGNER04,
77 SOUND_TYPE_DESIGNER05,
78 SOUND_TYPE_DESIGNER06,
79 SOUND_TYPE_DESIGNER07,
80 SOUND_TYPE_DESIGNER08,
81 SOUND_TYPE_DESIGNER09,
86 ScriptableGameObj *Creator;
89class SCRIPTS_API GameObjObserverClass {
91 GameObjObserverClass() : ID( 0 ) {}
92 virtual ~GameObjObserverClass() {}
93 virtual const char *Get_Name() = 0;
102 virtual void Attach(GameObject *obj) = 0;
103 virtual void Detach(GameObject *obj) = 0;
104 virtual void Created(GameObject *obj) = 0;
105 virtual void Destroyed(GameObject *obj) = 0;
106 virtual void Killed(GameObject *obj,GameObject *killer) = 0;
107 virtual void Damaged(GameObject *obj,GameObject *damager,
float amount) = 0;
108 virtual void Custom(GameObject *obj,
int type,
int param,GameObject *sender) = 0;
109 virtual void Sound_Heard(GameObject *obj,
const CombatSound & sound) = 0;
110 virtual void Enemy_Seen(GameObject *obj,GameObject *enemy) = 0;
111 virtual void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason complete_reason) = 0;
112 virtual void Timer_Expired(GameObject *obj,
int number) = 0;
113 virtual void Animation_Complete(GameObject *obj,
const char *animation_name) = 0;
114 virtual void Poked(GameObject *obj,GameObject *poker) = 0;
115 virtual void Entered(GameObject *obj,GameObject *enterer) = 0;
116 virtual void Exited(GameObject *obj,GameObject *exiter) = 0;
117 virtual GameObject* Owner() {
return 0;}
122class SCRIPTS_API ScriptClass :
public GameObjObserverClass {
124 virtual ~ScriptClass() {}
125 virtual GameObject** Get_Owner_Ptr() = 0;
126 virtual void Set_Parameters_String(
const char *params) = 0;
127 virtual void Get_Parameters_String(
char *buffer,
unsigned int size) = 0;
128 virtual void Save(ScriptSaver& saver) = 0;
129 virtual void Load(ScriptLoader& loader) = 0;
132class SCRIPTS_API ScriptImpClass :
public ScriptClass {
134 static void Set_Request_Destroy_Func(
void (*function)(ScriptClass*));
135 void SetFactory(ScriptFactory* factory)
140 int CheckPlayerType(GameObject *obj,
int type);
141 void Auto_Save_Variable(
void * data_ptr,
int data_size,
int id );
142 virtual ~ScriptImpClass();
143 const char* Get_Name(
void);
149 void Created(GameObject *obj) {}
155 void Destroyed(GameObject *obj) {}
164 void Killed(GameObject *obj,GameObject *killer) {}
174 void Damaged(GameObject *obj,GameObject *damager,
float amount) {}
184 void Custom(GameObject *obj,
int type,
int param,GameObject *sender) {}
193 void Sound_Heard(GameObject *obj,
const CombatSound & sound) {}
201 void Enemy_Seen(GameObject *obj,GameObject *enemy) {}
212 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason complete_reason) {}
221 void Timer_Expired(GameObject *obj,
int number) {}
229 void Animation_Complete(GameObject *obj,
const char *animation_name) {}
237 void Poked(GameObject *obj,GameObject *poker) {}
244 void Entered(GameObject *obj,GameObject *enterer) {}
251 void Exited(GameObject *obj,GameObject *exiter) {}
257 GameObject** Get_Owner_Ptr()
261 void Set_Parameters_String(
const char* params);
262 void Get_Parameters_String(
char* buffer,
unsigned int size);
263 virtual void Save_Data(ScriptSaver& saver) {}
264 virtual void Load_Data(ScriptLoader& loader) {}
265 virtual void Register_Auto_Save_Variables() {}
266 const char* Get_Parameter(
const char* name);
267 const char* Get_Parameter(
int index);
268 int Get_Int_Parameter(
const char* parameterName);
269 float Get_Float_Parameter(
const char* parameterName);
270 Vector3 Get_Vector3_Parameter(
int index);
271 Vector3 Get_Vector3_Parameter(
const char* parameterName);
272 int Get_Parameter_Index(
const char* parameterName);
273 int Get_Parameter_Count()
277 int Get_Int_Parameter(
int index)
279 return atoi(Get_Parameter(index));
281 float Get_Float_Parameter(
int index)
283 return (
float)atof(Get_Parameter(index));
285 bool Get_Bool_Parameter(
const char* name)
287 return Get_Int_Parameter(name) != 0;
289 bool Get_Bool_Parameter(
int index)
291 return Get_Int_Parameter(index) != 0;
293 void Destroy_Script(
void);
295 void Attach(GameObject* obj);
296 void Detach(GameObject* obj);
297 virtual void Save(ScriptSaver& saver);
298 virtual void Load(ScriptLoader& loader);
300 static void (*Request_Destroy_Script)(ScriptClass*);
301 void Clear_Parameters(
void);
302 void Set_Parameter(
int index,
const char* str);
306 ScriptFactory *mFactory;
307 ScriptVariableClass *AutoVariableList;
310 NO_AI_STATE_CHANGE = -1,
312 AI_STATE_SECONDARY_IDLE,
316const float DONT_MOVE_ARRIVED_DIST = 1000.0F;
318class ActionParamsStruct {
320 ActionParamsStruct(
void );
321 void Set_Basic( GameObjObserverClass * script,
float priority,
int action_id, SoldierAIState ai_state = NO_AI_STATE_CHANGE ) { ObserverID = script->Get_ID(); Priority = (int)priority; ActionID = action_id; AIState = ai_state; }
322 void Set_Basic(
long observer_id,
float priority,
int action_id, SoldierAIState ai_state = NO_AI_STATE_CHANGE ) { ObserverID = observer_id; Priority = (int)priority; ActionID = action_id; AIState = ai_state; }
323 void Set_Look(
const Vector3 & location,
float duration ) { LookLocation = location; LookDuration = duration; }
324 void Set_Look( GameObject *
object,
float duration ) { LookObject = object; LookDuration = duration; }
325 void Set_Look(
const Vector3 & obj_pos,
float angle,
float duration );
326 void Set_Movement(
const Vector3 & location,
float speed,
float arrived_distance,
bool crouched =
false ) { MoveLocation = location; MoveSpeed = speed; MoveArrivedDistance = arrived_distance; MoveCrouched = crouched; }
327 void Set_Movement( GameObject *
object,
float speed,
float arrived_distance,
bool crouched =
false ) { MoveObject = object; MoveSpeed = speed; MoveArrivedDistance = arrived_distance; MoveCrouched = crouched; }
328 void Set_Attack(
const Vector3 & location,
float range,
float error,
bool primary_fire ) { AttackLocation = location; AttackRange = range; AttackError = error; AttackPrimaryFire = primary_fire; }
329 void Set_Attack( GameObject *
object,
float range,
float error,
bool primary_fire ) { AttackObject = object; AttackRange = range; AttackError = error; AttackPrimaryFire = primary_fire; }
330 void Set_Animation(
const char * name,
bool looping ) { AnimationName = name; AnimationLooping = looping; }
331 void Set_Face_Location(
const Vector3 &location,
float duration ) { FaceLocation = location; FaceDuration = duration; }
332 void Set_Face_Location(
const Vector3 & obj_pos,
float angle,
float duration );
333 void Join_Conversation(
int active_conversation_id ) { ActiveConversationID = active_conversation_id; }
334 void Start_Conversation(
const char * name ) { ConversationName = name; }
335 void Dock_Vehicle(
const Vector3 &dock_location,
const Vector3 &dock_entrance ) { DockLocation = dock_location; DockEntrance = dock_entrance; }
344 Vector3 LookLocation;
345 GameObject *LookObject;
347 Vector3 MoveLocation;
348 GameObject *MoveObject;
349 Vector3 MoveObjectOffset;
351 float MoveArrivedDistance;
358 bool ShutdownEngineOnArrival;
361 bool AttackErrorOverride;
362 GameObject *AttackObject;
363 bool AttackPrimaryFire;
365 Vector3 AttackLocation;
366 bool AttackCheckBlocked;
368 bool AttackWanderAllowed;
369 bool AttackFaceTarget;
370 bool AttackForceFire;
372 Vector3 FaceLocation;
379 const char *AnimationName;
380 bool AnimationLooping;
381 int ActiveConversationID;
382 const char *ConversationName;
383 SoldierAIState AIState;
384 Vector3 DockLocation;
385 Vector3 DockEntrance;
388inline ActionParamsStruct::ActionParamsStruct(
void ) :
392 LookLocation( 0,0,0 ),
395 MoveLocation( 0,0,0 ),
397 MoveObjectOffset( 0,0,0 ),
399 MoveArrivedDistance( DONT_MOVE_ARRIVED_DIST ),
402 MoveCrouched( false ),
403 MovePathfind( true ),
404 ShutdownEngineOnArrival( false ),
407 AttackErrorOverride( false ),
408 AttackObject( NULL ),
409 AttackPrimaryFire( true ),
410 AttackCrouched( false ),
411 AttackLocation( 0,0,0 ),
412 AttackCheckBlocked( true ),
413 AttackActive( true ),
414 AttackWanderAllowed( false ),
415 AttackFaceTarget( true ),
416 AttackForceFire( false ),
417 ForceFacing( false ),
418 IgnoreFacing( false ),
419 FaceLocation( 0, 0, 0 ),
420 FaceDuration( 2.0F ),
422 WaypointStartID( 0 ),
424 WaypathSplined( false ),
425 AnimationName( NULL ),
426 AnimationLooping( false ),
427 ActiveConversationID( 0 ),
428 ConversationName( NULL ),
429 AIState( NO_AI_STATE_CHANGE ),
430 DockLocation( 0,0,0 ),
431 DockEntrance( 0,0,0 )
435void inline ActionParamsStruct::Set_Face_Location(
const Vector3 &obj_pos,
float angle,
float duration )
437 FaceLocation = obj_pos;
438 FaceLocation.X += ::cos( angle );
439 FaceLocation.Y += ::sin( angle );
440 FaceDuration = duration;
445void inline ActionParamsStruct::Set_Look(
const Vector3 &obj_pos,
float angle,
float duration )
447 LookLocation = obj_pos;
448 LookLocation.X += ::cos( angle );
449 LookLocation.Y += ::sin( angle );
450 LookDuration = duration;
455 CUSTOM_EVENT_SYSTEM_FIRST = 1000000000,
456 CUSTOM_EVENT_SOUND_ENDED,
457 CUSTOM_EVENT_BUILDING_POWER_CHANGED,
458 CUSTOM_EVENT_DOCK_BACKING_IN,
459 CUSTOM_EVENT_CINEMATIC_SET_FIRST_SLOT = 10000,
460 CUSTOM_EVENT_CINEMATIC_SET_LAST_SLOT = CUSTOM_EVENT_CINEMATIC_SET_FIRST_SLOT + 39,
461 CUSTOM_EVENT_POWERUP_GRANTED = 1000000025,
462 CUSTOM_EVENT_BUILDING_DAMAGED,
463 CUSTOM_EVENT_BUILDING_REPAIRED,
464 CUSTOM_EVENT_VEHICLE_ENTERED,
465 CUSTOM_EVENT_VEHICLE_EXITED,
466 CUSTOM_EVENT_ATTACK_ARRIVED,
467 CUSTOM_EVENT_CONVERSATION_BEGAN,
468 CUSTOM_EVENT_CONVERSATION_REMARK_STARTED,
469 CUSTOM_EVENT_CONVERSATION_REMARK_ENDED,
470 CUSTOM_EVENT_LADDER_OCCUPIED,
471 CUSTOM_EVENT_FALLING_DAMAGE,
472 CUSTOM_EVENT_VEHICLE_OWNER,
473 CUSTOM_EVENT_VEHICLE_DRIVER,
474 CUSTOM_EVENT_VHEICLE_DRIVER_ID,
475 CUSTOM_EVENT_BEACON_DEPLOYED,
477 CUSTOM_EVENT_BUILDING_REVIVED,
478 CUSTOM_EVENT_OWNED_VEHICLE,
482 OBJECTIVE_TYPE_PRIMARY = 1,
483 OBJECTIVE_TYPE_SECONDARY,
484 OBJECTIVE_TYPE_TERTIARY,
485 OBJECTIVE_STATUS_PENDING = 0,
486 OBJECTIVE_STATUS_ACCOMPLISHED,
487 OBJECTIVE_STATUS_FAILED,
488 OBJECTIVE_STATUS_HIDDEN,
489 RADAR_BLIP_SHAPE_NONE = 0,
490 RADAR_BLIP_SHAPE_HUMAN,
491 RADAR_BLIP_SHAPE_VEHICLE,
492 RADAR_BLIP_SHAPE_STATIONARY,
493 RADAR_BLIP_SHAPE_OBJECTIVE,
494 RADAR_BLIP_SHAPE_EXTRA_1,
495 RADAR_BLIP_SHAPE_EXTRA_2,
496 RADAR_BLIP_SHAPE_EXTRA_3,
497 RADAR_BLIP_SHAPE_EXTRA_4,
498 RADAR_BLIP_SHAPE_EXTRA_DISTANT_1,
499 RADAR_BLIP_SHAPE_EXTRA_DISTANT_2,
500 RADAR_BLIP_SHAPE_EXTRA_DISTANT_3,
501 RADAR_BLIP_SHAPE_EXTRA_DISTANT_4,
502 RADAR_BLIP_COLOR_NOD = 0,
503 RADAR_BLIP_COLOR_GDI,
504 RADAR_BLIP_COLOR_NEUTRAL,
505 RADAR_BLIP_COLOR_MUTANT,
506 RADAR_BLIP_COLOR_RENEGADE,
507 RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE,
508 RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE,
509 RADAR_BLIP_COLOR_TERTIARY_OBJECTIVE,
510 SCRIPT_PLAYERTYPE_SPECTATOR = -4,
511 SCRIPT_PLAYERTYPE_MUTANT,
512 SCRIPT_PLAYERTYPE_NEUTRAL,
513 SCRIPT_PLAYERTYPE_RENEGADE,
514 SCRIPT_PLAYERTYPE_NOD,
515 SCRIPT_PLAYERTYPE_GDI,
517class SCRIPTS_API ScriptFactory {
519 ScriptFactory *mNext;
520 const char *ScriptName;
521 const char *ParamDescription;
523 virtual ~ScriptFactory();
524 const char* GetName(
void);
525 const char* GetParamDescription(
void);
526 virtual ScriptImpClass* Create(
void) = 0;
528 friend class ScriptRegistrar;
529 ScriptFactory(
const char* name,
const char* param);
530 ScriptFactory* GetNext(
void)
const;
531 void SetNext(ScriptFactory* link);
534class SCRIPTS_API ScriptRegistrar {
536 static ScriptFactory *mScriptFactories;
538 static void RegisterScript(ScriptFactory* factory);
539 static void UnregisterScript(ScriptFactory* factory);
540 static ScriptImpClass* CreateScript(
const char* name);
541 static ScriptFactory* GetScriptFactory(
const char* name);
542 static ScriptFactory* GetScriptFactory(
int index);
543 static int Count(
void);
546template <
class T>
class ScriptRegistrant :
public ScriptFactory {
548 ScriptRegistrant(
const char* name,
const char* param) : ScriptFactory(name, param)
551 virtual ScriptImpClass* Create(
void)
554 script->SetFactory(
this);
555 script->Register_Auto_Save_Variables();
560#define SCRIPT_COMMANDS_VERSION 174
561struct ScriptCommands {
563 unsigned int Version;
564 void (* Debug_Message )(
char *format, ... );
565 void ( * Action_Reset )( GameObject * obj,
float priority );
566 void ( * Action_Goto )( GameObject * obj,
const ActionParamsStruct & params );
567 void ( * Action_Attack )( GameObject * obj,
const ActionParamsStruct & params );
568 void ( * Action_Play_Animation )( GameObject * obj,
const ActionParamsStruct & params );
569 void ( * Action_Enter_Exit )( GameObject * obj,
const ActionParamsStruct & params );
570 void ( * Action_Face_Location )( GameObject * obj,
const ActionParamsStruct & params );
571 void ( * Action_Dock )( GameObject * obj,
const ActionParamsStruct & params );
572 void ( * Action_Follow_Input )( GameObject * obj,
const ActionParamsStruct & params );
573 void ( * Modify_Action )( GameObject * obj,
int ActionID,
const ActionParamsStruct & params,
bool modify_move,
bool modify_attack);
574 int ( * Get_Action_ID )( GameObject * obj );
575 bool ( * Get_Action_Params )( GameObject * obj, ActionParamsStruct & params );
576 bool ( * Is_Performing_Pathfind_Action )( GameObject * obj );
577 void ( * Set_Position )( GameObject * obj,
const Vector3 & position );
578 Vector3 ( * Get_Position )( GameObject * obj );
579 Vector3 ( * Get_Bone_Position )( GameObject * obj,
const char * bone_name );
580 float ( * Get_Facing )( GameObject * obj );
581 void ( * Set_Facing )( GameObject * obj,
float degrees );
582 void ( * Disable_All_Collisions )( GameObject * obj );
583 void ( * Disable_Physical_Collisions )( GameObject * obj );
584 void ( * Enable_Collisions )( GameObject * obj );
585 void ( * Destroy_Object )( GameObject * obj );
586 GameObject * ( * Find_Object )(
int obj_id );
587 GameObject * ( * Create_Object )(
const char * type_name,
const Vector3 & position );
588 GameObject * ( * Create_Object_At_Bone )( GameObject * host_obj,
const char * new_obj_type_name,
const char * bone_name );
589 int ( * Get_ID )( GameObject * obj );
590 int ( * Get_Preset_ID )( GameObject * obj );
591 const char * ( * Get_Preset_Name )( GameObject * obj );
592 void (*Attach_Script)(GameObject* object,
const char* scriptName,
const char* scriptParams);
593 void (*Add_To_Dirty_Cull_List)(GameObject* object);
594 void ( * Start_Timer )( GameObject * obj, ScriptClass * script,
float duration,
int timer_id );
595 void ( * Trigger_Weapon )( GameObject * obj,
bool trigger,
const Vector3 & target,
bool primary);
596 void ( * Select_Weapon )( GameObject * obj,
const char * weapon_name );
597 void ( * Send_Custom_Event )( GameObject * from, GameObject * to,
int type,
int param,
float delay);
598 void ( * Send_Damaged_Event )( GameObject * object, GameObject * damager );
599 float ( * Get_Random )(
float min,
float max );
600 int ( * Get_Random_Int )(
int min,
int max );
601 GameObject * ( * Find_Random_Simple_Object )(
const char *preset_name );
602 void ( * Set_Model )( GameObject * obj,
const char * model_name );
631 void ( * Set_Animation )( GameObject * obj,
const char * anim_name,
bool looping,
const char * sub_obj_name,
float start_frame,
float end_frame,
bool is_blended);
632 void ( * Set_Animation_Frame )( GameObject * obj,
const char * anim_name,
int frame );
633 int ( * Create_Sound )(
const char * sound_preset_name,
const Vector3 & position, GameObject * creator );
634 int ( * Create_2D_Sound )(
const char * sound_preset_name );
635 int ( * Create_2D_WAV_Sound )(
const char * wav_filename );
636 int ( * Create_3D_WAV_Sound_At_Bone )(
const char * wav_filename, GameObject * obj,
const char * bone_name );
637 int ( * Create_3D_Sound_At_Bone )(
const char * sound_preset_name, GameObject * obj,
const char * bone_name );
638 int ( * Create_Logical_Sound )( GameObject * creator,
int type,
const Vector3 & position,
float radius );
639 void ( * Start_Sound )(
int sound_id );
640 void ( * Stop_Sound )(
int sound_id,
bool destroy_sound);
641 void ( * Monitor_Sound )( GameObject * game_obj,
int sound_id );
642 void ( * Set_Background_Music )(
const char * wav_filename );
643 void ( * Fade_Background_Music )(
const char * wav_filename,
int fade_out_time,
int fade_in_time );
644 void ( * Stop_Background_Music )( void );
645 float ( * Get_Health )( GameObject * obj );
646 float ( * Get_Max_Health )( GameObject * obj );
647 void ( * Set_Health )( GameObject * obj,
float health );
648 float ( * Get_Shield_Strength )( GameObject * obj );
649 float ( * Get_Max_Shield_Strength )( GameObject * obj );
650 void ( * Set_Shield_Strength )( GameObject * obj,
float strength );
651 void ( * Set_Shield_Type )( GameObject * obj,
const char * name );
652 int ( * Get_Player_Type )( GameObject * obj );
653 void ( * Set_Player_Type )( GameObject * obj,
int type );
654 float ( * Get_Distance )(
const Vector3 & p1,
const Vector3 & p2 );
655 void ( * Set_Camera_Host )( GameObject * obj );
656 void ( * Force_Camera_Look )(
const Vector3 & target );
657 GameObject * ( * Get_The_Star )( void );
658 GameObject * ( * Get_A_Star )(
const Vector3 & pos );
659 GameObject * ( * Find_Closest_Soldier )(
const Vector3 & pos,
float min_dist,
float max_dist,
bool only_human);
660 bool ( * Is_A_Star )( GameObject * obj );
661 void ( * Control_Enable )( GameObject * obj,
bool enable );
662 const char * ( * Get_Damage_Bone_Name )( void );
663 bool ( * Get_Damage_Bone_Direction )( void );
664 bool ( * Is_Object_Visible)( GameObject * looker, GameObject * obj );
665 void ( * Enable_Enemy_Seen)( GameObject * obj,
bool enable);
666 void (* Set_Display_Color )(
unsigned char red,
unsigned char green,
unsigned char blue);
667 void (* Display_Text )(
int string_id );
668 void (* Display_Float )(
float value,
const char * format);
669 void (* Display_Int )(
int value,
const char * format);
670 void (* Save_Data )( ScriptSaver & saver,
int id,
int size,
void * data );
671 void (* Save_Pointer )( ScriptSaver & saver,
int id,
void * pointer );
672 bool (* Load_Begin )( ScriptLoader & loader,
int * id );
673 void (* Load_Data )( ScriptLoader & loader,
int size,
void * data );
674 void (* Load_Pointer )( ScriptLoader & loader,
void ** pointer );
675 void (* Load_End )( ScriptLoader & loader );
676 void (*Begin_Chunk)(ScriptSaver& saver,
unsigned int chunkID);
677 void (*End_Chunk)(ScriptSaver& saver);
678 bool (*Open_Chunk)(ScriptLoader& loader,
unsigned int* chunkID);
679 void (*Close_Chunk)(ScriptLoader& loader);
680 void (* Clear_Radar_Markers )( void );
681 void (* Clear_Radar_Marker )(
int id );
682 void (* Add_Radar_Marker )(
int id,
const Vector3& position,
int shape_type,
int color_type );
683 void (* Set_Obj_Radar_Blip_Shape )( GameObject * obj,
int shape_type );
684 void (* Set_Obj_Radar_Blip_Color )( GameObject * obj,
int color_type );
685 void (* Enable_Radar )(
bool enable );
686 void (* Clear_Map_Cell )(
int cell_x,
int cell_y );
687 void (* Clear_Map_Cell_By_Pos )(
const Vector3 &world_space_pos );
688 void (* Clear_Map_Cell_By_Pixel_Pos )(
int pixel_pos_x,
int pixel_pos_y );
689 void (* Clear_Map_Region_By_Pos )(
const Vector3 &world_space_pos,
int pixel_radius );
690 void (* Reveal_Map )( void );
691 void (* Shroud_Map )( void );
692 void (* Show_Player_Map_Marker )(
bool onoff );
693 float (* Get_Safe_Flight_Height )(
float x_pos,
float y_pos );
694 void (* Create_Explosion )(
const char * explosion_def_name,
const Vector3 & pos, GameObject * creator);
695 void (* Create_Explosion_At_Bone )(
const char * explosion_def_name, GameObject * object,
const char * bone_name, GameObject * creator);
696 void (* Enable_HUD )(
bool enable );
697 void (* Mission_Complete )(
bool success );
698 void (* Give_PowerUp )( GameObject * obj,
const char * preset_name,
bool display_on_hud);
699 void (*Innate_Disable)(GameObject* object);
700 void (*Innate_Enable)(GameObject* object);
701 bool (* Innate_Soldier_Enable_Enemy_Seen )( GameObject * obj,
bool state );
702 bool (* Innate_Soldier_Enable_Gunshot_Heard )( GameObject * obj,
bool state );
703 bool (* Innate_Soldier_Enable_Footsteps_Heard )( GameObject * obj,
bool state );
704 bool (* Innate_Soldier_Enable_Bullet_Heard )( GameObject * obj,
bool state );
705 bool (* Innate_Soldier_Enable_Actions )( GameObject * obj,
bool state );
706 void (* Set_Innate_Soldier_Home_Location )( GameObject * obj,
const Vector3& home_pos,
float home_radius);
707 void (* Set_Innate_Aggressiveness )( GameObject * obj,
float aggressiveness );
708 void (* Set_Innate_Take_Cover_Probability )( GameObject * obj,
float probability );
709 void (* Set_Innate_Is_Stationary )( GameObject * obj,
bool stationary );
710 void (* Innate_Force_State_Bullet_Heard )( GameObject * obj,
const Vector3 & pos );
711 void (* Innate_Force_State_Footsteps_Heard )( GameObject * obj,
const Vector3 & pos );
712 void (* Innate_Force_State_Gunshots_Heard )( GameObject * obj,
const Vector3 & pos );
713 void (* Innate_Force_State_Enemy_Seen )( GameObject * obj, GameObject * enemy );
714 void (* Static_Anim_Phys_Goto_Frame )(
int obj_id,
float frame,
const char * anim_name);
715 void (* Static_Anim_Phys_Goto_Last_Frame )(
int obj_id,
const char * anim_name);
716 unsigned int (* Get_Sync_Time)( void );
717 void (* Add_Objective)(
int id,
int type,
int status,
int short_description_id,
char * description_sound_filename,
int long_description_id);
718 void (* Remove_Objective)(
int id );
719 void (* Set_Objective_Status)(
int id,
int status );
720 void (* Change_Objective_Type)(
int id,
int type );
721 void (* Set_Objective_Radar_Blip)(
int id,
const Vector3 & position );
722 void (* Set_Objective_Radar_Blip_Object)(
int id, ScriptableGameObj * unit );
723 void (* Set_Objective_HUD_Info)(
int id,
float priority,
const char * texture_name,
int message_id );
724 void (* Set_Objective_HUD_Info_Position)(
int id,
float priority,
const char * texture_name,
int message_id,
const Vector3 & position );
725 void (* Shake_Camera)(
const Vector3 & pos,
float radius,
float intensity,
float duration);
726 void (* Enable_Spawner)(
int id,
bool enable );
727 GameObject * (* Trigger_Spawner)(
int id );
728 void (* Enable_Engine)( GameObject* object,
bool onoff );
729 int (* Get_Difficulty_Level)( void );
730 void (* Grant_Key)( GameObject* object,
int key,
bool grant);
731 bool (* Has_Key)( GameObject* object,
int key );
732 void (* Enable_Hibernation)( GameObject * object,
bool enable );
733 void (* Attach_To_Object_Bone)( GameObject * object, GameObject * host_object,
const char * bone_name );
734 int (* Create_Conversation)(
const char *conversation_name,
int priority,
float max_dist,
bool is_interruptable);
735 void (* Join_Conversation)( GameObject * object,
int active_conversation_id,
bool allow_move,
bool allow_head_turn,
bool allow_face);
736 void (* Join_Conversation_Facing)( GameObject * object,
int active_conversation_id,
int obj_id_to_face );
737 void (* Start_Conversation)(
int active_conversation_id,
int ActionID);
738 void (* Monitor_Conversation)( GameObject * object,
int active_conversation_id );
739 void (* Start_Random_Conversation)( GameObject * object );
740 void (* Stop_Conversation)(
int active_conversation_id );
741 void (* Stop_All_Conversations)( void );
742 void (* Lock_Soldier_Facing)( GameObject * object, GameObject * object_to_face,
bool turn_body );
743 void (* Unlock_Soldier_Facing)( GameObject * object );
744 void (* Apply_Damage)( GameObject * object,
float amount,
const char * warhead_name, GameObject * damager);
745 void (* Set_Loiters_Allowed)( GameObject * object,
bool allowed );
746 void (* Set_Is_Visible)( GameObject * object,
bool visible );
747 void (* Set_Is_Rendered)( GameObject * object,
bool rendered );
748 float (* Get_Points)( GameObject * object );
749 void (* Give_Points)( GameObject * object,
float points,
bool entire_team );
750 float (* Get_Money)( GameObject * object );
751 void (* Give_Money)( GameObject * object,
float money,
bool entire_team );
752 bool (* Get_Building_Power)( GameObject * object );
753 void (* Set_Building_Power)( GameObject * object,
bool onoff );
754 void (* Play_Building_Announcement)( GameObject * object,
int text_id );
755 GameObject * (* Find_Nearest_Building_To_Pos )(
const Vector3 & position,
const char * mesh_prefix );
756 GameObject * (* Find_Nearest_Building )( GameObject * object,
const char * mesh_prefix );
757 int (* Team_Members_In_Zone)( GameObject * object,
int player_type );
758 void (*Set_Clouds) (
float cloudcover,
float cloudgloominess,
float ramptime);
759 void (*Set_Lightning) (
float intensity,
float startdistance,
float enddistance,
float heading,
float distribution,
float ramptime);
760 void (*Set_War_Blitz) (
float intensity,
float startdistance,
float enddistance,
float heading,
float distribution,
float ramptime);
761 void (*Set_Wind) (
float heading,
float speed,
float variability,
float ramptime);
762 void (*Set_Rain) (
float density,
float ramptime,
bool prime);
763 void (*Set_Snow) (
float density,
float ramptime,
bool prime);
764 void (*Set_Ash) (
float density,
float ramptime,
bool prime);
765 void (*Set_Fog_Enable) (
bool enabled);
766 void (*Set_Fog_Range) (
float startdistance,
float enddistance,
float ramptime);
767 void (*Enable_Stealth) (GameObject * object,
bool onoff);
768 void (*Cinematic_Sniper_Control) (
bool enabled,
float zoom);
769 int (*Text_File_Open) (
const char * filename );
770 bool (*Text_File_Get_String) (
int handle,
char * buffer,
int size );
771 void (*Text_File_Close) (
int handle );
772 void (*Enable_Vehicle_Transitions) ( GameObject * object,
bool enable );
773 void (*Display_GDI_Player_Terminal) ();
774 void (*Display_NOD_Player_Terminal) ();
775 void (*Display_Mutant_Player_Terminal) ();
776 bool (*Reveal_Encyclopedia_Character) (
int object_id );
777 bool (*Reveal_Encyclopedia_Weapon) (
int object_id );
778 bool (*Reveal_Encyclopedia_Vehicle) (
int object_id );
779 bool (*Reveal_Encyclopedia_Building) (
int object_id );
780 void (*Display_Encyclopedia_Event_UI) ( void );
781 void (* Scale_AI_Awareness)(
float sight_scale,
float hearing_scale );
782 void (* Enable_Cinematic_Freeze)( GameObject * object,
bool enable );
783 void (* Expire_Powerup )( GameObject * object );
784 void (* Set_HUD_Help_Text )(
int string_id,
const Vector3 &color );
785 void (* Enable_HUD_Pokable_Indicator )( GameObject * object,
bool enable );
786 void (* Enable_Innate_Conversations )( GameObject * object,
bool enable );
787 void (* Display_Health_Bar )( GameObject * object,
bool display );
788 void (* Enable_Shadow) ( GameObject * object,
bool enable );
789 void (* Clear_Weapons) ( GameObject * object );
790 void (* Set_Num_Tertiary_Objectives) (
int count );
791 void (* Enable_Letterbox) (
bool onoff,
float seconds );
792 void (* Set_Screen_Fade_Color) (
float r,
float g,
float b,
float seconds );
793 void (* Set_Screen_Fade_Opacity) (
float opacity,
float seconds );
796class ScriptCommandsClass {
798 ScriptCommands *Commands;
800extern SCRIPTS_API ScriptCommands* Commands;