|
|
@ -20,10 +20,14 @@ MAKE IT RUN CORRECTLY if any data structures
|
|
|
|
changed, thus possibly leading to CRASHES AND/OR
|
|
|
|
changed, thus possibly leading to CRASHES AND/OR
|
|
|
|
PERMANENT SAVE CORRUPTION.
|
|
|
|
PERMANENT SAVE CORRUPTION.
|
|
|
|
|
|
|
|
|
|
|
|
This script should be initially started immediately
|
|
|
|
Finding the first few globals requires this script to be
|
|
|
|
after loading the game, WITHOUT first loading a world.
|
|
|
|
started immediately after loading the game, WITHOUT
|
|
|
|
It expects vanilla game configuration, without any
|
|
|
|
first loading a world.
|
|
|
|
custom tilesets or init file changes.
|
|
|
|
|
|
|
|
|
|
|
|
The script expects vanilla game configuration, without
|
|
|
|
|
|
|
|
any custom tilesets or init file changes. Never unpause
|
|
|
|
|
|
|
|
the game unless instructed. When done, quit the game
|
|
|
|
|
|
|
|
without saving using 'die'.
|
|
|
|
]]
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
|
|
if not utils.prompt_yes_no('Proceed?') then
|
|
|
|
if not utils.prompt_yes_no('Proceed?') then
|
|
|
@ -140,8 +144,6 @@ local function find_cursor()
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_cursor, { 'cursor', 'selection_rect', 'gamemode', 'gametype' })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- Announcements
|
|
|
|
-- Announcements
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -158,8 +160,6 @@ local function find_announcements()
|
|
|
|
dfhack.printerr('Could not find announcements.')
|
|
|
|
dfhack.printerr('Could not find announcements.')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_announcements, 'announcements')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- d_init
|
|
|
|
-- d_init
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -198,8 +198,6 @@ local function find_d_init()
|
|
|
|
dfhack.printerr('Could not find d_init')
|
|
|
|
dfhack.printerr('Could not find d_init')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_d_init, 'd_init')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- gview
|
|
|
|
-- gview
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -220,8 +218,6 @@ local function find_gview()
|
|
|
|
dfhack.printerr('Could not find gview')
|
|
|
|
dfhack.printerr('Could not find gview')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_gview, 'gview')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- World
|
|
|
|
-- World
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -257,8 +253,6 @@ menu, and select different types as instructed below:]],
|
|
|
|
validate_offset('world', is_valid_world, addr, df.world, 'selected_stockpile_type')
|
|
|
|
validate_offset('world', is_valid_world, addr, df.world, 'selected_stockpile_type')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_world, 'world')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- UI
|
|
|
|
-- UI
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -291,8 +285,6 @@ menu, and switch modes as instructed below:]],
|
|
|
|
validate_offset('ui', is_valid_ui, addr, df.ui, 'main', 'mode')
|
|
|
|
validate_offset('ui', is_valid_ui, addr, df.ui, 'main', 'mode')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui, 'ui')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_sidebar_menus
|
|
|
|
-- ui_sidebar_menus
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -319,9 +311,9 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
local function find_ui_sidebar_menus()
|
|
|
|
local function find_ui_sidebar_menus()
|
|
|
|
local addr = searcher:find_menu_cursor([[
|
|
|
|
local addr = searcher:find_menu_cursor([[
|
|
|
|
Searching for ui_sidebar_menus. Please open the add job
|
|
|
|
Searching for ui_sidebar_menus. Please switch to 'q' mode,
|
|
|
|
ui of Mason, Craftsdwarfs, or Carpenters workshop, and
|
|
|
|
select a Mason, Craftsdwarfs, or Carpenters workshop, open
|
|
|
|
select entries in the list:]],
|
|
|
|
the Add Job menu, and move the cursor within:]],
|
|
|
|
'int32_t',
|
|
|
|
'int32_t',
|
|
|
|
{ 0, 1, 2, 3, 4, 5, 6 },
|
|
|
|
{ 0, 1, 2, 3, 4, 5, 6 },
|
|
|
|
ordinal_names
|
|
|
|
ordinal_names
|
|
|
@ -330,8 +322,6 @@ select entries in the list:]],
|
|
|
|
addr, df.ui_sidebar_menus, 'workshop_job', 'cursor')
|
|
|
|
addr, df.ui_sidebar_menus, 'workshop_job', 'cursor')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_sidebar_menus, 'ui_sidebar_menus')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_build_selector
|
|
|
|
-- ui_build_selector
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -366,7 +356,25 @@ number, so when it shows "Min (5000df", it means 50000:]],
|
|
|
|
addr, df.ui_build_selector, 'plate_info', 'unit_min')
|
|
|
|
addr, df.ui_build_selector, 'plate_info', 'unit_min')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_build_selector, 'ui_build_selector')
|
|
|
|
--
|
|
|
|
|
|
|
|
-- ui_menu_width
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function find_ui_menu_width()
|
|
|
|
|
|
|
|
local addr = searcher:find_menu_cursor([[
|
|
|
|
|
|
|
|
Searching for ui_menu_width. Please exit to the main
|
|
|
|
|
|
|
|
dwarfmode menu, then use Tab to do as instructed below:]],
|
|
|
|
|
|
|
|
'int8_t',
|
|
|
|
|
|
|
|
{ 2, 3, 1 },
|
|
|
|
|
|
|
|
{ [2] = 'switch to the most usual [mapmap][menu] layout',
|
|
|
|
|
|
|
|
[3] = 'hide the menu completely',
|
|
|
|
|
|
|
|
[1] = 'switch to the default [map][menu][map] layout' }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
ms.found_offset('ui_menu_width', addr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- NOTE: Assume that the vars are adjacent, as always
|
|
|
|
|
|
|
|
ms.found_offset('ui_area_map_width', addr+1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_selected_unit
|
|
|
|
-- ui_selected_unit
|
|
|
@ -395,8 +403,6 @@ into the prompts below:]],
|
|
|
|
ms.found_offset('ui_selected_unit', addr)
|
|
|
|
ms.found_offset('ui_selected_unit', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_selected_unit, 'ui_selected_unit')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_unit_view_mode
|
|
|
|
-- ui_unit_view_mode
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -412,8 +418,6 @@ with 'v', switch the pages as requested:]],
|
|
|
|
ms.found_offset('ui_unit_view_mode', addr)
|
|
|
|
ms.found_offset('ui_unit_view_mode', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_unit_view_mode, 'ui_unit_view_mode')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_look_cursor
|
|
|
|
-- ui_look_cursor
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -434,8 +438,6 @@ and select list entries as instructed:]],
|
|
|
|
ms.found_offset('ui_look_cursor', addr)
|
|
|
|
ms.found_offset('ui_look_cursor', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_look_cursor, 'ui_look_cursor')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_building_item_cursor
|
|
|
|
-- ui_building_item_cursor
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -456,8 +458,6 @@ with many contained items, and select as instructed:]],
|
|
|
|
ms.found_offset('ui_building_item_cursor', addr)
|
|
|
|
ms.found_offset('ui_building_item_cursor', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_item_cursor, 'ui_building_item_cursor')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_workshop_in_add
|
|
|
|
-- ui_workshop_in_add
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -468,7 +468,7 @@ Searching for ui_workshop_in_add. Please activate the 'q'
|
|
|
|
mode, find a workshop without jobs (or delete jobs),
|
|
|
|
mode, find a workshop without jobs (or delete jobs),
|
|
|
|
and do as instructed below.
|
|
|
|
and do as instructed below.
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: After first 3 steps resize the game window.]],
|
|
|
|
NOTE: If not done after first 3-4 steps, resize the game window.]],
|
|
|
|
'int8_t',
|
|
|
|
'int8_t',
|
|
|
|
{ 1, 0 },
|
|
|
|
{ 1, 0 },
|
|
|
|
{ [1] = 'enter the add job menu',
|
|
|
|
{ [1] = 'enter the add job menu',
|
|
|
@ -477,8 +477,6 @@ NOTE: After first 3 steps resize the game window.]],
|
|
|
|
ms.found_offset('ui_workshop_in_add', addr)
|
|
|
|
ms.found_offset('ui_workshop_in_add', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_workshop_in_add, 'ui_workshop_in_add')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_workshop_job_cursor
|
|
|
|
-- ui_workshop_job_cursor
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -498,8 +496,6 @@ mode, find a workshop with many jobs, and select as instructed:]],
|
|
|
|
ms.found_offset('ui_workshop_job_cursor', addr)
|
|
|
|
ms.found_offset('ui_workshop_job_cursor', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_workshop_job_cursor, 'ui_workshop_job_cursor')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_building_in_assign
|
|
|
|
-- ui_building_in_assign
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -510,7 +506,7 @@ Searching for ui_building_in_assign. Please activate
|
|
|
|
the 'q' mode, select a room building (e.g. a bedroom)
|
|
|
|
the 'q' mode, select a room building (e.g. a bedroom)
|
|
|
|
and do as instructed below.
|
|
|
|
and do as instructed below.
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: After first 3 steps resize the game window.]],
|
|
|
|
NOTE: If not done after first 3-4 steps, resize the game window.]],
|
|
|
|
'int8_t',
|
|
|
|
'int8_t',
|
|
|
|
{ 1, 0 },
|
|
|
|
{ 1, 0 },
|
|
|
|
{ [1] = 'enter the Assign owner menu',
|
|
|
|
{ [1] = 'enter the Assign owner menu',
|
|
|
@ -519,8 +515,6 @@ NOTE: After first 3 steps resize the game window.]],
|
|
|
|
ms.found_offset('ui_building_in_assign', addr)
|
|
|
|
ms.found_offset('ui_building_in_assign', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_in_assign, 'ui_building_in_assign')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- ui_building_in_resize
|
|
|
|
-- ui_building_in_resize
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -531,7 +525,7 @@ Searching for ui_building_in_resize. Please activate
|
|
|
|
the 'q' mode, select a room building (e.g. a bedroom)
|
|
|
|
the 'q' mode, select a room building (e.g. a bedroom)
|
|
|
|
and do as instructed below.
|
|
|
|
and do as instructed below.
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: After first 3 steps resize the game window.]],
|
|
|
|
NOTE: If not done after first 3-4 steps, resize the game window.]],
|
|
|
|
'int8_t',
|
|
|
|
'int8_t',
|
|
|
|
{ 1, 0 },
|
|
|
|
{ 1, 0 },
|
|
|
|
{ [1] = 'enter the Resize room mode',
|
|
|
|
{ [1] = 'enter the Resize room mode',
|
|
|
@ -540,9 +534,6 @@ NOTE: After first 3 steps resize the game window.]],
|
|
|
|
ms.found_offset('ui_building_in_resize', addr)
|
|
|
|
ms.found_offset('ui_building_in_resize', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_in_resize, 'ui_building_in_resize')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- window_x
|
|
|
|
-- window_x
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -557,8 +548,6 @@ scroll to the LEFT edge, then do as instructed:]],
|
|
|
|
ms.found_offset('window_x', addr)
|
|
|
|
ms.found_offset('window_x', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_window_x, 'window_x')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- window_y
|
|
|
|
-- window_y
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -573,8 +562,6 @@ scroll to the TOP edge, then do as instructed:]],
|
|
|
|
ms.found_offset('window_y', addr)
|
|
|
|
ms.found_offset('window_y', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_window_y, 'window_y')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- window_z
|
|
|
|
-- window_z
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -582,20 +569,47 @@ exec_finder(find_window_y, 'window_y')
|
|
|
|
local function find_window_z()
|
|
|
|
local function find_window_z()
|
|
|
|
local addr = searcher:find_counter([[
|
|
|
|
local addr = searcher:find_counter([[
|
|
|
|
Searching for window_z. Please exit to main dwarfmode menu,
|
|
|
|
Searching for window_z. Please exit to main dwarfmode menu,
|
|
|
|
scroll to ground level, then do as instructed below.
|
|
|
|
scroll to a Z level near surface, then do as instructed below.
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: After first 3 steps resize the game window.]],
|
|
|
|
NOTE: If not done after first 3-4 steps, resize the game window.]],
|
|
|
|
'int32_t', -1,
|
|
|
|
'int32_t', -1,
|
|
|
|
"Please press '>' to scroll one Z level down."
|
|
|
|
"Please press '>' to scroll one Z level down."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
ms.found_offset('window_z', addr)
|
|
|
|
ms.found_offset('window_z', addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_window_z, 'window_z')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- THE END
|
|
|
|
-- MAIN FLOW
|
|
|
|
--
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
print('Done.')
|
|
|
|
print('\nInitial globals (need title screen):\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_cursor, { 'cursor', 'selection_rect', 'gamemode', 'gametype' })
|
|
|
|
|
|
|
|
exec_finder(find_announcements, 'announcements')
|
|
|
|
|
|
|
|
exec_finder(find_d_init, 'd_init')
|
|
|
|
|
|
|
|
exec_finder(find_gview, 'gview')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print('\nCompound globals (need loaded world):\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_world, 'world')
|
|
|
|
|
|
|
|
exec_finder(find_ui, 'ui')
|
|
|
|
|
|
|
|
exec_finder(find_ui_sidebar_menus, 'ui_sidebar_menus')
|
|
|
|
|
|
|
|
exec_finder(find_ui_build_selector, 'ui_build_selector')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print('\nPrimitive globals:\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec_finder(find_ui_menu_width, { 'ui_menu_width', 'ui_area_map_width' })
|
|
|
|
|
|
|
|
exec_finder(find_ui_selected_unit, 'ui_selected_unit')
|
|
|
|
|
|
|
|
exec_finder(find_ui_unit_view_mode, 'ui_unit_view_mode')
|
|
|
|
|
|
|
|
exec_finder(find_ui_look_cursor, 'ui_look_cursor')
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_item_cursor, 'ui_building_item_cursor')
|
|
|
|
|
|
|
|
exec_finder(find_ui_workshop_in_add, 'ui_workshop_in_add')
|
|
|
|
|
|
|
|
exec_finder(find_ui_workshop_job_cursor, 'ui_workshop_job_cursor')
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_in_assign, 'ui_building_in_assign')
|
|
|
|
|
|
|
|
exec_finder(find_ui_building_in_resize, 'ui_building_in_resize')
|
|
|
|
|
|
|
|
exec_finder(find_window_x, 'window_x')
|
|
|
|
|
|
|
|
exec_finder(find_window_y, 'window_y')
|
|
|
|
|
|
|
|
exec_finder(find_window_z, 'window_z')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print('\nDone. Now add newly-found globals to symbols.xml.')
|
|
|
|
searcher:reset()
|
|
|
|
searcher:reset()
|
|
|
|