Commit Graph

103 Commits (797900fefe3c62050c4b162f242890600ef82836)

Author SHA1 Message Date
Agent X 4e96b49182 Revert "Rework First Person FOV"
This reverts commit 2a0af8e216.
2023-12-18 14:27:48 -05:00
Agent X 2a0af8e216 Rework First Person FOV 2023-12-17 23:29:31 -05:00
Agent X 5cb9e25090 Overhaul console logging 2023-11-26 16:49:32 -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
Blockyyy c2c846f650 Expose lvl_set_current_level (#513)
* Expose Initiate_warp

exposed initiate_warp function
exposed WARP_NODE_ constants

* expose lvl_set_current_level

* remove initiate_warp
2023-11-17 18:29:37 -05:00
Blockyyy 5d39741be1 Delete star flags (#501)
* Expose save_file_remove_star_flags

* new packet

added a new packet type and two new functions

* oops

* create packet_save_remove_flag.c

move the new network functions to a new file

* Switch u32 to u8

Switched courseStarsToRemove from u32
 to u8 for consistency

* fixed the function

-Fixed empty save file marked as existing
-Fixed SAVE_FILE_EXISTS flag being deleted
-Fixed removing ALL flags from the remote saves
2023-11-14 20:40:34 -05:00
Agent X ce987ef3dd Add first person functions to Lua 2023-11-12 09:53:08 -05:00
Agent X 802affd839 ENHANCE_LEVEL_TEXTURES and make all DynOS textures overridable in Lua 2023-11-11 12:15:32 -05:00
David Joslin c7edf85ad9 Fix crash in tox_box_move() 2023-11-08 19:55:28 -05:00
Blockyyy 56e7470e7b Exposed warp_special (#493)
Exposes the warp_special function and adds some constants for it

Fixed the crash by making it so a script error happens instead.
2023-11-06 14:59:20 -05:00
Agent X 49bca1cc01 sm64coopdx
Co-Authored-By: Yuyake <140215214+AngelicMiracles@users.noreply.github.com>
Co-Authored-By: FluffaMario <50761036+FluffaMario@users.noreply.github.com>
Co-Authored-By: Gregory Heskett <gheskett@gmail.com>
Co-Authored-By: iZePlayzYT <69536095+iZePlayzYT@users.noreply.github.com>
Co-Authored-By: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-Authored-By: eros71 <16540103+eros71-dev@users.noreply.github.com>
2023-10-30 01:03:36 -04:00
EmeraldLockdown 9b502346a7
Console Overhaul (#490)
Completely redid the console ui to look more like the rest of coop
    Added log_to_console and djui_console_toggle to lua
    Made the keybind to activate it the tilda key (~) instead of ctrl+f1
2023-10-28 00:18:23 -07:00
Isaac0-dev c9e4efdb31
custom level fixes and fixes from other pr (#483)
clean up custom level code
    fixed a bug where custom level course numbers weren't used by dynos warps
    removed a bunch of unused dynos code
    fix demos triggering incorrectly
    allowed the right Ctrl key to be used when opening the in game console
    fixed a softlock that was possible to experience when talking to the snowman in CCM
    fixed the bug where you can permanently lose your cap (bug created by my own PR from beta 32)
    fix the moderator feature I made a while back; I am amazed it even worked at all before
    fixed dynos warp initial actions being skipped (read ec8aabc for explanation)
    completely changed the way star names and course names work
2023-10-27 16:42:27 -07: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
Dominicentek 2629381971
Customizable dialogs (#411)
* add customizable dialogs

* remove testing mod

* add HOOK_ON_DIALOG

* Reset dialog overrides in `network_shutdown`

It may have compile errors idk editing code on phone sucks

* typo smh

* copy over the file from original repo so this fork can be synced

* run autogen again

* actually im stupid
2023-06-18 20:04:39 -07:00
Agent X f1990c618e
Add tons of new save file / star related functions (#419)
These were needed to port interact_star_or_key to Lua but are also just good to have exposed IMO.
2023-06-18 20:04:02 -07:00
Dominicentek 9a065ffced
Expose save_file_is_cannon_unlocked to smlua (#395)
* Update convert_functions.py

* Update save_file.c

* Update save_file.h

* Update cannon_door.inc.c
2023-05-20 20:06:15 -07:00
MysterD 2083242b66 Fixed several crashes and errors found in static analysis 2023-05-15 01:15:20 -07:00
MysterD 8129ab7665 Prevent crashes and hangs 2023-05-13 03:07:20 -07:00
MysterD cc1ec3e81f Prevented hundreds of additional crashes from the Mod API 2023-05-11 20:33:21 -07:00
MysterD f785050ccb Fix more possible crashes 2023-05-11 00:19:01 -07:00
MysterD af01a214ee Fix autogen for AnimationTable 2023-05-10 22:29:39 -07:00
MysterD d30b1e61a6 Add a container to animation tables so that we can track their length and stay in bounds 2023-05-10 20:57:35 -07:00
MysterD 5b108e50e6 Merge branch 'coop' into dev 2023-05-03 01:01:18 -07:00
Agent X 52d70e33a5
Expose some painting functions to Lua (#357)
* Expose some painting functions to Lua

get_painting_warp_node
initiate_painting_warp

* Change initiate_painting_warp u8 to s16

In initiate_painting_warp, pass in -1 to not override the painting index.

* Add sanity checks to get_painting_warp_node

* Add requested changes
2023-05-03 00:54:57 -07:00
Prince Frizzy ee3a7018ab
Adds support for compiling other regions (#378)
* Initial support for compiling with EU.

* Fix EU text.

* JP now compiles, TODO: Fix Autogen to fix JP and fix text in djui.

* audio: Prevent crash in EU.

* audio: Sync EU audio to 60 Hz instead of 50 Hz

* Add logging and remove sanity check to hopefully track EU crash.

* Various improvements for EU

Improve some memory debugging
Improve sound debugging
Initalize some variables in load.c for the sound system
Synchronize the EU cutscenes with the US version.

* Fix credits music playing in EU, Document some EU audio code.

* Autogen now supports version excluded object fields and functions. Reran autogen in accordance.

* Fix some potentional shifting issues due to version differences.

* Decrease the sleep times in some spots, We do not need them to be so long. (#373)

* Add the region to the version string.

---------

Co-authored-by: djoslin0 <djoslin0@users.noreply.github.com>
2023-05-03 00:54:25 -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
MysterD 4566b7ee14 Ripped out discord network system, started re-adding invites 2023-04-15 19:53:34 -07:00
MysterD e7ebce5207 Removed lag compensation functions that shouldn't be added to the Lua API 2023-04-03 21:56:52 -07:00
MysterD fce88728d2 Improve lag compensation 2023-04-03 13:55:03 -07:00
MysterD 6fc711e440 Added smlua_text_utils_get_language() 2023-04-01 00:04:45 -07:00
Agent X 22952dda05
Expose sound_banks_enable/disable to Lua (#311) 2023-03-18 17:12:33 -04: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
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
PeachyPeach 55ed83ddb8
djui_hud_render_texture_tile[_interpolated]; increased GFX pool and main memory pool (#211)
djui_hud_render_texture_tile: allows user to draw a part of a texture instead of the whole texture (tilesets)
    increased GFX pool size from 512kB to 4MB
    increased main memory pool size from ~11MB to 32MB
2022-11-02 19:45:20 -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 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
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
MysterD 933914d984 Add djui_hud_world_pos_to_screen_pos, and render interpolated rect/texture 2022-05-13 19:54:49 -07:00