Commit graph

79 commits

Author SHA1 Message Date
Isaac0-dev
4aa2a20f72
fixes, clean up and some new features (#259)
- Only inited `smlua_audio_utils` if needed, since there will probably be plenty of people who play without ever using mods with custom audio.
- Fixed the pause anywhere setting - this ended up not being fully accurate to ex-coop, which it was originally intended to be.
- Stopped regenerating dynos collision bin on start up every time therefore giving a slight start up speed boost for some people.
- Added a config file setting that lets people choose to compress dynos bins on startup (disabled by default).
- Fixed a warning that shows on non macs during compiling.
- Properly fixed the chat box focus.
- Made the public lobby rules panel "temporary".
- Added a cleaner loading screen design.
- Added an ex-coop theme easter egg, can only be activated from the config file.
- Cleaned up the Lua traceback logging, now shows the folder and file the error occurred in, rather than the full path.
- Added a way to set `gCheckingSurfaceCollisionsForCamera`, so mods can specify to surface finding functions to ignore `SURFACE_FLAG_NO_CAM_COLLISION` internally.
- Rewrote the way smlua pushes CObjects/CPointers to Lua. Now using the C Lua API entirely to connect to Lua.
	- Fixed a use-after-free bug that could easily crash the game through Lua (explained further in one of my comments below).
- Fixed a common crash in `audio_sanity_check`.
2024-09-12 19:09:01 +10:00
Agent X
8a5a23a8a6 Add HOOK_ON_MODS_LOADED 2024-06-29 16:00:42 -04:00
PeachyPeach
dc02aa9881
Make compiled lua load again (#80) 2024-06-27 10:19:29 +10:00
Agent X
565e8b6367 DJUI fixes and changes 2024-06-26 18:51:11 -04:00
PeachyPeach
c4214ed2da
Prevent the game from caching downloaded WIP mods (#69)
* don't tmp or cache wip mods

* update
2024-06-23 11:54:07 -04:00
Agent X
7c01e405e0 Allow mods to do -- ignore-script-warnings: true 2024-06-09 09:31:48 -04:00
Agent X
6305c20410 Add 'script warnings' for using deprecated functions, add new Discord ID function 2024-06-05 18:58:38 -04:00
Agent X
bdd427c561 Touch up mod storage and fix inconsistent logic with old mod_storage_load 2024-06-02 18:15:17 -04:00
Agent X
9cbf364113 Fix colored mod names leaking into script error message 2024-04-28 09:37:21 -04:00
Isaac0-dev
4473bfffe9
removed bass, replaced with miniaudio (#8) 2024-03-23 16:14:53 -04:00
jayden
216a6db872 let luac files actually run 2023-12-30 19:26:04 +00:00
jayden
eaba7e8010 fix lua error handling 2023-12-26 23:11:02 +00:00
Agent X
4e63798f00 Rewrite Lua autoexec
Now put autoexec.lua in one of the mods folders, it now has all of the capabilities of a full mod without the crashes and weird bugs, which is pretty awesome.
2023-12-07 18:05:37 -05:00
Agent X
ae3271d98a Path check autoexec.lua 2023-12-06 21:06:24 -05:00
Agent X
bdccde902e Bring back some dev commands and add autoexec.lua
Make an autoexec.lua file in the same directory as your exe folder and the game will execute it if DEVELOPMENT=1
2023-12-06 19:20:58 -05:00
Agent X
22ac33d3f3 Make dev chat commands less dangerous
(Remove /lua commands)
2023-11-29 22:46:29 -05:00
Sunk
a85c8dbbf8 Create hook_exclamation_box in place of set_exclamation_box_contents (#524)
* Revert set_exclamation_box_contents()

In favor of the hook

* Create `hook_exclamation_box`
2023-11-21 17:22:54 -05:00
PeachyPeach
610bdfcf04
fix C string typing (#459) 2023-08-18 18:31:59 +02:00
Sunk
c428612a9e
Add set_exclamation_box_contents() (#445)
* Properly set Mario's y vel to 0 on popping

* Change 0 to 0.0f, just in case

* Re-introduce a few vanilla bugs under gBehaviorValues

The Shell Mario glitch was patched as a side effect to patching a different bug, but several romhacks use it so I need it back.
The ability to collect multiple normal caps at once is needed for hat-in-hand using the hat factory glitch.

* Fix Shell Mario fix

Found the actual reason why the glitch doesn't work and figured that this change shouldn't affect anything else, so I removed its entry from gBehaviorValues.

* Add InfiniteRenderDistance to gBehaviorValues

I'm well aware that disabling the infinite render distance will be very desync prone, however a few glitches, most notably cloning and chuckya double jump, need objects load and unload from render distance.

* Allow mods to disable the camera centering from romhack camera

* Allow mods to disable romhack camera centering

Done again

* Update on network shutdown

* Remove a line which I have no idea why it returned

* Add set_exclamation_box_contents()

No way this is memory safe or even well made but I did what I could

* Added (most of) peachy's suggestions

Still need to figure out how to stop the game from reading further than the size of the array without using a hardcoded number

* Added more of peachy's suggestions

I figured a good way to cap how far the exclamation box reads is to pass in the length of the array as well
2023-07-18 18:18:02 -04:00
Agent X
ed60d53ab3
Mod Storage C++ (#448)
* Mod Storage C++

* Implement Peachy's suggestions.

Thank you Peachy.
2023-07-18 17:52:11 -04:00
MysterD
aaa23a8394 lol whoops 2023-06-24 17:54:26 -07:00
MysterD
0bb8d6b5cd Revert Lua GC settings to defaults 2023-06-24 17:49:19 -07:00
MysterD
f04be96225 Cleanup 2023-06-11 14:41:14 -07:00
PeachyPeach
175dbada5a
Various checks for binary lua files (#397)
* various checks for binary lua files

* endianness
2023-06-11 14:36:15 -07:00
MysterD
93020c04e5 Prevent broken mods from messing up the sync table of others 2023-05-17 00:01:09 -07:00
MysterD
18bf5847a2 Prevent rending of corrupted graphnodes, only run lua GC once per frame 2023-05-16 21:49:13 -07:00
MysterD
688cd3b399 Rewrite how models are loaded and retrieved... yet again 2023-05-16 00:01:10 -07:00
PeachyPeach
2aa6e1aa08
custom animations no dynos (#371)
Load animations with smlua_anim_util_register_animation and set them with smlua_anim_util_set_animation.
2023-04-28 21:00:17 -07:00
PeachyPeach
df248e5139
Adding hazardType to HOOK_ALLOW_HAZARD_SURFACE; more loading info (#355) 2023-04-23 12:11:56 -04:00
PeachyPeach
999ea1dd42
Expose globally custom behaviors defined with hook_behavior (#345)
* Expose globally custom behaviors defined with hook_behavior; macros for mod strings max length

* fixes

* made customBehaviorIndex a mod field to be more relevant
2023-04-17 21:54:55 -07:00
PeachyPeach
b738cf73f9
/luaf; fix compilation issues with audio and debug + dev (#328)
/luaf command to execute lua code from a file. Note that this command doesn't load the file the same way mod files are loaded, so no access to gGlobalSyncTable and gPlayerSyncTable. hook_chat_command cannot be called, but hook_event can.

Fix some compilation issues
2023-03-27 15:50:49 -07:00
Isaac0-dev
6cb1b2faec
Beta 32.0.1 (#325)
* patch for beta 32

* require the development flag for Lua profiler

* autogen
2023-03-26 01:15:28 -04:00
Agent X
0c7de174d2 Add /lua to chat commands with dev flag 2023-03-08 19:26:03 -05:00
Agent X
36bda742cd Revert "smlua_exec_str (run Lua from string)"
This reverts commit b32ab212a9.
2023-03-08 19:04:32 -05:00
Agent X
b32ab212a9 smlua_exec_str (run Lua from string)
Seemed useful for debug or any other purposes, why not?
2023-03-08 18:54:06 -05:00
Prince Frizzy
f815a53080
Add some new LUA helper functions and fix some bugs. (#230)
- Add new functions for objects, Feel free to flesh some out if need be.
- Fix long-standing issue with our LUA garbage collection, It will now run after all our hooks do to prevent buildup which causes lag.
2022-11-12 05:01:50 -08:00
Prince Frizzy
913f41f6ae
Add some more functions for use in LUA, And expose others. (#129)
* Add some functions, and restore one.
2022-08-05 22:17:05 -07:00
MysterD
946f16329c Added ability to have completely custom levels that don't override anything 2022-06-05 21:55:31 -07:00
MysterD
c942b8496a Clear custom actors on disconnect properly 2022-05-30 00:37:14 -07:00
MysterD
897f6712a3 Reset hardcoded values on disconnect 2022-05-17 01:22:45 -07:00
MysterD
d7bf47c5de Clear hooks on lua shutdown 2022-05-09 09:53:14 -07:00
MysterD
d75b0e9133 Started working toward allowing disconnection 2022-05-09 07:27:47 -07:00
MysterD
d206581c87 Fix error cascade when one mod has script errors 2022-04-22 23:42:03 -07:00
MysterD
174e3d97ed Made Lua errors show a backtrace for almost all cases 2022-04-22 23:31:25 -07:00
MysterD
ef7dc41560 Added HOOK_ON_DEATH 2022-04-21 18:34:12 -07:00
MysterD
21dc525a75 Slight adjustment to script error message 2022-04-16 22:50:23 -07:00
MysterD
12ea360360 Display a message on screen when script errors are found 2022-04-16 22:47:16 -07:00
MysterD
202315f260 Rewrite of hash/cache system 2022-04-16 13:05:10 -07:00
MysterD
81870df88b Remove certain default Lua functions 2022-04-13 00:38:01 -07:00
MysterD
2c187bba45 Added default volume support for custom sequences 2022-04-10 09:47:17 -07:00