diff --git a/docs/index.html b/docs/index.html index 8421275c5..e8393cc8b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -770,6 +770,9 @@
These variables are always there to use.
@@ -4937,6 +4965,12 @@Get the current adventure seed pair
+++Search script examples for get_bucket
+
Returns the Bucket of data stored in shared memory between Overlunky and Playlunky
Search script examples for get_character_heart_color
@@ -4955,7 +4989,7 @@get_frame
Search script examples for get_frame
Get the current global frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps.
+Get the current frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps. This counter is paused if you block PRE_UPDATE from running, and also doesn't increment during some loading screens, even though state update still runs.
Search script examples for get_frametime
@@ -4968,6 +5002,12 @@get_frametime_unfocused
Get engine target frametime when game is unfocused (1/framerate, default 1/33).
+++Search script examples for get_global_frame
+
Get the current global frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps. This counter keeps incrementing when state is updated, even during loading screens.
Search script examples for get_hud
@@ -5285,6 +5325,12 @@set_setting
GAME_SETTING setting, int value)Sets the specified setting temporarily. These values are not saved and might reset to the users real settings if they visit the options menu. (Check example.) All settings are available in unsafe mode and only a smaller subset SAFE_SETTING by default for Hud and other visuals. Returns false, if setting failed.
+set_start_level_paused
+++Search script examples for set_start_level_paused
+nil set_start_level_paused(bool enable)
+Setting to true will stop the state update from unpausing after a screen load, leaving you with state.pause == PAUSE.FADE on the first frame to do what you want.
set_storage_layer
-- Sets the right layer when using the vanilla tile code if waddler is still happy, -- otherwise spawns the floor to the left of this tile. -- Manually spawning FLOOR_STORAGE pre-tilecode doesn't seem to work as expected, @@ -5397,7 +5443,7 @@
ImGuiIO get_io()
- Note: The clicked/pressed actions only make sense in
ON.GUIFRAME
.- Note: Lua starts indexing at 1, you need
-keysdown[string.byte('A') + 1]
to find the A key.- Note: Overlunky/etc will eat all keys it is currently configured to use, your script will only get leftovers.
+- Note: Overlunky/etc will eat all keys it is currently configured to use, your script will only get leftovers.
- Note: Gamepad is basically XINPUT_GAMEPAD but variables are renamed and values are normalized to -1.0..1.0 range.
mouse_position
@@ -5406,24 +5452,6 @@mouse_position
tuple<float, float> mouse_position()
Current mouse cursor position in screen coordinates.
-return_input
---Search script examples for return_input
-nil return_input(int uid)
-Return input previously stolen with steal_input
-send_input
---Search script examples for send_input
-nil send_input(int uid, INPUTS buttons)
-Send input to entity, has to be previously stolen with steal_input
-steal_input
---Search script examples for steal_input
-nil steal_input(int uid)
-Steal input from a Player, HiredHand or PlayerGhost
Lighting functions
create_illumination
Search script examples for create_illumination
@@ -5820,6 +5848,12 @@screen_position
tuple<float, float> screen_position(float x, float y)
Translate an entity position to screen position to be used in drawing functions
+set_camera_position
+++Search script examples for set_camera_position
+nil set_camera_position(float cx, float cy)
+Sets the absolute current camera position without rubberbanding animation. Ignores camera bounds or currently focused uid, but doesn't clear them. Best used in ON.RENDER_PRE_GAME or similar. See Camera for proper camera handling with bounds and rubberbanding.
set_camp_camera_bounds_enabled
Search script examples for set_camp_camera_bounds_enabled
@@ -5831,7 +5865,13 @@zoom
Search script examples for zoom
nil zoom(float level)
-Set the zoom level used in levels and shops. 13.5 is the default.
+Set the zoom level used in levels and shops. 13.5 is the default, or 12.5 for shops. See zoom_reset.
+zoom_reset
+++Search script examples for zoom_reset
+nil zoom_reset()
+Reset the default zoom levels for all areas and sets current zoom level to 13.5.
Room functions
define_room_template
Search script examples for define_room_template
@@ -6486,12 +6526,6 @@set_blood_multiplication
nil set_blood_multiplication(int default_multiplier, int vladscape_multiplier)
This function never worked properly as too many places in the game individually check for vlads cape and calculate the blood multiplication
-default_multiplier
doesn't do anything due to some changes in last game updates,vladscape_multiplier
only changes the multiplier to some entities death's blood spitset_camera_position
---Search script examples for set_camera_position
-nil set_camera_position(float cx, float cy)
-this doesn't actually work at all. See State -> Camera the for proper camera handling
setflag
Search script examples for setflag
@@ -6510,6 +6544,27 @@testflag
+
nil testflag()
steal_input
+++ +Search script examples for steal_input
++
nil steal_input(int uid)
+Deprecated because it's a weird old hack that crashes the game. You can modify inputs in many other ways, like editingstate.player_inputs.player_slot_1.buttons_gameplay
in PRE_UPDATE or aset_pre_process_input
hook. Steal input from a Player, HiredHand or PlayerGhost.return_input
+++ +Search script examples for return_input
++
nil return_input(int uid)
+Return input previously stolen with steal_inputsend_input
+++ +Search script examples for send_input
+
nil send_input(int uid, INPUTS buttons)
+Send input to entity, has to be previously stolen with steal_inputread_input
Search script examples for read_input
@@ -8955,6 +9010,27 @@BackgroundMusic
+ Bucket
+Shared memory structure used for Playlunky-Overlunky interoperability
+ ++
+ + +Type +Name +Description ++ +map<string, any> +data +You can store arbitrary simple values here in Playlunky to be read in on Overlunky script for example. ++ +Overlunky +overlunky +Access Overlunky options here, nil if Overlunky is not loaded. +Color
-- make a semi transparent red color and print it in different formats local color = Color:red() color.a = 0.5 @@ -9425,6 +9501,77 @@
MovableBehavior
Get the +state_id
of a behavior, this is the id that needs to be returned from a behavior'sget_next_state_id
to enter this state, given that the behavior is added to the movable.Overlunky
+Used to get and set Overlunky settings in Bucket
+ ++
+ + +Type +Name +Description ++ +map<string, any> +options +Current Overlunky options. Read only. ++ +map<string, any> +set_options +Write some select options here to change Overlunky options. Just use the same keys as in options. ++ +map<string, KEY> +keys +Current Overlunky key bindings. Read only. You can use this to bind some custom feature to the same unknown key as currently bound by the user. ++ +set<string> +ignore_keys +Disable some key bindings in Overlunky, whatever key they are actually bound to. Remember this might not be bound to the default any more, so only use this if you also plan on overriding the current keybinding, or just need to disable some feature and don't care what key it is bound on. ++ +set<KEY> +ignore_keycodes +Disable keys that may or may not be used by Overlunky. You should probably write the keycodes you need here just in case if you think using OL will interfere with your keybinds. ++ +set<string> +ignore_features +TODO: Disable Overlunky features. Doesn't do anything yet. ++ +int +selected_uid +Currently selected uid in the entity picker or -1 if nothing is selected. ++ +optional<int> +set_selected_uid +Set currently selected uid in the entity picker or -1 to clear selection. ++ +vector<int> +selected_uids +Currently selected uids in the entity finder. ++ +int +hovered_uid +Currently hovered entity uid or -1 if nothing is hovered. ++ +optional<int> +set_selected_uid +Set currently selected uid in the entity picker or -1 to clear selection. ++ +optional<vector<int>> +set_selected_uids +Set currently selected uids in the entity finder. +PRNG
PRNG (short for Pseudo-Random-Number-Generator) holds 10 128bit wide buffers of memory that are mutated on every generation of a random number. The game uses specific buffers for specific scenarios, for example the third buffer is used every time particles are spawned to determine a random velocity. @@ -15923,6 +16070,16 @@
GameManager
main_menu_music + + +array<int, MAX_PLAYERS> +buttons_controls +Yet another place to get player inputs, in some format ++ array<int, MAX_PLAYERS> +buttons_movement +Yet another place to get player inputs, in some format +GameProps
@@ -15935,13 +16092,33 @@
GameProps
+ int buttons -+ Might be used for some menu inputs not found in buttons_menu ++ +int +buttons_extra +Might be used for some menu inputs not found in buttons_menu ++ +MENU_INPUT +buttons_menu_previous +Previous state of buttons_menu ++ MENU_INPUT +buttons_menu +Inputs used to control all the menus, separate from player inputs. You can probably capture and edit this in ON.PRE_UPDATE. + bool game_has_focus + int +modal_open ++ Items
Used in StateMemory
@@ -30177,67 +30354,67 @@INPUTS
NONE -0 +0x0 JUMP -1 +0x1 WHIP -2 +0x2 BOMB -4 +0x4 ROPE -8 +0x8 RUN -16 +0x10 DOOR -32 +0x20 MENU -64 +0x40 JOURNAL -128 +0x80 LEFT -256 +0x100 RIGHT -512 +0x200 UP -1024 +0x400 @@ -30671,6 +30848,29 @@ DOWN -2048 +0x800 JUNGLESISTERS
+ KEY
+++ +Search script examples for KEY
++
+ + +Name +Data +Description ++ +A +65 ++ + +...check lua_enums.txt... ++ + LAYER
Search script examples for LAYER
@@ -31146,6 +31346,69 @@MASK
Value of 0, treated by all the functions as ANY mask +MENU_INPUT
+++ +Search script examples for MENU_INPUT
++
+ + +Name +Data +Description ++ +NONE +0x0 ++ + +SELECT +0x1 ++ + +BACK +0x2 ++ + +DELETE +0x4 ++ + +RANDOM +0x8 ++ + +JOURNAL +0x10 ++ + +LEFT +0x20 ++ + +RIGHT +0x40 ++ + +UP +0x80 ++ + +DOWN +0x100 ++ ON
Search script examples for ON
diff --git a/docs/light.html b/docs/light.html index 2ad0961bf..29bd310c1 100644 --- a/docs/light.html +++ b/docs/light.html @@ -770,6 +770,9 @@get_adventure_seed ++ get_bucket + get_character_heart_color @@ -785,6 +788,9 @@get_frametime_unfocused ++ get_global_frame + get_hud @@ -914,6 +920,9 @@set_setting ++ set_start_level_paused + set_storage_layer @@ -955,15 +964,6 @@mouse_position -- return_input - -- send_input - -- steal_input - @@ -1170,12 +1170,18 @@ screen_position ++ set_camera_position + set_camp_camera_bounds_enabled zoom ++ zoom_reset + @@ -1506,9 +1512,6 @@ set_blood_multiplication -- set_camera_position - setflag @@ -1518,6 +1521,15 @@testflag ++ steal_input + ++ return_input + ++ send_input + read_input @@ -1732,6 +1744,9 @@BackgroundMusic ++ Bucket + Color @@ -1765,6 +1780,9 @@MovableBehavior ++ Overlunky + PRNG @@ -3633,6 +3651,9 @@JUNGLESISTERS ++ KEY + LAYER @@ -3651,6 +3672,9 @@MASK ++ MENU_INPUT + ON @@ -3919,6 +3943,10 @@Aliases
FEAT int; ++ KEY +int; +Global variables
These variables are always there to use.
@@ -4937,6 +4965,12 @@get_adventure_seed
tuple<int, int> get_adventure_seed()
Get the current adventure seed pair
+get_bucket
+++Search script examples for get_bucket
+Bucket get_bucket()
+Returns the Bucket of data stored in shared memory between Overlunky and Playlunky
get_character_heart_color
Search script examples for get_character_heart_color
@@ -4955,7 +4989,7 @@get_frame
Search script examples for get_frame
int get_frame()
-Get the current global frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps.
+Get the current frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps. This counter is paused if you block PRE_UPDATE from running, and also doesn't increment during some loading screens, even though state update still runs.
get_frametime
Search script examples for get_frametime
@@ -4968,6 +5002,12 @@get_frametime_unfocused
optional<double> get_frametime_unfocused()
Get engine target frametime when game is unfocused (1/framerate, default 1/33).
+get_global_frame
+++Search script examples for get_global_frame
+int get_global_frame()
+Get the current global frame count since the game was started. You can use this to make some timers yourself, the engine runs at 60fps. This counter keeps incrementing when state is updated, even during loading screens.
get_hud
Search script examples for get_hud
@@ -5285,6 +5325,12 @@set_setting
GAME_SETTING setting, int value)Sets the specified setting temporarily. These values are not saved and might reset to the users real settings if they visit the options menu. (Check example.) All settings are available in unsafe mode and only a smaller subset SAFE_SETTING by default for Hud and other visuals. Returns false, if setting failed.
+set_start_level_paused
+++Search script examples for set_start_level_paused
+nil set_start_level_paused(bool enable)
+Setting to true will stop the state update from unpausing after a screen load, leaving you with state.pause == PAUSE.FADE on the first frame to do what you want.
set_storage_layer
-- Sets the right layer when using the vanilla tile code if waddler is still happy, -- otherwise spawns the floor to the left of this tile. -- Manually spawning FLOOR_STORAGE pre-tilecode doesn't seem to work as expected, @@ -5397,7 +5443,7 @@
ImGuiIO get_io()
- Note: The clicked/pressed actions only make sense in
ON.GUIFRAME
.- Note: Lua starts indexing at 1, you need
-keysdown[string.byte('A') + 1]
to find the A key.- Note: Overlunky/etc will eat all keys it is currently configured to use, your script will only get leftovers.
+- Note: Overlunky/etc will eat all keys it is currently configured to use, your script will only get leftovers.
- Note: Gamepad is basically XINPUT_GAMEPAD but variables are renamed and values are normalized to -1.0..1.0 range.
mouse_position
@@ -5406,24 +5452,6 @@mouse_position
tuple<float, float> mouse_position()
Current mouse cursor position in screen coordinates.
-return_input
---Search script examples for return_input
-nil return_input(int uid)
-Return input previously stolen with steal_input
-send_input
---Search script examples for send_input
-nil send_input(int uid, INPUTS buttons)
-Send input to entity, has to be previously stolen with steal_input
-steal_input
---Search script examples for steal_input
-nil steal_input(int uid)
-Steal input from a Player, HiredHand or PlayerGhost
Lighting functions
create_illumination
Search script examples for create_illumination
@@ -5820,6 +5848,12 @@screen_position
tuple<float, float> screen_position(float x, float y)
Translate an entity position to screen position to be used in drawing functions
+set_camera_position
+++Search script examples for set_camera_position
+nil set_camera_position(float cx, float cy)
+Sets the absolute current camera position without rubberbanding animation. Ignores camera bounds or currently focused uid, but doesn't clear them. Best used in ON.RENDER_PRE_GAME or similar. See Camera for proper camera handling with bounds and rubberbanding.
set_camp_camera_bounds_enabled
Search script examples for set_camp_camera_bounds_enabled
@@ -5831,7 +5865,13 @@zoom
Search script examples for zoom
nil zoom(float level)
-Set the zoom level used in levels and shops. 13.5 is the default.
+Set the zoom level used in levels and shops. 13.5 is the default, or 12.5 for shops. See zoom_reset.
+zoom_reset
+++Search script examples for zoom_reset
+nil zoom_reset()
+Reset the default zoom levels for all areas and sets current zoom level to 13.5.
Room functions
define_room_template
Search script examples for define_room_template
@@ -6486,12 +6526,6 @@set_blood_multiplication
nil set_blood_multiplication(int default_multiplier, int vladscape_multiplier)
This function never worked properly as too many places in the game individually check for vlads cape and calculate the blood multiplication
-default_multiplier
doesn't do anything due to some changes in last game updates,vladscape_multiplier
only changes the multiplier to some entities death's blood spitset_camera_position
---Search script examples for set_camera_position
-nil set_camera_position(float cx, float cy)
-this doesn't actually work at all. See State -> Camera the for proper camera handling
setflag
Search script examples for setflag
@@ -6510,6 +6544,27 @@testflag
+
nil testflag()
steal_input
+++ +Search script examples for steal_input
++
nil steal_input(int uid)
+Deprecated because it's a weird old hack that crashes the game. You can modify inputs in many other ways, like editingstate.player_inputs.player_slot_1.buttons_gameplay
in PRE_UPDATE or aset_pre_process_input
hook. Steal input from a Player, HiredHand or PlayerGhost.return_input
+++ +Search script examples for return_input
++
nil return_input(int uid)
+Return input previously stolen with steal_inputsend_input
+++ +Search script examples for send_input
+
nil send_input(int uid, INPUTS buttons)
+Send input to entity, has to be previously stolen with steal_inputread_input
Search script examples for read_input
@@ -8955,6 +9010,27 @@BackgroundMusic
+ Bucket
+Shared memory structure used for Playlunky-Overlunky interoperability
+ ++
+ + +Type +Name +Description ++ +map<string, any> +data +You can store arbitrary simple values here in Playlunky to be read in on Overlunky script for example. ++ +Overlunky +overlunky +Access Overlunky options here, nil if Overlunky is not loaded. +Color
-- make a semi transparent red color and print it in different formats local color = Color:red() color.a = 0.5 @@ -9425,6 +9501,77 @@
MovableBehavior
Get the +state_id
of a behavior, this is the id that needs to be returned from a behavior'sget_next_state_id
to enter this state, given that the behavior is added to the movable.Overlunky
+Used to get and set Overlunky settings in Bucket
+ ++
+ + +Type +Name +Description ++ +map<string, any> +options +Current Overlunky options. Read only. ++ +map<string, any> +set_options +Write some select options here to change Overlunky options. Just use the same keys as in options. ++ +map<string, KEY> +keys +Current Overlunky key bindings. Read only. You can use this to bind some custom feature to the same unknown key as currently bound by the user. ++ +set<string> +ignore_keys +Disable some key bindings in Overlunky, whatever key they are actually bound to. Remember this might not be bound to the default any more, so only use this if you also plan on overriding the current keybinding, or just need to disable some feature and don't care what key it is bound on. ++ +set<KEY> +ignore_keycodes +Disable keys that may or may not be used by Overlunky. You should probably write the keycodes you need here just in case if you think using OL will interfere with your keybinds. ++ +set<string> +ignore_features +TODO: Disable Overlunky features. Doesn't do anything yet. ++ +int +selected_uid +Currently selected uid in the entity picker or -1 if nothing is selected. ++ +optional<int> +set_selected_uid +Set currently selected uid in the entity picker or -1 to clear selection. ++ +vector<int> +selected_uids +Currently selected uids in the entity finder. ++ +int +hovered_uid +Currently hovered entity uid or -1 if nothing is hovered. ++ +optional<int> +set_selected_uid +Set currently selected uid in the entity picker or -1 to clear selection. ++ +optional<vector<int>> +set_selected_uids +Set currently selected uids in the entity finder. +PRNG
PRNG (short for Pseudo-Random-Number-Generator) holds 10 128bit wide buffers of memory that are mutated on every generation of a random number. The game uses specific buffers for specific scenarios, for example the third buffer is used every time particles are spawned to determine a random velocity. @@ -15923,6 +16070,16 @@
GameManager
main_menu_music + + +array<int, MAX_PLAYERS> +buttons_controls +Yet another place to get player inputs, in some format ++ array<int, MAX_PLAYERS> +buttons_movement +Yet another place to get player inputs, in some format +GameProps
@@ -15935,13 +16092,33 @@
GameProps
+ int buttons -+ Might be used for some menu inputs not found in buttons_menu ++ +int +buttons_extra +Might be used for some menu inputs not found in buttons_menu ++ +MENU_INPUT +buttons_menu_previous +Previous state of buttons_menu ++ MENU_INPUT +buttons_menu +Inputs used to control all the menus, separate from player inputs. You can probably capture and edit this in ON.PRE_UPDATE. + bool game_has_focus + int +modal_open ++ Items
Used in StateMemory
@@ -30177,67 +30354,67 @@INPUTS
NONE -0 +0x0 JUMP -1 +0x1 WHIP -2 +0x2 BOMB -4 +0x4 ROPE -8 +0x8 RUN -16 +0x10 DOOR -32 +0x20 MENU -64 +0x40 JOURNAL -128 +0x80 LEFT -256 +0x100 RIGHT -512 +0x200 UP -1024 +0x400 @@ -30671,6 +30848,29 @@ DOWN -2048 +0x800 JUNGLESISTERS
+ KEY
+++ +Search script examples for KEY
++
+ + +Name +Data +Description ++ +A +65 ++ + +...check lua_enums.txt... ++ + LAYER
Search script examples for LAYER
@@ -31146,6 +31346,69 @@MASK
Value of 0, treated by all the functions as ANY mask +MENU_INPUT
+++ +Search script examples for MENU_INPUT
++
+ + +Name +Data +Description ++ +NONE +0x0 ++ + +SELECT +0x1 ++ + +BACK +0x2 ++ + +DELETE +0x4 ++ + +RANDOM +0x8 ++ + +JOURNAL +0x10 ++ + +LEFT +0x20 ++ + +RIGHT +0x40 ++ + +UP +0x80 ++ + +DOWN +0x100 ++ ON
Search script examples for ON