2024-01-09 23:53:36 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define MAX_SCRIPT_VARS 16 // Size of our variable saving array
|
|
|
|
|
|
|
|
// Super Simplified SA Version
|
|
|
|
struct GAME_SCRIPT_THREAD // 0xE0 bytes total.
|
|
|
|
{
|
2024-07-12 18:38:48 +08:00
|
|
|
//BYTE _gap0[224];
|
|
|
|
BYTE Pad1[0x14]; // 0x00 [0x14]
|
|
|
|
DWORD dwScriptIP; // 0x14 [0x04]
|
|
|
|
BYTE Pad2[0x24]; // 0x18 [0x24]
|
|
|
|
DWORD dwLocalVar[18]; // 0x3C [0x48]
|
|
|
|
BYTE Pad3[0x41]; // 0x84 [0x41]
|
|
|
|
DWORD dwIfFlag; // 0xC5 [0x04]
|
|
|
|
BYTE Pad4[0xF]; // 0xC9 [0x0F]
|
|
|
|
DWORD dwIndexSomething; // 0xD8 [0x04] (indexes into 0xA49960)
|
|
|
|
BYTE bHasLocalCopy; // 0xDC [0x01] (has local copy of something, if 1, then uses .data:00A48960 CTheScripts_LocalCopy instead of var0)
|
|
|
|
BYTE Pad5[0x3]; // 0xDD [0x03]
|
2024-01-09 23:53:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SCRIPT_COMMAND // Params
|
|
|
|
{ // i = integer
|
|
|
|
WORD OpCode; // f = float
|
|
|
|
char Params[MAX_SCRIPT_VARS]; // v = variable
|
|
|
|
}; // s = string
|
|
|
|
|
2024-07-12 18:41:17 +08:00
|
|
|
void InitScripting();
|
2024-02-06 21:37:52 +08:00
|
|
|
int ScriptCommand(const SCRIPT_COMMAND* pScriptCommand, ...); // The main scripting function. See notes.
|
|
|
|
|
|
|
|
|
2024-02-18 21:46:45 +08:00
|
|
|
const SCRIPT_COMMAND request_model = { 0x0247, "i" }; // (CAR_*|BIKE_*|BOAT_*|WEAPON_*|OBJECT_*)
|
|
|
|
const SCRIPT_COMMAND load_requested_models = { 0x038B, "" }; // -/-
|
|
|
|
|
2024-10-24 22:24:40 +08:00
|
|
|
const SCRIPT_COMMAND create_actor = { 0x009A, "iifffv" }; // PEDTYPE_*, #MODEL, x, y, z, var_actor
|
|
|
|
|
2024-02-06 21:37:52 +08:00
|
|
|
const SCRIPT_COMMAND fade = { 0x016A, "ii" }; // (time in ms), FADE_*
|
2024-08-15 22:26:13 +08:00
|
|
|
|
|
|
|
const SCRIPT_COMMAND set_current_time = { 0x00C0, "ii" }; // Hours, Minutes
|
|
|
|
|
2024-02-18 21:46:45 +08:00
|
|
|
const SCRIPT_COMMAND is_model_available = { 0x0248, "i" }; // #MODEL
|
|
|
|
|
2024-02-06 21:37:52 +08:00
|
|
|
const SCRIPT_COMMAND set_camera_behind_player = { 0x0373, "" }; // -/-
|
2024-10-31 17:22:38 +08:00
|
|
|
|
|
|
|
const SCRIPT_COMMAND camera_on_vehicle = { 0x0158, "iii" }; // var_car, ukn, ukn
|
|
|
|
|
2024-02-06 21:37:52 +08:00
|
|
|
const SCRIPT_COMMAND point_camera = { 0x0160, "fffi" }; // x, y, z, type
|
|
|
|
const SCRIPT_COMMAND restore_camera_jumpcut = { 0x02EB, "" }; // -/-
|
|
|
|
const SCRIPT_COMMAND set_camera_position = { 0x015F, "ffffff" }; // x, y, z, vx, vy, vz
|
2024-02-15 22:23:36 +08:00
|
|
|
|
2024-02-21 18:58:07 +08:00
|
|
|
const SCRIPT_COMMAND disable_marker = { 0x0164, "i" }; // var_marker
|
2024-02-21 18:54:22 +08:00
|
|
|
const SCRIPT_COMMAND set_marker_color = { 0x0165, "ii" }; // var_marker, color
|
2024-07-24 03:57:24 +08:00
|
|
|
const SCRIPT_COMMAND enable_zone_names = { 0x09BA, "i" };
|
2024-02-21 18:54:22 +08:00
|
|
|
const SCRIPT_COMMAND create_radar_marker_without_sphere = { 0x04CE, "fffiv" }; // x, y, z, marker_type, var_marker
|
|
|
|
const SCRIPT_COMMAND show_on_radar = { 0x0168, "ii" }; // var_marker, size
|
|
|
|
|
|
|
|
const SCRIPT_COMMAND create_icon_marker_sphere = { 0x02A7, "fffiv" };
|
|
|
|
|
2024-11-08 00:32:04 +08:00
|
|
|
const SCRIPT_COMMAND is_actor_near_point_3d = { 0x00FE, "iffffffi" };// var_actor, x, y, z, rx, ry, rz, b
|
|
|
|
|
2024-02-27 23:37:45 +08:00
|
|
|
const SCRIPT_COMMAND add_to_player_money = { 0x0109, "ii" }; // PLAYER_CHAR, money
|
|
|
|
|
2024-08-20 23:03:15 +08:00
|
|
|
const SCRIPT_COMMAND has_car_sunk = { 0x02bf, "i" }; // CarID
|
2024-08-20 23:04:18 +08:00
|
|
|
const SCRIPT_COMMAND is_car_wrecked = { 0x0119, "i" }; // CarID
|
2024-07-28 22:55:34 +08:00
|
|
|
const SCRIPT_COMMAND get_ground_z = { 0x02ce, "fffv" }; // x, y, z, var_ground_z
|
|
|
|
|
2024-11-08 00:20:39 +08:00
|
|
|
const SCRIPT_COMMAND create_racing_checkpoint = { 0x06d5, "ifffffffv"}; // type, x, y, z, nx, ny. nz, size, $id (n=next checkpoint)
|
|
|
|
/* 0 = Street Checkpoint with arrow to the next checkpoint
|
|
|
|
1 and 2 = Street Checkpoint
|
|
|
|
3 and 4 = Flight Checkpoint (circle) */
|
2024-02-27 23:37:45 +08:00
|
|
|
const SCRIPT_COMMAND destroy_racing_checkpoint = { 0x06d6, "i" };
|
|
|
|
|
2024-10-15 17:56:30 +08:00
|
|
|
const SCRIPT_COMMAND toggle_player_controllable = { 0x01B4, "ii" };
|
|
|
|
|
2024-05-03 22:07:17 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_armed_weapon = { 0x01b9, "ii" };
|
2024-05-05 18:52:08 +08:00
|
|
|
const SCRIPT_COMMAND get_actor_armed_weapon = { 0x0470, "iv" };
|
2024-05-03 22:07:17 +08:00
|
|
|
|
2024-10-31 17:22:38 +08:00
|
|
|
const SCRIPT_COMMAND put_actor_in_car = { 0x036A, "ii" };
|
2024-05-05 19:02:17 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_immunities = { 0x02ab, "iiiiii" };
|
|
|
|
|
2024-02-15 22:23:36 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_can_be_decapitated = { 0x0446, "ii" };
|
|
|
|
|
2024-02-26 23:40:36 +08:00
|
|
|
const SCRIPT_COMMAND play_sound = { 0x018c, "fffi" };
|
|
|
|
|
2024-10-15 17:52:24 +08:00
|
|
|
const SCRIPT_COMMAND remove_actor_from_car_and_put_at = { 0x0362, "ifff" };
|
2024-10-31 17:26:43 +08:00
|
|
|
const SCRIPT_COMMAND send_actor_to_car_driverseat = { 0x05CB, "iii" };
|
|
|
|
const SCRIPT_COMMAND send_actor_to_car_passenger = { 0x05CA, "iiii" };
|
2024-10-31 17:27:54 +08:00
|
|
|
const SCRIPT_COMMAND make_actor_leave_car = { 0x05CD, "ii" };
|
2024-10-31 17:26:43 +08:00
|
|
|
|
2024-02-18 21:46:45 +08:00
|
|
|
const SCRIPT_COMMAND enable_train_traffic = { 0x06d7, "i" };
|
|
|
|
|
2024-08-20 22:55:12 +08:00
|
|
|
const SCRIPT_COMMAND lock_car = { 0x0519, "ii" };
|
2024-02-27 21:25:04 +08:00
|
|
|
const SCRIPT_COMMAND put_train_at = { 0x07c7, "ifff" };
|
|
|
|
|
2024-02-27 23:37:45 +08:00
|
|
|
const SCRIPT_COMMAND get_active_interior = { 0x077e, "v" };
|
2024-08-05 18:14:12 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_z_angle = { 0x0173, "if" };
|
2024-02-27 23:37:45 +08:00
|
|
|
|
2024-10-15 17:56:30 +08:00
|
|
|
const SCRIPT_COMMAND lock_actor = { 0x04d7, "ii" };
|
2024-02-18 21:46:45 +08:00
|
|
|
const SCRIPT_COMMAND refresh_streaming_at = { 0x04E4, "ff" };
|
2024-10-31 17:22:38 +08:00
|
|
|
const SCRIPT_COMMAND put_actor_in_car2 = { 0x0430, "iii" };
|
|
|
|
|
2024-10-24 22:29:13 +08:00
|
|
|
const SCRIPT_COMMAND kill_actor = { 0x0321, "i" };
|
2024-02-18 21:46:45 +08:00
|
|
|
|
2024-07-14 22:50:36 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_animation_set = { 0x0245, "is" };
|
2024-02-18 21:46:45 +08:00
|
|
|
const SCRIPT_COMMAND request_animation = { 0x04ED, "s" };
|
|
|
|
const SCRIPT_COMMAND is_animation_loaded = { 0x04EE, "s" };
|
|
|
|
const SCRIPT_COMMAND release_animation = { 0x04EF, "s" };
|
2024-10-25 23:47:29 +08:00
|
|
|
const SCRIPT_COMMAND apply_animation = { 0x0812, "issfiiiii" }; // actor,animation,library,floatunk,bool,bool,bool,bool,int
|
2024-10-31 19:17:46 +08:00
|
|
|
const SCRIPT_COMMAND is_actor_performing_anim = { 0x0611, "is" };
|
2024-02-15 22:23:36 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_weapon_droppable = { 0x087e, "ii" };
|
2024-07-14 22:51:45 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_money = { 0x03fe, "ii" };
|
|
|
|
|
2024-02-27 23:37:45 +08:00
|
|
|
const SCRIPT_COMMAND text_clear_all = { 0x00be, "" };
|
|
|
|
|
2024-08-14 23:06:11 +08:00
|
|
|
const SCRIPT_COMMAND create_pickup_with_ammo = { 0x032b, "iiifffv" };
|
|
|
|
|
2024-08-21 23:23:07 +08:00
|
|
|
const SCRIPT_COMMAND destroy_pickup = { 0x0215, "i" };
|
|
|
|
|
2024-11-02 23:03:00 +08:00
|
|
|
const SCRIPT_COMMAND toggle_actor_cellphone = { 0x0729, "ii" };
|
|
|
|
|
2024-10-15 18:05:38 +08:00
|
|
|
const SCRIPT_COMMAND actor_task_handsup = { 0x5c4, "ii" };
|
|
|
|
|
2024-11-02 23:06:07 +08:00
|
|
|
const SCRIPT_COMMAND set_fighting_style = { 0x07fe, "iii" };
|
|
|
|
|
2024-08-20 22:44:22 +08:00
|
|
|
const SCRIPT_COMMAND link_vehicle_to_interior = { 0x0840, "ii" };
|
2024-02-21 18:54:22 +08:00
|
|
|
const SCRIPT_COMMAND create_radar_marker_icon = { 0x0570, "fffiv" };
|
|
|
|
|
2024-07-16 23:19:34 +08:00
|
|
|
const SCRIPT_COMMAND remove_panel = { 0x08DA, "i" };
|
2024-07-16 23:24:53 +08:00
|
|
|
const SCRIPT_COMMAND create_panel = { 0x08D4, "sfffiiiiv" };
|
|
|
|
const SCRIPT_COMMAND set_panel_column_data = { 0x08DB, "iisssssssssssss" };
|
|
|
|
const SCRIPT_COMMAND set_panel_column_width = { 0x09DB, "iii" };
|
|
|
|
const SCRIPT_COMMAND set_panel_row_enable = { 0x08D9, "iii" };
|
|
|
|
|
2024-07-16 23:32:22 +08:00
|
|
|
const SCRIPT_COMMAND get_panel_active_row = { 0x08D7, "iv" };
|
|
|
|
|
2024-10-24 22:24:40 +08:00
|
|
|
const SCRIPT_COMMAND set_actor_dicision = { 0x60B, "ii" };
|
|
|
|
|
2024-10-17 17:19:25 +08:00
|
|
|
const SCRIPT_COMMAND set_player_drunk_visuals = { 0x052c, "ii" }; // player, severity (0-255)
|
2024-10-17 17:22:08 +08:00
|
|
|
const SCRIPT_COMMAND handling_responsiveness = { 0x03fd, "ii" }; // player, severity (0-255)
|
2024-10-17 17:19:25 +08:00
|
|
|
|
|
|
|
// ---
|
2024-02-15 22:23:36 +08:00
|
|
|
|
2024-02-06 21:37:52 +08:00
|
|
|
const SCRIPT_COMMAND restore_camera_to_user_defined = { 0x925, "" };
|
2024-02-10 22:45:20 +08:00
|
|
|
const SCRIPT_COMMAND set_camera_position_to = { 0x936, "ffffffii" };
|
|
|
|
const SCRIPT_COMMAND point_camera_transverse_to = { 0x920, "ffffffii" };
|
|
|
|
const SCRIPT_COMMAND lock_camera_target_point = { 0x92F, "i" };
|
2024-02-06 21:37:52 +08:00
|
|
|
const SCRIPT_COMMAND lock_camera_position = { 0x930, "i" };
|
2024-01-09 23:53:36 +08:00
|
|
|
|
2024-02-21 18:54:22 +08:00
|
|
|
const SCRIPT_COMMAND create_marker_at = { 0x2A8, "fffiv" };
|
|
|
|
|
|
|
|
|
2024-02-26 23:40:36 +08:00
|
|
|
const SCRIPT_COMMAND load_wav = { 0x3CF, "ii" };
|
|
|
|
const SCRIPT_COMMAND is_wav_loaded = { 0x3D0, "i" };
|
|
|
|
const SCRIPT_COMMAND play_wav = { 0x3D1, "i" };
|
|
|
|
const SCRIPT_COMMAND unload_wav = { 0x40D, "i" };
|
|
|
|
const SCRIPT_COMMAND set_wav_at_location = { 0x3D7, "ifff" };
|
2024-02-21 18:54:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-09 23:53:36 +08:00
|
|
|
|