Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into online-compat-stuff-pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanfer committed Dec 4, 2024
2 parents bb21ded + f6b2bbb commit bb18b48
Show file tree
Hide file tree
Showing 61 changed files with 622 additions and 485 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Lua scripting is still buggy and unfinished and the **API might change**, althou
+ See previous section.
+ Some entities just crash the game, try to avoid them next time.
+ Some script mods just crash the game too. Complain to the author of the mod.
- If you have proglems with **Modlunky2 or Playlunky**:
- If you have problems with **Modlunky2 or Playlunky**:
+ While we try to keep all the modding tools compatible, some things may break sometimes.
+ Because PL and OL are using the same scripting API, one might inadvertently undo the change you did in the other. Don't expect perfection when using both.
- If you're **missing** some overlay **windows** or tabs:
Expand All @@ -166,7 +166,7 @@ Lua scripting is still buggy and unfinished and the **API might change**, althou
+ Make sure Windows is not using the keys for [something stupid](https://superuser.com/questions/1367843/how-to-disable-ctrlshift-keyboard-layout-switch-for-the-same-input-language-i).
- If it still doesn't work
+ Stop by #s2-modding-help on the [community Discord](https://discord.gg/spelunky-community) or [submit an issue](https://github.com/spelunky-fyi/overlunky/issues)
+ We want to know your OS version, are you using the game on Steam, what you have tried, what tools you are using, how you are using them and all the versions. These can be found in the terminal output or ingame overlays. ("Latest" or WHIP is not a version, but 7f0bc94 or 0.6.1 is.)
+ We want to know your OS version, are you using the game on Steam, what you have tried, what tools you are using, how you are using them and all the versions. These can be found in the terminal output or in-game overlays. ("Latest" or WHIP is not a version, but 7f0bc94 or 0.6.1 is.)


## Development
Expand Down
120 changes: 62 additions & 58 deletions docs/game_data/spel2.lua

Large diffs are not rendered by default.

166 changes: 98 additions & 68 deletions docs/index.html

Large diffs are not rendered by default.

166 changes: 98 additions & 68 deletions docs/light.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/includes/_casting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For reference, the available `as_<typename>` functions are listed below:
- as_bgmovingstar
- as_bgrelativeelement
- as_bgshootingstar
- as_bgshopentrence
- as_bgshopentrance
- as_bgshopkeeperprime
- as_bgsurfacelayer
- as_bgsurfacestar
Expand Down
18 changes: 10 additions & 8 deletions docs/src/includes/_enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Name | Data | Description

Name | Data | Description
---- | ---- | -----------
[NONE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.NONE) | CORNER_FINISH::NONE | Don't draw corner at all, will draw lines as separate pieces, overlaping etc.<br/>
[NONE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.NONE) | CORNER_FINISH::NONE | Don't draw corner at all, will draw lines as separate pieces, overlapping etc.<br/>
[REAL](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.REAL) | CORNER_FINISH::REAL | Draws a real corner, no matter how far away the "peak" of the corner may end up being<br/>
[CUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.CUT) | CORNER_FINISH::CUT | Instead of drawing a sharp point at the end of the corner, it just cuts it flat<br/>
[ADAPTIVE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.ADAPTIVE) | CORNER_FINISH::ADAPTIVE | Default<br/>similar to REAL but for low angles reduces the size of the "peak" of the corner<br/>
Expand Down Expand Up @@ -240,6 +240,8 @@ Name | Data | Description
[TRIGGER_ACTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.TRIGGER_ACTION) | 24 |
[ACTIVATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.ACTIVATE) | 25 |
[ON_COLLISION2](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.ON_COLLISION2) | 26 |
[GET_METADATA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.GET_METADATA) | 27 |
[APPLY_METADATA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.APPLY_METADATA) | 28 |
[WALKED_ON](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.WALKED_ON) | 29 |
[WALKED_OFF](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.WALKED_OFF) | 30 |
[LEDGE_GRAB](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.LEDGE_GRAB) | 31 |
Expand Down Expand Up @@ -897,20 +899,20 @@ Name | Data | Description
[TOAST](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.TOAST) | ON::TOAST | Params: string text<br/>Runs before any toast is created, even the one using [toast](#toast) function<br/>Return: if you don't return anything it will execute the toast function normally with default message<br/>if you return empty string, it will not create the toast at all, if you return string, it will use that instead of the original message<br/>The first script to return string (empty or not) will take priority, the rest will receive callback call but the return behavior won't matter<br/>
[DEATH_MESSAGE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.DEATH_MESSAGE) | ON::DEATH_MESSAGE | Params: [STRINGID](#Aliases) id<br/>Runs once after death when the death message journal page is shown. The parameter is the [STRINGID](#Aliases) of the title, like 1221 for BLOWN UP.<br/>
[PRE_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LOAD_JOURNAL_CHAPTER) | ON::PRE_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter<br/>Runs before the journal or any of it's chapter is opened<br/>Return: return true to not load the chapter (or journal as a whole)<br/>
[POST_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LOAD_JOURNAL_CHAPTER) | ON::POST_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages<br/>Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it<br/>All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE<br/>Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was aready loaded will result in the standard game page<br/>When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...<br/>
[POST_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LOAD_JOURNAL_CHAPTER) | ON::POST_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages<br/>Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it<br/>All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE<br/>Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was already loaded will result in the standard game page<br/>When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...<br/>
[PRE_GET_FEAT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_GET_FEAT) | ON::PRE_GET_FEAT | Runs before getting performed status for a [FEAT](#Aliases) when rendering the Feats page in journal.<br/>Return: true to override the vanilla feat with your own. Defaults to Steam GetAchievement.<br/>
[PRE_SET_FEAT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_SET_FEAT) | ON::PRE_SET_FEAT | Runs before the game sets a vanilla feat performed.<br/>Return: true to block the default behaviour of calling Steam SetAchievement.<br/>
[PRE_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_UPDATE) | ON::PRE_UPDATE | Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS<br/>Return behavior: return true to stop futher PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)<br/>
[PRE_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_UPDATE) | ON::PRE_UPDATE | Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS<br/>Return behavior: return true to stop further PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)<br/>
[POST_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_UPDATE) | ON::POST_UPDATE | Runs right after the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS<br/>
[USER_DATA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.USER_DATA) | ON::USER_DATA | Params: [Entity](#Entity) ent<br/>Runs on all changes to [Entity](#Entity).user_data, including after loading saved user_data in the next level and transition. Also runs the first time user_data is set back to nil, but nil won't be saved to bother you on future levels.<br/>
[PRE_LEVEL_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_CREATION) | ON::PRE_LEVEL_CREATION | Runs right before the front layer is created. Runs in all screens that usually have entities, or when creating a layer manually.<br/>
[POST_LEVEL_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_CREATION) | ON::POST_LEVEL_CREATION | Runs right after the back layer has been created and you can start spawning entities in it. Runs in all screens that usually have entities, or when creating a layer manually.<br/>
[PRE_LAYER_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_CREATION) | ON::PRE_LAYER_CREATION | Params: [LAYER](#LAYER) layer<br/>Runs right before a layer is created. Runs in all screens that usually have entities, or when creating a layer manually.<br/>
[POST_LAYER_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_CREATION) | ON::POST_LAYER_CREATION | Params: [LAYER](#LAYER) layer<br/>Runs right after a layer has been created and you can start spawning entities in it. Runs in all screens that usually have entities, or when creating a layer manually.<br/>
[PRE_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_DESTRUCTION) | ON::PRE_LEVEL_DESTRUCTION | Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.<br/>
[POST_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_DESTRUCTION) | ON::POST_LEVEL_DESTRUCTION | Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.<br/>
[PRE_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_DESTRUCTION) | ON::PRE_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer<br/>Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.<br/>
[POST_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_DESTRUCTION) | ON::POST_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer<br/>Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.<br/>
[PRE_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_DESTRUCTION) | ON::PRE_LEVEL_DESTRUCTION | Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.<br/>
[POST_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_DESTRUCTION) | ON::POST_LEVEL_DESTRUCTION | Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.<br/>
[PRE_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_DESTRUCTION) | ON::PRE_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer<br/>Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.<br/>
[POST_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_DESTRUCTION) | ON::POST_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer<br/>Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.<br/>
[PRE_PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_PROCESS_INPUT) | ON::PRE_PROCESS_INPUT | Runs right before the game gets input from various devices and writes to a bunch of buttons-variables. Return true to disable all game input completely.<br/>
[POST_PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_PROCESS_INPUT) | ON::POST_PROCESS_INPUT | Runs right after the game gets input from various devices and writes to a bunch of buttons-variables. Probably the first chance you have to capture or edit buttons_gameplay or buttons_menu sort of things.<br/>
[PRE_GAME_LOOP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_GAME_LOOP) | ON::PRE_GAME_LOOP | Runs right before the main engine loop. Return true to block state updates and menu updates, i.e. to pause inside menus.<br/>
Expand Down Expand Up @@ -1677,7 +1679,7 @@ Name | Data | Description
[COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.COLOR) | WorldShader::Colors | Renders a solid color<br/>
[TEXTURE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE) | WorldShader::Texture | Renders a texture without applying the given color<br/>
[TEXTURE_ALPHA_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_ALPHA_COLOR) | WorldShader::TextureAlphaColor | Renders a texture by interpreting its red channel as alpha and applying the given color<br/>
[TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLOR) | WorldShader::TextureColor | The default shader to be used, just renders a texture with transparancy and the given color<br/>
[TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLOR) | WorldShader::TextureColor | The default shader to be used, just renders a texture with transparency and the given color<br/>
[TEXTURE_COLORS_WARP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLORS_WARP) | WorldShader::TextureColorsWarp | Renders the texture, with "gamma correction" of the color channels and multiplying everything by the input color alpha only<br/>
[DEFERRED_COLOR_TRANSPARENT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.DEFERRED_COLOR_TRANSPARENT) | WorldShader::DeferredColorTransparent | Basically same as COLOR but goes through the deferred pipeline<br/>
[DEFERRED_TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.DEFERRED_TEXTURE_COLOR) | WorldShader::DeferredTextureColor | Basically same as TEXTURE_COLOR but goes through the deferred pipeline<br/>
Expand Down
Loading

0 comments on commit bb18b48

Please sign in to comment.