Commit Graph

36 Commits (7a140feb34c7bf2fc2026fa3a64ab821aaaae45f)

Author SHA1 Message Date
Isaac0-dev 2d6c3b6cb1 add djui_open_pause_menu() (#391) 2023-05-11 06:10:25 -04:00
Prince Frizzy 9a4598bb3e Name more audio code and variables, Document some others. (#386) 2023-05-10 14:31:58 -07:00
PeachyPeach 4a8f1dbb5d better kick/punch/trip, gp and flying detection (#388) 2023-05-09 15:38:29 -04:00
Agent X 38cef3b77e 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
Marioiscool246 408b2848df Add fov adjustment to djui_hud_world_pos_to_screen_pos (#374)
* Add fov adjustment to djui_hud_world_pos_to_screen_pos
sFOVState is now a global (gFOVState)
djui_hud_world_pos_to_screen_pos now returns false if the position is behind the camera

* Fix aspect ratio parentheses

* Rerun autogen

---------

Co-authored-by: Marioiscool246 <marioiscool101@gmail.com>
2023-04-30 22:54:55 -04:00
MysterD 8e54677c39 Made nametags mod interpolate names and health 2023-04-24 16:45:25 -07:00
PeachyPeach 53cfe50052 djui_hud_set_rotation (#356)
* djui_hud_set_rotation

* some goddard textures
2023-04-24 06:34:21 -04:00
MysterD f2591bd5b4 Ripped out discord network system, started re-adding invites 2023-04-15 19:53:34 -07:00
MysterD 9f9dfa53a3 Removed lag compensation functions that shouldn't be added to the Lua API 2023-04-03 21:56:52 -07:00
MysterD ede53830b6 Improve lag compensation 2023-04-03 13:55:03 -07:00
MysterD 9f60ae5123 Added FONT_TINY 2023-04-02 23:02:14 -07:00
Agent X 33585f00ea Move everything over (#280) 2023-03-20 22:36:25 -04:00
Agent X deb6ab7804 Expose sound_banks_enable/disable to Lua (#311) 2023-03-18 17:12:33 -04:00
Agent X 083dc1a037 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 d16468b37e 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 12b9fea632 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 4e35b9c4d4 Add ability for mods to signal that a player will not be seen by enemies 2022-11-11 19:02:11 -08:00
MysterD 9ef643e63b Reran autogen 2022-09-26 19:30:09 -07:00
Agent X 9191de2436 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 ed9023d781 `save_file_erase_current_backup_save` and more (#189) 2022-09-26 19:14:53 -07:00
Agent X 29cd726d18 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 05b2dcbefe Expose level_trigger_warp and related constants (#197) 2022-09-19 19:51:27 -07:00
Isaac0-dev 184344afc4 multiple improvements (#176) 2022-09-12 20:00:51 -07:00
Emerald Lockdown 3738ab43cf Add network_is_moderator (#180) 2022-09-12 19:58:58 -07:00
Isaac0-dev 878e974626 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
Prince Frizzy b87fb12f71 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 1224dec362 Update autogen 2022-06-01 01:00:21 -07:00
MysterD 57b507ba1d Consider all walls when doing quarter steps (fixCollisionBugs) 2022-05-31 08:44:18 -07:00
MysterD 5fc6bb0491 Fix clang/mac compile 2022-05-19 19:42:07 -07:00
PeachyPeach 18503ecc52 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 90f5fc3a08 djui_hud_get_raw_mouse_x/y, djui_hud_set_mouse_locked (#91) 2022-05-13 19:55:47 -07:00
MysterD 83f441cd4e Add djui_hud_world_pos_to_screen_pos, and render interpolated rect/texture 2022-05-13 19:54:49 -07:00
MysterD e1fd969cf3 Add support for custom HUD textures and faster texture packs w/o EXTERNAL_DATA 2022-05-06 22:03:12 -07:00
Agent X cad4930a73 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
PeachyPeach 6d360f259c Changes in level_info; play_transition; dev-only warp command; bug fix for moving sounds played via lua (#69)
Improved level_info.c and added functions to LUA:
        const char *get_level_name_ascii(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase):
            Return a level name as an ascii string. If charCase is 1, capitalize all letters.
            If charCase is -1, decapitalize all letters except the first one of each word.
        const u8 *get_level_name_sm64(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase):
            Return a level name as an sm64 u8 string.
            If charCase is 1, capitalize all letters.
            If charCase is -1, decapitalize all letters except the first one of each word.
        const char *get_level_name(s16 courseNum, s16 levelNum, s16 areaIndex):
            Shortcut for get_level_name_ascii(courseNum, levelNum, areaIndex, -1).
        const char *get_star_name_ascii(s16 courseNum, s16 starNum, s16 charCase):
            Return a star name as an ascii string.
            If charCase is 1, capitalize all letters.
            If charCase is -1, decapitalize all letters except the first one of each word.
        const u8 *get_star_name_sm64(s16 courseNum, s16 starNum, s16 charCase):
            Return a star name as an sm64 u8 string.
            If charCase is 1, capitalize all letters.
            If charCase is -1, decapitalize all letters except the first one of each word.
        const char *get_star_name(s16 courseNum, s16 starNum):
            Shortcut for get_star_name_ascii(courseNum, starNum, -1).

    Added play_transition function to LUA.
        I chose to copy the function declaration to smlua_misc_utils.h instead of adding area.h
        to the autogen tool, as most structures, variables and functions in area.h aren't meant
        to be used by LUA scripts.

    Added a dev-only warp chat command.
        This command signature is /warp [LEVEL] [AREA] [ACT]. Level can be either a number
            or a shorthand name (bob, wf, ccm...). Area and Act are numbers.
        This command is available only when building the game with DEBUG and DEVELOPMENT.
        This command cannot be used if hosting through Discord.

    Fixed a bug with moving sounds when they are played via a lua script.
        Bug: Moving sounds (including terrain sounds, flying sound, quicksand sound)
            are not played correctly when a lua script play them via a call of
            play_sound or play_sound_with_freq_scale. This is due to how the moving
            sounds are handled internally. They use the f32 pointer provided to the
            play_sound functions to decide if the sound must be kept playing,
            stopped or restarted. Most of the time, the pointer provided is the
            cameraToObject field of Mario's object graph node. Since smlua uses a
            circular buffer for Vec3f conversion, this pointer is lost, and the
            sound engine can't decide what to do with the sound, resulting in a
            weird and incorrect sound effect.
        Fix: play_sound and play_sound_with_freq_scale now calls
            smlua_get_vec3f_for_play_sound before filling the sound request queue,
            to retrieve the correct pointer from the Vec3f provided by smlua.
2022-04-26 13:48:50 -07:00
MysterD 199ca70c86 Split up functions.md into multiple pages 2022-04-22 18:41:42 -07:00