mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
New *_map_enter_position functions. (#141)
Added "get/set_map_enter_position" script functions (#101)
This commit is contained in:
@@ -236,3 +236,6 @@
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
#define get_map_enter_position sfall_func0("get_map_enter_position")
|
||||
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
|
||||
|
||||
|
||||
@@ -448,6 +448,10 @@ Some utility/math functions are available:
|
||||
- passing 0 will disable the auto unjam mechanism completely
|
||||
- The auto unjam mechanism will be reset each time the player reloads the game
|
||||
|
||||
> array sfall_func0("get_map_enter_position")
|
||||
|
||||
> void sfall_func3("set_map_enter_position", int tile, int elevation, int rotation)
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#define FO_VAR_drugInfoList 0x5191CC
|
||||
#define FO_VAR_edit_win 0x57060C
|
||||
#define FO_VAR_Educated 0x57082C
|
||||
#define FO_VAR_elevation 0x631D2C
|
||||
#define FO_VAR_Experience_ 0x6681B4
|
||||
#define FO_VAR_fallout_game_time 0x51C720
|
||||
#define FO_VAR_flptr 0x614808
|
||||
@@ -151,6 +152,7 @@
|
||||
#define FO_VAR_read_callback 0x51DEEC
|
||||
#define FO_VAR_RedColor 0x6AB4D0
|
||||
#define FO_VAR_retvals 0x43EA7C
|
||||
#define FO_VAR_rotation 0x631D34
|
||||
#define FO_VAR_script_path_base 0x51C710
|
||||
#define FO_VAR_scr_size 0x6AC9F0
|
||||
#define FO_VAR_scriptListInfo 0x51C7C8
|
||||
@@ -179,6 +181,7 @@
|
||||
#define FO_VAR_text_spacing 0x51E3CC
|
||||
#define FO_VAR_text_to_buf 0x51E3B8
|
||||
#define FO_VAR_text_width 0x51E3C0
|
||||
#define FO_VAR_tile 0x631D30
|
||||
#define FO_VAR_title_color 0x56D750
|
||||
#define FO_VAR_title_font 0x56D748
|
||||
#define FO_VAR_trait_data 0x51DB84
|
||||
|
||||
@@ -39,6 +39,7 @@ VAR_(dialog_target_is_party, DWORD)
|
||||
VAR_(drugInfoList, DWORD)
|
||||
VAR_(edit_win, DWORD)
|
||||
VAR_(Educated, DWORD)
|
||||
VAR_(elevation, DWORD)
|
||||
VAR_(Experience_, DWORD)
|
||||
VAR_(fallout_game_time, DWORD)
|
||||
VAR_(flptr, DWORD)
|
||||
@@ -145,6 +146,7 @@ VAR_(queue, DWORD)
|
||||
VAR_(quick_done, DWORD)
|
||||
VAR_(read_callback, DWORD)
|
||||
VAR_(RedColor, BYTE)
|
||||
VAR_(rotation, DWORD)
|
||||
VAR2(retvals, ElevatorExit, 24, 4) // 24 elevators, 4 exits each
|
||||
VAR_(script_path_base, const char*)
|
||||
VAR_(scr_size, DWORD)
|
||||
@@ -174,6 +176,7 @@ VAR_(text_mono_width, DWORD)
|
||||
VAR_(text_spacing, DWORD)
|
||||
VAR_(text_to_buf, DWORD)
|
||||
VAR_(text_width, DWORD)
|
||||
VAR_(tile, DWORD)
|
||||
VAR_(title_color, DWORD)
|
||||
VAR_(title_font, DWORD)
|
||||
VARA(trait_data, TraitInfo, TRAIT_count)
|
||||
|
||||
@@ -84,6 +84,7 @@ static const SfallMetarule metarules[] = {
|
||||
{"get_flags", sf_get_flags, 1, 1, {ARG_OBJECT}},
|
||||
{"get_ini_section", sf_get_ini_section, 2, 2, {ARG_STRING, ARG_STRING}},
|
||||
{"get_ini_sections", sf_get_ini_sections, 1, 1, {ARG_STRING}},
|
||||
{"get_map_enter_position", sf_get_map_enter_position, 0, 0},
|
||||
{"get_metarule_table", sf_get_metarule_table, 0, 0},
|
||||
{"get_outline", sf_get_outline, 1, 1, {ARG_OBJECT}},
|
||||
{"intface_hide", sf_intface_hide, 0, 0},
|
||||
@@ -99,6 +100,7 @@ static const SfallMetarule metarules[] = {
|
||||
{"set_dude_obj", sf_set_dude_obj, 1, 1, {ARG_OBJECT}},
|
||||
{"set_flags", sf_set_flags, 2, 2, {ARG_OBJECT, ARG_INT}},
|
||||
{"set_ini_setting", sf_set_ini_setting, 2, 2, {ARG_STRING, ARG_INTSTR}},
|
||||
{"set_map_enter_position", sf_set_map_enter_position, 3, 3, {ARG_INT, ARG_INT, ARG_INT}},
|
||||
{"set_outline", sf_set_outline, 2, 2, {ARG_OBJECT, ARG_INT}},
|
||||
{"set_unjam_locks_time", sf_set_unjam_locks_time, 1, 1, {ARG_INT}},
|
||||
{"spatial_radius", sf_spatial_radius, 1, 1, {ARG_OBJECT}},
|
||||
|
||||
@@ -230,5 +230,29 @@ void sf_set_car_intface_art(OpcodeContext& ctx) {
|
||||
Worldmap::SetCarInterfaceArt(ctx.arg(0).asInt());
|
||||
}
|
||||
|
||||
void sf_set_map_enter_position(OpcodeContext& ctx) {
|
||||
int tile = ctx.arg(0).asInt();
|
||||
int elev = ctx.arg(1).asInt();
|
||||
int rot = ctx.arg(2).asInt();
|
||||
|
||||
if (tile > -1 && tile <= 40200) {
|
||||
fo::var::tile = tile;
|
||||
}
|
||||
if (elev > -1 && elev < 3) {
|
||||
fo::var::elevation = elev;
|
||||
}
|
||||
if (rot > -1 && rot < 6) {
|
||||
fo::var::rotation = rot;
|
||||
}
|
||||
}
|
||||
|
||||
void sf_get_map_enter_position(OpcodeContext& ctx) {
|
||||
DWORD id = TempArray(3, 0);
|
||||
arrays[id].val[0].set((long)fo::var::tile);
|
||||
arrays[id].val[1].set((long)fo::var::elevation);
|
||||
arrays[id].val[2].set((long)fo::var::rotation);
|
||||
ctx.setReturn(id, DataType::INT);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,5 +42,9 @@ void __declspec() op_set_world_map_pos();
|
||||
|
||||
void sf_set_car_intface_art(OpcodeContext&);
|
||||
|
||||
void sf_set_map_enter_position(OpcodeContext&);
|
||||
|
||||
void sf_get_map_enter_position(OpcodeContext&);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user