Vietcong Scripting

Version 0.96

INTRODUCTION.. 16

BASICS OF THE SCRIPTS.. 17

What are the scripts?. 17

Basic overview of the PteroEngine. 17

PteroEngine entities. 17

Execution of the scripts. 18

Types of the scripts. 18

Coordination of the scripts and communication between them.. 19

Adding the scripts to the game. 19

Writing your own scripts. 20

Include files and headers. 20

Using the script compiler. 21

Using the ingame debugger. 22

Directory structure.. 22

G.. 22

INI 22

LEVELS.. 23

SND.. 23

Addon (mod) creation.. 23

Multiplayer map definition.. 24

Overview of the Artificial Intelligence in the PteroEngineII 25

Path finding. 25

Script AI 25

Battle AI 25

Battle AI in the peace mode. 25

Stealth mode. 26

Sides and groups. 26

Game global variables.. 26

Game texts and speech.. 26

The Level Script.. 27

Overview.. 27

Level script messages. 28

SC_LEV_MES_ INITSCENE  - Scene initialization. 28

SC_LEV_MES_RELEASE SCENE - Scene Release. 28

SC_LEV_MES_JUSTLOADED - After the game load. 28

SC_LEV_MES_TIME – Time Tick. 28

SC_LEV_MES_RADIOUSED - Usage of the Radio. 29

SC_LEV_MES_SPEACHDONE - Speech Finished. 29

SC_LEV_MES_VIEWANIMCALLBACK - View Animation finished. 29

SC_LEV_MES_EVENT - Message Sent by Other Script 29

SC_LEV_MES_POINTINTERACT - Interaction with the Pointman. 29

SC_LEV_MES_POINTINTERACTINFO - Getting Information About the Pointman Status. 30

SC_LEV_MES_ARTILLERY - Artillery Usage. 30

SC_LEV_MES_MUSICDONE - After Finishing the Music. 30

SC_LEV_MES_GETMUSIC - Command From the Music System.. 30

SC_LEV_MES_STORYSKIP - After Pressing Story Skip Button. 30

SC_LEV_MES_LIGHTSTICK_USED - After Light Stick Usage. 30

Initialization of the game sides and groups. 30

Setting the follow order. 31

Saving the game. 31

Objectives. 32

The Player Script.. 32

Overview.. 32

Player script messages. 32

SC_P_MES_TIME – time tick. 32

SC_P_MES_HIT – player was hit 33

SC_P_MES_KILLED      - player was killed. 33

SC_P_MES_EVENT      - received message from other script 33

SC_P_MES_DOANIMEND – player finished playing the animation. 33

SC_P_MES_INTERACT_GETTEXT – human player is pointing at the player 33

SC_P_MES_INTERACT_DO – human player is using the interaction. 34

SC_P_MES_DROPOUTCAR – player fell out of the car 34

SC_P_MES_SHOTAROUNDCALLBACK – some one is shooting around the player 34

SC_P_MES_GOTOPC – player is sent to the human character 34

Creating the player. 34

Various player scripts. 35

The Dynamic Object Script.. 35

Overview.. 35

Script messages. 36

SC_OBJ_INFO_EVENT_INIT – object initializing. 36

SC_OBJ_INFO_EVENT_RELEASE – object releasing. 36

SC_OBJ_INFO_EVENT_JUSTLOADED – saved game loaded. 36

SC_OBJ_INFO_EVENT_DOTICK – time tick. 36

SC_OBJ_INFO_EVENT_HIT – object hit 36

SC_OBJ_INFO_EVENT_SET – MP synchronization. 36

SC_OBJ_INFO_EVENT_USED – object used. 37

SC_OBJ_INFO_EVENT_MOUNTEDSHOT – mounted weapon shooting. 37

Moving the object 37

Hiding the object 37

Animating the object 38

Destroying the object 38

Using the object 38

Specific types of the dynamic scripts. 39

Car scripts. 39

Ship scripts. 39

Helicopter scripts. 39

Mounted weapons scripts. 40

The Sound Script.. 40

The Weapon Script.. 40

FPV script 40

SC_WEAP_EVENTTYPE_INIT – initialization of the gun. 41

SC_WEAP_EVENTTYPE_RELEASE – release of the gun. 41

SC_WEAP_EVENTTYPE_SET – timetick. 41

SC_WEAP_EVENTTYPE_VALIDATEANIM – anim. Validation. 41

SC_WEAP_EVENTTYPE_GETANIMTIME – getting animation time. 41

3PV Script 41

SC_WEAP3PV_EVENTTYPE_INIT – init of the weapon. 41

SC_WEAP3PV_EVENTTYPE_SHOT – weapon has shot 41

SC_WEAP3PV_EVENTTYPE_RELOAD – weapon is being reloaded. 41

SC_WEAP3PV_EVENTTYPE_SETBAYONET – change bayonet 41

The Multiplayer Script.. 42

Overview.. 42

Multiplayer script messages. 42

SC_NET_MES_LEVELINIT.. 42

SC_NET_MES_RENDERHUD.. 42

SC_NET_MES_SERVER_TICK.. 43

SC_NET_MES_CLIENT_TICK.. 43

SC_NET_MES_SERVER_RECOVER_TIME. 43

SC_NET_MES_SERVER_RECOVER_PLACE. 43

SC_NET_MES_SERVER_KILL. 43

SC_NET_MES_MESSAGE. 43

SC_NET_MES_LEVELPREINIT.. 44

SC_NET_MES_RESTARTMAP. 44

SC_NET_MES_RULESCHANGED.. 44

The Script Helpers.. 44

Overview.. 44

Script helper messages. 44

SC_SCRHELPER_EVENTTYPE_INIT – initialization of the helper 44

SC_SCRHELPER_EVENTTYPE_RELEASE – release of the helper 44

SC_SCRHELPER_EVENTTYPE_TIMETICK – time tick of the helper 45

The Unipage Scripts.. 45

Handling various situations and scripts.. 45

Handling the speech. 45

Working with the music. 46

Working with the view animation. 46

Radio communication. 47

Working with the particles. 48

Working with the sound. 48

Working with the players. 49

How to get information about the players. 49

Player animations. 50

Changing the AI settings. 50

How to make AI do something?. 51

Players and vehicles. 52

Adding special equipment to players. 52

Waypoint blockers. 52

Working with the pointman. 53

Creating single player missions.. 55

Creating campaign.. 55

Campaign txt format 55

Creating Multiplayer missions.. 56

Level Script for the MP missions. 56

Multiplayer script 56

Multiplayer script – messages for both server and client machines. 56

Multiplayer script – server messages. 57

Dynamic objects in the MP. 58

Using AI in the MP. 58

Finishing the level 59

Description of all types, structures and functions in the Vietcong   59

Structures – for various 3d data. 59

c_Vector3 – 3D information data. 59

s_sphere – 3D sphere data. 59

Structures – script info structures. 59

Structure s_SC_L_info – level script 59

Structure s_SC_P_info – player script 61

Structure s_SC_SOUND_info – sound script 62

Structure s_SC_ScriptHelper_info – script helper script 63

Structure s_SC_OBJ_info – dynamic object script 63

Structure s_SC_NET_info – network script 64

Structure s_SC_WEAP_info – weapon fpv script 66

Structure s_SC_WEAP3pv_info – weapon 3pv script 66

Structures – player data structures. 67

Structure s_SC_P_Create. 67

Structure s_SC_P_CreateEqp. 68

Structure s_SC_P_SpecAnims. 69

Structure s_SC_P_intel 69

Structure s_SC_P_getinfo. 69

Structures – AI data. 70

Structure s_SC_P_AI_props. 70

Structure s_SC_P_Ai_BattleProps. 72

Structure s_SC_P_Ai_Grenade. 72

Structure s_SC_Ai_PlFollow.. 72

Structures – dynamic object structures. 73

Structure s_SC_OBJ_dynamic. 73

Structure s_SC_NOD_transform.. 73

Structure s_SC_Car_Init 73

Structure s_SC_Car_AddWheel 74

Structure s_SC_Car_AddEntry. 75

Structure s_SC_Ship_Init 75

Structure s_SC_PHS_IWantToFloat 76

Structure s_SC_Heli_Init 77

Structure s_SC_MWP_Create. 77

Structures – multiplayer data. 78

Structure s_SC_MP_EnumPlayers. 78

Structure s_SC_MP_Recover 78

Structure s_SC_MP_hud. 79

Structure s_SC_HUD_MP_icon. 80

Structure s_SC_MP_SRV_settings. 80

Structure s_SC_MP_SRV_AtgSettings. 81

Structures – various data structures. 81

Structure s_SC_systime. 81

Structure s_SC_FpvMapSign. 81

Structure s_SC_HUD_TextWrite. 82

Structure s_SC_Objective. 82

Structure s_SC_initside. 83

Structure s_SC_initgroup. 83

Structure s_SC_SpeachBreakProps. 83

Structure s_SC_MissionSave. 83

Structure s_SC_DebriefInfo. 84

Structure s_SC_light 84

Structure s_MusicDef 85

Structure s_SC_BombInfo. 85

Structure s_SC_FlyOffCartridge. 86

Functions – basic. 86

int sprintf(char *, const char *, ...); 86

int swprintf(ushort *, ushort*, ...); 86

int rand(void); 86

float frnd(float max); 86

float sqrt(float val); 86

float fmod(float a, float b); 86

float sin(float a); 87

float cos(float a); 87

float atan2(float y, float x); 87

ushort* SC_Wtxt(dword val); 87

BOOL SC_StringSame(char *a, char *b); 87

void SC_ZeroMem(void *ptr, dword size); 87

float SC_GetLineDist(c_Vector3 *pos, c_Vector3 *line_a, c_Vector3 *line_b); 87

float SC_GetLineDistXY(c_Vector3 *pos, c_Vector3 *line_a, c_Vector3 *line_b); 87

BOOL SC_IsNear2D(c_Vector3 *a, c_Vector3 *b, float dist); 87

BOOL SC_IsNear3D(c_Vector3 *a, c_Vector3 *b, float dist); 87

float SC_2VectorsDist(c_Vector3 *a, c_Vector3 *b); 87

float SC_VectorLen(c_Vector3 *vec); 88

float SC_VectorLen2(c_Vector3 *vec); 88

BOOL SC_SphereIsVisible(s_sphere *sph); 88

void SC_GetPos_VecRz(void *cpos, c_Vector3 *pos, float *rz); 88

ushort *SC_AnsiToUni(char *src, ushort *dest); 88

Functions  - the debug functions. 88

void SC_message(char *txt,...); 88

void SC_Log(dword level, char *txt, ...); 88

void SC_Osi(char *txt,...); 88

BOOL SC_KeyJustPressed(dword id); 88

BOOL SC_KeyPressed(dword id); 88

Functions – global variables. 88

void SC_sgi(dword id, int a); 88

int SC_ggi(dword id); 89

void SC_sgf(dword id, float a); 89

float SC_ggf(dword id); 89

void SC_MP_Gvar_SetSynchro(dword id); 89

Functions for the sound handling. 89

void SC_SND_MusicPlay(dword MusicID, dword StartVolume ); 89

void SC_SND_PlayMusic(dword music_id); 89

void SC_SND_MusicStop(dword MusicID ); 89

void SC_SND_MusicStopFade(dword MusicID, dword Time ); 89

void SC_SND_MusicFadeVolume(dword MusicID, dword Volume, dword Time ); 89

dword SC_AGS_Set(dword val); 89

BOOL SC_SND_SetEnvironment(dword env1_id, dword env2_id, float env_ratio); 89

void SC_SND_Ambient_Play(dword snd_id); 89

void SC_SND_Ambient_Stop(void); 90

void SC_SND_SetHearableRatio(float Ratio); 90

void SC_SND_CreateCurveSound(char *anm_filename, dword snd_id, float max_play_dist, BOOL apply_env_volume); 90

void SC_FadeSoundPlayer(dword snd_player_id, float final_volume, float fade_time); 90

float SC_SND_GetSoundLen(dword snd_id); 90

void SC_SND_PlaySound3D(dword snd_id, c_Vector3 *pos); 90

void SC_SND_PlaySound3Dex(dword snd_id, c_Vector3 *pos, float *timeout); 90

void SC_SND_PlaySound2D(dword snd_id); 90

void SC_SND_PlaySound3Dlink(dword snd_id, void *nod, float *timeout); 91

void SC_SND_PlaySound3Dpl(dword snd_id, dword pl_id, dword flags); 91

void SC_SND_PlaySound3DSpec(dword snd_id, c_Vector3 *pos, dword spec_id); 91

void SC_SND_PlaySound3DexSpec(dword snd_id, c_Vector3 *pos, float *timeout, dword spec_id); 91

void SC_SND_PlaySound2DSpec(dword snd_id, dword spec_id); 91

Functions for the objects. 92

void *SC_NOD_Get(void *master_obj, char *obj_name); 92

void *SC_NOD_GetNoMessage(void *master_obj, char *obj_name); 92

void *SC_NOD_GetNoMessage_Entity(char *obj_name); 92

void SC_NOD_GetTransform(void *obj,s_SC_NOD_transform *trans); 92

void SC_NOD_SetTransform(void *obj,s_SC_NOD_transform *trans); 92

void SC_NOD_Hide(void *obj, BOOL hide); 92

void SC_NOD_GetPosInOtherSpace(void *other_nod, void *nod, c_Vector3 *vec); 92

void SC_DUMMY_Set_DoNotRenHier(char *dummy_name, BOOL do_not_render_hiearchy); 92

void SC_DUMMY_Set_DoNotRenHier2(void *nod, BOOL do_not_render_hiearchy); 92

void SC_EnableObjectScriptWhileUnipage(void *master_nod, BOOL enable); 93

char *SC_NOD_GetName(void *nod); 93

void SC_NOD_GetPivotWorld(void *nod,c_Vector3 *vec); 93

void SC_NOD_GetWorldPos(void *nod, c_Vector3 *pos); 93

float SC_NOD_GetWorldRotZ(void *nod); 93

BOOL SC_NOD_GetCollision(void *master_nod, char *name, BOOL clear_it); 93

BOOL SC_NOD_GetCollision2(void *nod, BOOL clear_it); 93

void SC_NOD_GetDummySph(void *master_nod, char *dummy_name, s_sphere *sph); 93

Functions for the dynamic objects. 93

void SC_NOD_SetDSTR(void *nod, char *obj_name, char *dstr_name); 93

void SC_NOD_ResetDSTR(void *nod, char *obj_name); 94

float SC_DOBJ_CameraLooksAt(void *nod, float max_dist); 94

float SC_DOBJ_CameraLooksAtCollision(void *nod, float max_dist); 94

void SC_ACTIVE_Add(void *nod, float cur_dist, dword info_txt); 94

void SC_DOBJ_SetFrozenFlag(void *nod, BOOL frozen); 94

void SC_NOD_AddDynamic(void *master_nod, char *name, s_SC_OBJ_dynamic *info); 94

BOOL SC_DOBJ_IsBurning(void *nod, float perc); 94

BOOL SC_DOBJ_IsBurning2(void *nod); 94

void SC_DOBJ_StopBurning(void *nod, BOOL enable_future_burning); 94

void SC_DOBJ_ClearDamagedHP(void *nod); 95

void SC_DOBJ_BurnCreateBlockers(void *nod, s_sphere *sph, dword items); 95

Functions for the objects – animations. 95

dword SC_MANM_Create(char *filename); 95

void SC_MANM_Release(dword manm_id); 95

dword SC_MANM_GetIndex(dword manm_id, char *objname); 95

void SC_MANM_Set(dword manm_id, dword manm_index, void *nod, float time); 95

float SC_MANM_GetLength(dword manm_id, dword manm_index); 95

Functions for the view animations. 96

void SC_SetViewAnim(char *anm_name, dword start_frame, dword end_frame, dword callback_id); 96

void SC_SetViewAnimEx(char *anm_name, dword start_frame, dword end_frame, dword callback_id, void *nod); 96

void SC_NOD_SetFromANM(char *anm, float time, void *nod); 96

float SC_ANM_GetFrameTime(char *anm, int frame); 96

BOOL SC_NOD_GetPosFromANM(char *anm, float time, c_Vector3 *pos); 96

Functions for the vehicles. 96

void *SC_CAR_Create(void *nod, s_SC_Car_Init *info); 96

void SC_CAR_WheelAdd(void *car, void *nod, s_SC_Car_AddWheel *info); 96

void SC_CAR_EntryAdd(void *car, s_SC_Car_AddEntry *info); 97

void SC_CAR_SetAirResistance(void *car, float a0, float a1, float a2); 97

void *SC_SHIP_Create(void *nod, s_SC_Ship_Init *info, s_SC_PHS_IWantToFloat *finfo); 97

void SC_SHIP_EntryAdd(void *ship, s_SC_Car_AddEntry *info); 97

void *SC_HELI_Create(void *nod, s_SC_Heli_Init *info); 97

void SC_HELI_EntryAdd(void *heli, s_SC_Car_AddEntry *info); 97

void SC_HELI_ChangeEntryStativ(void *heli, dword entry_index, char *stg_name); 97

Functions for the weapons. 97

void SC_FPV_FlyOffCartridge(s_SC_FlyOffCartridge *info); 97

dword SC_MWP_Create(s_SC_MWP_Create *info); 97

void SC_FPV_AttachMagazine(BOOL render); 98

Functions for the visual effects. 98

void SC_EventImpuls(char *ev_name); 98

void SC_EventEnable(char *ev_name, BOOL enable); 98

void SC_SetMissileTrace(dword color, float alpha); 98

void SC_CreatePtc(dword id, c_Vector3 *vec); 98

void SC_CreatePtc_Ext(dword id, void *nod, float time, float interval, float scale, float time_mult); 98

void SC_CreatePtcVec_Ext(dword id, c_Vector3 *vec, float time, float interval, float scale, float time_mult); 98

void SC_CreatePtcInNodSpace_Ext(dword id, void *nod, float time, float interval, float scale, float time_mult); 98

void SC_Fnt_Write(float x, float y, char *txt, float scale, dword color); 98

float SC_Fnt_GetWidth(char *txt, float scale); 98

void SC_Fnt_WriteW(float x, float y, ushort *txt, float scale, dword color); 99

float SC_Fnt_GetWidthW(ushort *txt, float scale); 99

void SC_GetScreenRes(float *width, float *height); 99

void SC_SetSceneVisibilityMult(float vis_mult, float scene_fog_mult, float bckg_fog_mult); 99

void SC_FadeTo(BOOL black, float time); 99

void SC_SwitchSceneSCS(char *fname, float time); 99

void SC_SetMovieBorders(BOOL set_on); 99

void SC_EnableBloodWhenHit(BOOL enable); 99

void SC_CreateLight(s_SC_light *info); 99

void SC_EnableCharacterLOD(BOOL enable); 99

void SC_GetCameraPos(c_Vector3 *vec); 100

Functions for handling the items. 100

dword SC_Item_Create(dword id, c_Vector3 *vec); 100

dword SC_Item_Create2(dword id, c_Vector3 *vec, c_Vector3 *movdir); 100

void SC_Item_Preload(dword id); 100

BOOL SC_Item_GetPos(dword netid, c_Vector3 *pos); 100

dword SC_Item_Find(dword item_type); 100

void SC_RemoveItems(s_sphere *area, dword item_type); 100

Function for handling the waypoints. 100

BOOL SC_GetWp(char *wpname, c_Vector3 *vec); 100

BOOL SC_GetRndWp(s_sphere *sph, c_Vector3 *wp); 100

void SC_ClearImpossibleWayTargets(void); 101

Functions for handling the players. 101

void SC_InitSide(dword id, s_SC_initside *init); 101

void SC_SetSideAlly(dword s1, dword s2, float status); 101

void SC_InitSideGroup(s_SC_initgroup *info); 101

dword SC_P_Create(s_SC_P_Create *info); 101

void SC_P_ScriptMessage(dword pl_id, dword param1, dword param2); 101

void SC_P_DoKill(dword pl_id); 101

void SC_P_DoAnim(dword pl_id, char *filename); 101

void SC_P_DoAnimLooped(dword pl_id, char *filename); 101

void SC_P_Recover(dword pl_id, c_Vector3 *pos, float rz); 102

void SC_P_Recover2(dword pl_id, c_Vector3 *pos, float rz, dword phase); 102

void SC_P_Release(dword pl_id); 102

Functions for getting the info about players. 102

dword SC_GetGroupPlayers(dword side, dword group); 102

void SC_GetPls(s_sphere *sph, dword *list, dword *items); 102

void SC_GetPlsInLine(c_Vector3 *pos, c_Vector3 *dir, dword *list, dword *items); 102

char *SC_P_GetName(dword pl_id); 102

BOOL SC_P_GetActive(dword pl_id); 102

BOOL SC_P_IsReady(dword pl_id); 102

void SC_P_GetPos(dword pl_id, c_Vector3 *pos); 102

float SC_P_GetRot(dword pl_id); 103

void SC_P_GetHeadPos(dword pl_id, c_Vector3 *pos); 103

void SC_P_GetDir(dword pl_id, c_Vector3 *dir); 103

void SC_P_GetInfo(dword pl_id, s_SC_P_getinfo *info); 103

dword SC_GetNearestPlayer(c_Vector3 *vec, float *dist); 103

dword SC_P_GetBySideGroupMember(dword iside, dword igroup, dword imember); 103

float SC_P_GetPhase(dword pl_id); 103

float SC_P_GetDistance(dword pl_id, dword to_pl_id); 103

void SC_P_WriteHealthToGlobalVar(dword pl_id, dword first_gvar); 103

BOOL SC_P_IsInSpecStativ(dword pl_id); 103

BOOL SC_P_UsesBinocular(dword pl_id); 103

Functions for changing the parameters of players. 104

void SC_P_ChangeSideGroupMemId(dword pl_id, dword side, dword group, dword mem_id); 104

void SC_P_SetForceClassName(dword pl_id, dword name_nr); 104

void SC_P_SetPos(dword pl_id, c_Vector3 *pos); 104

void SC_P_SetRot(dword pl_id, float rz); 104

void SC_P_AddAttObj(dword pl_id, char *bes_name, char *eqp_name); 104

void SC_P_SetHp(dword pl_id, float hp); 104

void SC_P_Heal(dword pl_id); 104

void SC_P_SetActive(dword pl_id, BOOL active); 104

void SC_P_EnableLonelyWolfKiller(dword pl_id, float distance); 105

void SC_P_SetFaceStatus(dword pl_id, dword face_type, float time); 105

void SC_P_SetHandVariation(dword pl_id, dword hand_id, dword variation, float time); 105

void SC_P_Link3pvEqp(dword pl_id, dword slot_id, dword plb_id, char *eqp_name); 105

void SC_P_UnLink3pvEqp(dword pl_id, dword slot_id); 105

void SC_P_SetSpecAnims(dword pl_id, s_SC_P_SpecAnims *info); 105

void SC_P_SetPhase(dword pl_id, dword phase); 105

void SC_P_DoHit(dword pl_id, dword area_id, float hp); 105

void SC_P_SetRadarColor(dword pl_id, dword val); 106

void SC_P_CloseEyes(dword pl_id, BOOL force_close); 106

void SC_P_EnableBinocular(dword pl_id, BOOL enable); 106

void SC_P_EnableHeadEqpFlyOff(dword pl_id, BOOL enable); 106

void SC_P_EnableHitAnimations(dword pl_id, BOOL enable); 106

void SC_P_ReadHealthFromGlobalVar(dword pl_id, dword first_gvar); 106

void SC_P_SetLinkedView(dword pl_id, float rz, float rx); 106

Functions for players and weapons. 106

BOOL SC_P_GetWeapons(dword pl_id, s_SC_P_Create *info); 106

BOOL SC_P_HasWeapon(dword pl_id, dword weap_type); 106

BOOL SC_P_GetHasShoot(dword pl_id); 106

dword SC_P_GetCurWeap(dword pl_id); 106

void SC_P_AddAllAmmo(dword pl_id); 107

void SC_P_AddAmmoNoGrenade(dword pl_id); 107

void SC_P_ChangeWeapon(dword pl_id, dword slot_id, dword weap_type); 107

void SC_P_SetSelWeapon(dword pl_id, dword slot_id); 107

void SC_P_SetNoAmmo(dword pl_id); 107

void SC_P_SetAmmo(dword pl_id, dword ammo_type, dword amount); 107

void SC_P_WriteAmmoToGlobalVar(dword pl_id, dword first_gvar, dword last_gvar); 107

void SC_P_ReadAmmoFromGlobalVar(dword pl_id, dword first_gvar, dword last_gvar); 107

dword SC_P_GetAmmoInWeap(dword pl_id, dword slot_id); 107

void SC_P_SetAmmoInWeap(dword pl_id, dword slot_id, dword ammo); 107

Functions for the player – vehicle interaction. 108

dword SC_P_IsInCar(dword pl_id); 108

dword SC_P_IsInCarEx(dword pl_id, dword *entry_index); 108

dword SC_P_IsInHeli(dword pl_id); 108

dword SC_P_IsInShip(dword pl_id); 108

void SC_P_SetToHeli(dword pl_id, char *heli_name, dword entry_index); 108

void SC_P_ExitHeli(dword pl_id, c_Vector3 *new_pos); 108

void SC_P_SetToShip(dword pl_id, char *ship_name, dword entry_index); 108

void SC_P_ExitShip(dword pl_id, c_Vector3 *new_pos); 108

void SC_P_SetToCar(dword pl_id, char *car_name, dword entry_index); 109

void SC_P_SetToSceneMwp(dword pl_id, char *mwp_name); 109

void SC_P_ExitSceneMwp(dword pl_id); 109

Functions for handling the human PC directly. 109

dword SC_PC_Get(void); 109

BOOL SC_PC_GetPos(c_Vector3 *pos); 109

void SC_PC_SetControl(BOOL user_control); 109

void SC_PC_EnableMovementAndLooking(BOOL enable); 109

void SC_PC_EnableMovement(BOOL enable); 109

void SC_PC_EnablePronePosition(BOOL enable); 109

void SC_PC_EnableWeaponsUsing(BOOL enable); 109

void SC_PC_EnableExit(BOOL enable); 110

void SC_PC_EnableEnter(BOOL enable); 110

float SC_PC_PlayFpvAnim(char *filename); 110

float SC_PC_PlayFpvAnim2(char *filename, dword plb_id, char *eqp, char *anm); 110

void SC_PC_PlayFpvLooped(char *filename); 110

void SC_PC_EnableFlashLight(BOOL enable); 110

void SC_PC_EnableHitByAllies(BOOL enable); 110

void SC_PC_EnablePickup(BOOL enable); 110

void SC_PC_SetIntel(s_SC_P_intel *info); 110

void SC_PC_GetIntel(s_SC_P_intel *info); 110

float SC_GetPCZoom(void); 110

Functions for handling the group AI 111

void SC_Ai_SetPlFollow(dword side, dword group, dword mode, s_SC_Ai_PlFollow *follow, dword *follow_order, dword *point_order, dword players); 111

void SC_Ai_SetShootOnHeardEnemyColTest(BOOL do_test); 111

void SC_Ai_SetFormationType(dword side, dword group, dword type); 111

void SC_Ai_SetFormationSize(dword side, dword group, float size); 111

void SC_Ai_SetBattleMode(dword side, dword group, dword mode); 111

void SC_Ai_SetBattleModeExt(dword size, dword group, dword battlemode, c_Vector3 *param); 111

void SC_Ai_SetPeaceMode(dword side, dword group, dword mode); 112

void SC_Ai_SetPointRuns(dword side, dword group, BOOL runs); 112

void SC_Ai_ClearCheckPoints(dword side, dword group); 112

void SC_Ai_AddCheckPoint(dword side, dword group, c_Vector3 *vec, dword flags); 112

BOOL SC_Ai_GetCurCheckPoint(dword side, dword group, c_Vector3 *vec); 113

void SC_Ai_PointStopDanger(dword side, dword group); 113

void SC_Ai_StopDanger(dword side, dword group, float stop_time); 113

void SC_Ai_SetStealthMode(dword side, dword group, BOOL stealth); 113

void SC_Ai_SetStealthModeOff(dword side, dword group, float agressive_time); 113

BOOL SC_Ai_GetStealthMode(dword side, dword group); 113

void SC_Ai_EnableRelaxWalk(dword side, dword group, BOOL enable); 113

dword SC_Ai_Blocker_Add(s_sphere *sph); 113

void SC_Ai_Blocker_Remove(dword blocker_id); 113

void SC_Ai_FakeEnemy_Add(dword side, dword group, c_Vector3 *fake_enemy, dword area_spheres, s_sphere *area_sphere); 113

void SC_Ai_FakeEnemy_Remove(dword side, dword group, c_Vector3 *fake_enemy); 114

void SC_Ai_FakeDanger(s_sphere *sph, float time); 114

void SC_Ai_SetGroupEnemyUpdate(dword side, dword group, BOOL enable); 114

void SC_Ai_SetPointmanNormalWalking(dword side, dword group, BOOL normal); 114

Functions for handling the individual AI 114

void SC_P_Ai_GetEnemyShotAround(dword pl_id, float max_dist); 114

void SC_P_SetInvisibleForAi(dword pl_id, BOOL invisible); 114

BOOL SC_P_GetInvisibleForAi(dword pl_id); 114

void SC_P_EnableSearchDeathBodies(dword pl_id, BOOL enable); 114

BOOL SC_P_Ai_CanSeePlayer(dword pl_id, dword target_id, float max_dist, dword need_points); 115

void SC_P_Ai_SetMode(dword pl_id, dword mode); 115

dword SC_P_Ai_GetMode(dword pl_id); 115

void SC_P_Ai_SetBattleMode(dword pl_id, dword battlemode); 115

void SC_P_Ai_SetBattleModeExt(dword pl_id, dword battlemode, c_Vector3 *param); 115

dword SC_P_Ai_GetBattleMode(dword pl_id); 116

void SC_P_Ai_SetPeaceMode(dword pl_id, dword peacemode); 116

dword SC_P_Ai_GetPeaceMode(dword pl_id); 116

dword SC_P_Ai_GetSpecTask(dword pl_id); 117

void SC_P_Ai_SetMoveMode(dword pl_id, dword mode); 117

void SC_P_Ai_SetMovePos(dword pl_id, dword pos); 117

void SC_P_Ai_EnableShooting(dword pl_id, BOOL enable); 117

void SC_P_Ai_Go(dword pl_id, c_Vector3 *vec); 117

void SC_P_Ai_Stop(dword pl_id); 117

void SC_P_Ai_GetProps(dword pl_id, s_SC_P_AI_props *props); 118

void SC_P_Ai_SetProps(dword pl_id, s_SC_P_AI_props *props); 118

void SC_P_Ai_GetGrenateProps(dword pl_id, s_SC_P_Ai_Grenade *props); 118

void SC_P_Ai_SetGrenateProps(dword pl_id, s_SC_P_Ai_Grenade *props); 118

dword SC_P_Ai_GetEnemies(dword pl_id); 118

dword SC_P_Ai_GetSureEnemies(dword pl_id); 118

void SC_P_Ai_LookAt(dword pl_id, c_Vector3 *vec); 118

void SC_P_Ai_EnableSituationUpdate(dword pl_id, BOOL enable); 118

BOOL SC_P_Ai_KnowsAboutPl(dword pl_id, dword target_pl_id); 118

void SC_P_Ai_SetBattleProps(dword pl_id, s_SC_P_Ai_BattleProps *props); 118

BOOL SC_P_Ai_GetShooting(dword pl_id, dword *target_pl_id); 119

float SC_P_Ai_GetDanger(dword pl_id); 119

void SC_P_Ai_SetPreferedWeaponSlot(dword pl_id, dword slot); 119

dword SC_P_Ai_GetPreferedWeaponSlot(dword pl_id); 119

void SC_P_Ai_ShootAt(dword pl_id, c_Vector3 *pos, float time); 119

void SC_P_Ai_ForgetEnemies(dword pl_id); 119

void SC_P_Ai_HideYourself(dword pl_id, c_Vector3 *danger_pos, float max_walk_dist); 119

BOOL SC_P_Ai_LookingAt(dword pl_id, c_Vector3 *pos); 119

void SC_P_Ai_ShouldLookAt(dword pl_id, c_Vector3 *pos, float time); 119

void SC_P_Ai_SetStaticMode(dword pl_id, BOOL is_static); 119

BOOL SC_P_Ai_GetStaticMode(dword pl_id); 120

BOOL SC_P_Ai_ThrowGrenade(dword pl_id, c_Vector3 *target, float explode_time); 120

float SC_P_Ai_GetNearestEnemyDist(dword pl_id); 120

dword SC_P_Ai_GetNearestEnemy(dword pl_id); 120

void SC_P_Ai_Script_WatchPlayer(dword pl_id, dword target_pl_id, float time); 120

void SC_P_Ai_UpdateSituation(dword pl_id, dword target_pl_id, BOOL enable_se); 120

void SC_P_Ai_JumpInNextFrame(dword pl_id); 120

void SC_P_Ai_SetIgnoreFlags(dword pl_id, dword flags); 120

dword SC_P_Ai_GetIgnoreFlags(dword pl_id); 121

void SC_P_Ai_SetPointmanBreaks(dword pl_id, float min_interval, float max_interval); 121

void SC_P_Ai_WalkThruAIs(dword pl_id, BOOL enable); 121

void SC_P_Ai_SetMedicIngMaxActiveDist(dword pl_id, float distance); 121

Functions for handling the individual AI and vehicles. 122

void SC_P_Ai_EnterCar(dword pl_id, char *car_name, dword entry_function, s_sphere *enter_pos); 122

void SC_P_Ai_StepOutCar(dword pl_id); 122

void SC_P_Ai_EnterHeli(dword pl_id, char *heli_name, dword entry_function); 122

void SC_P_Ai_StepOutHeli(dword pl_id); 122

void SC_P_Ai_Drive(dword pl_id, char *way_filename); 122

Functions for the multiplayer game. 122

void SC_MP_AddPlayerScript(char *filename); 122

BOOL SC_MP_EnumPlayers(s_SC_MP_EnumPlayers *list, dword *items, dword side); 122

BOOL SC_NET_FillRecover(s_SC_MP_Recover *recov, char *wpname); 122

void SC_MP_RestartMission(void); 123

void SC_MP_P_SetRecoverTime(dword pl_id, float time); 123

dword SC_MP_P_GetAfterRecoverSide(dword pl_id); 123

dword SC_MP_P_GetClass(dword pl_id); 123

dword SC_MP_P_GetAfterRecoverClass(dword pl_id); 123

void SC_MP_SRV_SetForceSide(dword side); 123

void SC_MP_SRV_SetClassLimit(dword class_id, dword limit); 123

void SC_MP_SRV_SetClassLimitsForDM(void); 123

dword SC_MP_SRV_GetBestDMrecov(s_SC_MP_Recover *list, dword items, float *no_recov_time, float max_recov_time); 123

void SC_MP_SRV_InitWeaponsRecovery(float time); 123

void SC_MP_HUD_SetTabInfo(s_SC_MP_hud *info); 124

void SC_MP_HUD_SelectPl(dword pl_id, dword color); 124

void SC_GameInfo(dword text_id, char *text); 124

void SC_GameInfoW(ushort *text); 124

void SC_P_MP_AddPoints(dword pl_id, int val); 124

dword SC_MP_GetMaxPointsPl(int *points); 124

dword SC_MP_GetMaxFragsPl(int *frags); 124

dword SC_MP_GetHandleofPl(dword pl_id); 124

dword SC_MP_GetPlofHandle(dword pl_handle); 124

void SC_MP_SRV_P_SetObtainedDamageMult(dword pl_id, float mult); 124

void SC_MP_SetSideStats(dword side, int frags, int points); 125

void SC_MP_ScriptMessage(dword param1, dword param2); 125

void SC_MP_AllowStPwD(BOOL enable); 125

void SC_MP_AllowFriendlyFireOFF(BOOL enable); 125

void SC_MP_SetIconHUD(s_SC_HUD_MP_icon *icon, dword icons); 125

void SC_MP_SetInstantRecovery(BOOL enable); 125

void SC_MP_SetItemsNoDisappear(BOOL nodisappear); 125

void SC_MP_EnableBotsFromScene(BOOL enable); 125

void SC_MP_SetChooseValidSides(dword mask); 125

void SC_MP_EnableC4weapon(BOOL enable); 125

void SC_MP_LoadNextMap(void); 126

void SC_MP_SetTeamGame(BOOL teamgame); 126

void SC_MP_RecoverAllNoAiPlayers(void); 126

void SC_MP_RecoverAllAiPlayers(void); 126

void SC_MP_EndRule_SetTimeLeft(float val, BOOL counting); 126

void SC_MP_GetSRVsettings(s_SC_MP_SRV_settings *info); 126

BOOL SC_MP_SRV_P_SetSideClass(dword pl_id, dword side, dword class_id); 126

BOOL SC_MP_SRV_GetAutoTeamBalance(void); 126

int SC_MP_SRV_GetTeamsNrDifference(BOOL after_respawn); 126

void SC_MP_SRV_DoExplosion(c_Vector3 *pos, dword type); 127

void SC_MP_SRV_ClearPlsStats(void); 127

void SC_MP_SRV_InitGameAfterInactive(void); 127

BOOL SC_MP_GetAmmoBoxesEnabled(void); 127

void SC_MP_SRV_GetAtgSettings(s_SC_MP_SRV_AtgSettings *info); 127

void SC_MP_SetSpectatorCameras(char character); 127

void SC_MP_GetRecovers(dword type, s_SC_MP_Recover *list, dword *items); 127

void SC_MP_RecoverPlayer(dword pl_id); 128

void SC_MP_RecoverAiPlayer (dword pl_id, c_Vector3 *pos, float rz); 128

dword SC_MP_FpvMapSign_Load(char *fname); 128

BOOL SC_MP_FpvMapSign_Unload(dword id); 128

void SC_MP_FpvMapSign_Set(dword signs, s_SC_FpvMapSign *list); 128

Functions for handling the speech. 128

void SC_P_Speach(dword pl_id, dword speach_txt, dword snd_id, float *timeout); 129

void SC_P_SpeachMes(dword pl_id, dword speach_txt, dword snd_id, float *timeout, dword param); 129

void SC_P_SpeachRadio(dword pl_id, dword speach_txt, dword snd_id, float *timeout); 129

void SC_P_SetSpeachDist(dword pl_id, float max_dist_subtitle_write); 129

void SC_P_Speech2(dword pl_id, dword speech_txt, float *timeout); 129

void SC_P_SpeechMes2(dword pl_id, dword speech_txt, float *timeout, dword param); 129

void SC_P_SpeechMes3(dword pl_id, char *speech_str, float *timeout, dword param); 130

void SC_P_SpeechMes3W(dword pl_id, ushort *speech_str, float *timeout, dword param); 130

void SC_P_SetChat(dword pl_id, float time); 130

BOOL SC_P_CanChat(dword pl_id); 130

void SC_RadioSetDist(float max_dist_subtitle_write); 130

void SC_SpeachRadio(dword speach_txt, dword snd_id, float *timeout); 130

void SC_SpeachRadioMes(dword speach_txt, dword snd_id, float *timeout, dword param); 130

void SC_SpeechRadio2(dword speech_txt, float *timeout); 131

void SC_SpeechRadioMes2(dword speech_txt, float *timeout, dword param); 131

void SC_SpeechSet3Dto3Dincamera(BOOL incamera3D); 131

float SC_RadioGetWillTalk(void); 131

float SC_P_GetWillTalk(dword pl_id); 131

BOOL SC_P_GetTalking(dword pl_id); 131

void SC_P_RemoveAllSpeech(dword pl_id); 131

void SC_P_RemoveAllSpeechEx(dword pl_id, BOOL include_active); 131

void SC_P_DisableSpeaking(dword pl_id, BOOL disable); 131

void SC_P_Ai_EnableSayTo(dword pl_id, BOOL enable); 132

Functions for controlling the game outcome. 132

void SC_MissionCompleted(void); 132

void SC_MissionFailed(void); 132

void SC_MissionFailedEx(dword music_id, dword start_volume); 132

void SC_MissionFailedDeathPlayer(dword death_plid); 132

void SC_MissionDone(void); 132

void SC_TheEnd(void); 132

Functions for the radio communication handling. 132

void SC_Radio_Enable(dword radio_id); 132

void SC_Radio_Disable(dword radio_id); 132

BOOL SC_Radio_Get(dword *radio_id); 132

void SC_RadioBatch_Begin(void); 133

void SC_RadioBatch_End(void); 133

void SC_RadistBatch_Begin(void); 133

void SC_RadistBatch_End(void); 133

void SC_RadioSet2D(BOOL willbe2D); 133

void SC_RadioSet3DButDistanceLimit(BOOL enable); 133

void SC_RadioBreak_Set(s_SC_SpeachBreakProps *props); 133

void SC_RadioBreak_Get(s_SC_SpeachBreakProps *props); 133

void SC_P_Radio_Enable(dword pl_id, dword radio_id); 133

BOOL SC_P_Radio_Used(dword pl_id, dword radio_id); 133

void SC_PC_EnableRadioBreak(BOOL enable); 133

Functions – saving the game. 134

void SC_MissionSave(s_SC_MissionSave *info); 134

void SC_EnableQuickSave(BOOL enable); 134

Functions – various functions. 134

void SC_SetObjectScript(char *obj_name, char *script_name); 134

void SC_DisplayBinocular(BOOL enable); 134

void SC_DeathCamera_Enable(BOOL enable); 134

void SC_Set_GoToPC_snd(dword member_id, dword peace, dword agressive, dword stealth); 134

void SC_Set_RadioMan_RunDist(float dist); 134

void SC_PreloadBES(dword id, char *bes_name); 134

void SC_PreloadWeapon(dword type, BOOL fpv_to); 134

void SC_PreloadSound(dword snd_id, BOOL is3D); 134

void SC_LevScr_Event(dword param1, dword param2); 134

void SC_StorySkipEnable(BOOL enable); 135

void SC_SetObjectives(dword objectives, s_SC_Objective *objective, float force_display_time); 135

void SC_SetObjectivesNoSound(dword objectives, s_SC_Objective *objective, float force_display_time); 135

BOOL SC_GetScriptHelper(char *name, s_sphere *sph); 135

void SC_DoExplosion(c_Vector3 *pos, dword type); 135

void SC_ArtillerySupport(BOOL enable); 135

void SC_SetBombInfo(s_SC_BombInfo *info); 135

void SC_SetMapFpvModel(char *bes_filename); 135

void SC_MakeBurning(s_sphere *sph); 135

void SC_GetLoudShot(s_sphere *sph); 135

void SC_SetCommandMenu(dword text_id); 135

float SC_GetVisibility(void); 135