Commit Graph

131 Commits (bc079903a752f6c2374fc39590062b832624f1e7)

Author SHA1 Message Date
MysterD 6fc711e440 Added smlua_text_utils_get_language() 2023-04-01 00:04:45 -07:00
Agent X 1a86d46d95
Override envfx from Lua (#316)
* Override envfx from Lua

set_override_envfx(-1) to reset override

* Fix type mismatch
2023-03-23 14:46:15 -04:00
Agent X 751dfe61c7
Move everything over (#280) 2023-03-20 22:36:25 -04:00
Agent X 42b43a9b7e
get_ttc_speed_setting and set_ttc_speed_setting (#307) 2023-03-20 20:20:11 -04:00
Agent X 3a45334a3d
Merge pull request #310 from Agent-11/time
get_time()
2023-03-20 19:59:31 -04:00
Agent X 22952dda05
Expose sound_banks_enable/disable to Lua (#311) 2023-03-18 17:12:33 -04:00
Agent X c67b09b77f get_time() 2023-03-14 20:53:23 -04:00
PeachyPeach 1e175b5ce7
Make most used and useful features built-ins (#242)
* made all bools u8 for consistency with fixCollisionBugs
* preview blue coins + visible secrets
* preserve indexing
* star number
* hud cap timer
* red coins radar + secrets radar
* extended pause display
* autogen
* only sDynosBuiltinFuncs is sensitive to indexing
* rebased
2023-02-26 03:15:54 +01:00
Agent X ea7f0a11c2
Small improvements to HUD and new functions (#268)
* Small improvements to HUD and new functions

- Split HUD_DISPLAY_FLAG_CAMERA_AND_POWER into HUD_DISPLAY_FLAG_CAMERA and HUD_DISPLAY_FLAG_POWER
- Added hud_is_hidden()
- Added camera_is_frozen()
- Added extra sanity check to hud.c

* Re-add old flags

* Fixes and improvements

* Mod compatibility
2023-02-21 00:23:15 -05:00
Agent X 4aada40a62
area_create_warp_node and area_get_warp_node* (#270)
* area_get_warp_node*

- Added area_get_warp_node to Lua
- Added area_get_warp_node_from_params to Lua

* area_create_warp_node and warp constants

Here you go Isaac!

* Add object param

* Commits work again, pushing everything else
2023-02-20 21:47:32 -05:00
Isaac0-dev 3f7f5da50e
expose course_is_main_course() to Lua (#282) 2023-02-18 16:23:51 -05:00
Isaac0-dev 2d1cb4712c
add a way to create/modify whirlpools (#267) 2023-02-08 16:40:41 -05:00
Agent X 35f7caecc1
Improvements and optional tweaks (#263)
- Added visibleToEnemies to invisible fields
- Added cur_obj_set_billboard_if_vanilla_cam() which makes trees only billboard if free camera is off
- Added RespawnShellBoxes to gBehaviorValues
- Added pauseExitAnywhere to gLevelValues
- Disabled the power meter chime playing on the main menu whenever disconnecting from a server with low health
2023-02-08 10:51:07 -05:00
Prince Frizzy 523e7842d9
A bunch of LUA autogen additions. (#235)
* A bunch of LUA autogen additions.
- Add support for Vec4f, Vec4s and Mat4 in the autogen.
- Improve error messages for improper argument counts
- Added support for more pointer types in the autogen.

* Fix offsets in sMat4Fields.

* autogen: Rework this at the request of DJ.
2022-11-30 00:37:12 -08: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
MysterD b6b5b4f4e3 Add ability for mods to signal that a player will not be seen by enemies 2022-11-11 19:02:11 -08:00
SMS Alfredo bb00d47cab
Sample Stop Functions (#224)
Adds in bassh_stop_sample for source and audio_sample_stop for Lua. These functions immediately stop whatever audio the specified sample is playing.

If used in tandem with #223, this allows you to create custom character voice clips without them ever overlapping with each other.
2022-11-02 19:51:34 -07:00
Isaac0-dev 89afa8181e
just a few more improvements (#207)
Add get_dialog_box_state
    Prevent some attacks from registering as pvp attacks.
    Clean up all cases of camera.lua
    Put gLastCollectedStarOrKey in a better spot.
    Clean up my moderator code a bit, changing gIsModerator to boolean.
    Brang back kicked, banned and full party messages.
    Fixed a warning on older compilers like raspberry pi's and use configAmountofPlayers instead of MAX_PLAYERS
    Fixed compiling with the flag DISCORD_SDK off.
    Added "Fixed Collisions" to the debug menu.
    Added HMC, CCM, RR, BITDW, PSS and TTC to the main menu options.
    Fix my own oversight; Prevent the port from being duplicated in the join menu. (temporary fix)
    Hopefully bring back the crash handler on windows by not checking for termination signals on windows
2022-10-18 15:34:46 -07:00
wRadion e4e9c02d51
Added `warp_to_warpnode` function (#157)
* Added warp to warp node function

* Added generated docs

* Restored Makefile (will put in other branch)
2022-09-30 20:02:34 -07:00
MysterD 36270e4301 Reran autogen 2022-09-26 19:30:09 -07:00
Agent X 4b84a87c6f
Mod storage, network_discord_id_from_local_index and other small changes (#200)
* Mod storage & network_discord_id_from_local_index

Introducing mod storage, a key/value system for saving things like high scores or settings or anything like that to AppData\Roaming\sm64ex-coop\sav\mod-name.sav (Windows example)
You can currently save only strings meaning if you want to save a number you'd need to do
mod_storage_save("score", tostring(score))
and then
score = tonumber(mod_storage_load("score"))
To handle types like that.
network_discord_id_from_local_index() returns the discord ID of a player by local index.
Some misc changes I made were removing the unsed ini.h include in save_file.c and making the autogen converters output LF line endings instead of CRLF on windows.

* Prevent getting id if using direct connect

* Update djui_panel_player.c

Why does this bother me?

Co-authored-by: djoslin0 <djoslin0@users.noreply.github.com>
2022-09-26 19:28:26 -07:00
Emerald Lockdown 8e9b2c270c
`save_file_erase_current_backup_save` and more (#189) 2022-09-26 19:14:53 -07:00
Agent X 6c0757c908
Color type and palette/color functions (#199)
Added a Color type (typedef u8 Color[3])
Added network_player_color_to_palette and network_player_palette_to_color
Reran autogen
2022-09-26 19:11:51 -07:00
Agent X 1241c56ed9
Expose level_trigger_warp and related constants (#197) 2022-09-19 19:51:27 -07:00
Emerald Lockdown ade3e7b887
Remove save_file_erase function (#195) 2022-09-19 19:33:43 -07:00
Isaac0-dev c7bdeef8d5
multiple improvements (#176) 2022-09-12 20:00:51 -07:00
Emerald Lockdown a864e2d3ba
Add network_is_moderator (#180) 2022-09-12 19:58:58 -07:00
wRadion 94d5dfcf10
Scrolling textures (continued) (#175)
* Handle scroll targets as dynamic array + some error handling

* Remove the need to call init (clean automatically scroll targets)

* Free iteratively instead of recursive

* Added comments + handled some potential errors

* Completed comments

* Remove debug print
2022-09-12 19:57:28 -07:00
wRadion 44bbd23f83
Handle RM_Scroll_Texture and editor_Scroll_Texture behaviors from RM2C hacks (#173) 2022-08-25 17:46:33 -07:00
Agent X cbc78025f3
is_transition_playing() (#171)
Can be useful for people making HUD mods or anything like that.
2022-08-25 17:42:30 -07:00
Emerald Lockdown 748b7e9134
Added `warp_to_start_level` function (#154)
* Added `warp_to_start_level` function

* Fix include things
2022-08-25 17:27:05 -07:00
Isaac0-dev d4417171e4
Improvements (#151)
More lives fixes, death loop fix, add a null check and add get_dialog_id()
add a way to disable rom hack cam collisions
expose more sound management functions
2022-08-25 17:25:54 -07:00
Emerald Lockdown 93bdbf81c3
Expose save star flag (#139)
* added save_file_set_star_flags and save_reload
2022-08-07 20:53:42 -07:00
Emerald Lockdown 670acc638e
Exposed save_file_erase and save_file_reload to lua (#137) 2022-08-07 20:52:51 -07: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 7e7833f676 Unhardcoded more values ; generated more tex files ; special set home function ; fixed lua bhv bugs
Unhardcoded KingBobomb values, Mips values, star dialog values
Generated tex files when they're of the form levels/XXX/NUMBER
Now lua behaviors can call cur_obj_set_home_once() to set home correctly
Lua behaviors are now overridden correctly when created through spawn infos
Behavior checks now translate to the overridden behavior before checking
2022-06-01 23:04:21 -07:00
MysterD 59a36149fe Update autogen 2022-06-01 01:00:21 -07:00
PeachyPeach d1bb79f4a0
Camera config values for lua (#116)
* Added camera config getters and setters
2022-05-22 18:47:36 -07:00
MysterD f5258f2d41 audio_stream_load_url() cleanup 2022-05-21 21:20:02 -07:00
Lord-Giganticus 499518adde
Add function to load music via https URLs (#100) 2022-05-21 21:17:35 -07:00
MysterD de2300f837 Fix clang/mac compile 2022-05-19 19:42:07 -07:00
PeachyPeach 27db236b5d
Various bug fixes + Added is_game_paused() and more background music functions to lua (#93)
Bug: DynOS models with animations cannot swap animations if they are
     loaded via lua (smlua_model_util_get_id and
     obj_set_model_extended).
Fix: DynOS_Actor_GetActorGfx takes a graph node instead of a georef,
     and checks for DynosValidActors graph nodes if georef is NULL.

Bug: The game can crash when calling obj_set_model_extended inside a
     HOOK_ON_OBJECT_RENDER hook.
Fix: The crash happens in smlua_model_util_load_with_pool_and_cache_id
     due to pool being NULL. If the game can't allocate an
     AllocOnlyPool object, use DynOS to generate the graph node.

Bug: warp_to_level and similar functions don't trigger HOOK_ON_WARP.
Fix: Call HOOK_ON_WARP hooks in DynOS_Warp_UpdateWarp and
     DynOS_Warp_UpdateExit after level and mario initialization.

Bug: The game sometimes calls HOOK_ON_OBJECT_RENDER hooks for
     unintended objects.
Fix: Initialize hookRender field to 0 when creating an object.

Bug: Actions can't apply gfx offsets to characters that have an anim
     offset (Waluigi, Wario)
Fix: Add m->curAnimOffset to gfx.pos[1] instead of setting it to
     m->pos[1] + m->curAnimOffset, except during the jumbo star
     cutscene.
2022-05-14 14:28:25 -07:00
Agent X 4bc13ef275
djui_hud_get_raw_mouse_x/y, djui_hud_set_mouse_locked (#91) 2022-05-13 19:55:47 -07:00
MysterD 933914d984 Add djui_hud_world_pos_to_screen_pos, and render interpolated rect/texture 2022-05-13 19:54:49 -07:00
MysterD 725e26fe83 Make bass sound interface easier to handle 2022-05-08 04:04:14 -07:00
MysterD 034ada738c Re-ran autogen 2022-05-08 00:29:17 -07:00
Beyley Thomas b8553162c2
Add basic Bass audio engine (#58) 2022-05-08 00:25:09 -07:00
MysterD ad6642a4bd Add support for custom HUD textures and faster texture packs w/o EXTERNAL_DATA 2022-05-06 22:03:12 -07:00
Agent X 6466fbe457
camera_freeze, camera_unfreeze, djui_hud_get_mouse_x, djui_hud_get_mouse_y, set_override_fov, set_override_near, set_override_far (#74) 2022-04-30 17:36:38 -07:00