Commit graph

31 commits

Author SHA1 Message Date
PeachyPeach
8812fbac8b
HOOK_ALLOW_INTERACT; new HUD functions (#73)
Added new hook: HOOK_ALLOW_INTERACT:
        Called before Mario interacts with an object. Return true to allow the interaction.
        The hook signature is bool function(MarioState, Object, InteractionType)

    Added new HUD constants:
        enum HudDisplayValue:
            HUD_DISPLAY_LIVES
            HUD_DISPLAY_COINS
            HUD_DISPLAY_STARS
            HUD_DISPLAY_WEDGES
            HUD_DISPLAY_KEYS
            HUD_DISPLAY_FLAGS
            HUD_DISPLAY_TIMER
        enum HudDisplayFlags:
            HUD_DISPLAY_FLAGS_NONE
            HUD_DISPLAY_FLAGS_LIVES
            HUD_DISPLAY_FLAGS_COIN_COUNT
            HUD_DISPLAY_FLAGS_STAR_COUNT
            HUD_DISPLAY_FLAGS_CAMERA_AND_POWER
            HUD_DISPLAY_FLAGS_KEYS
            HUD_DISPLAY_FLAGS_UNKNOWN_0020
            HUD_DISPLAY_FLAGS_TIMER
            HUD_DISPLAY_FLAGS_EMPHASIZE_POWER

    Added new HUD functions:
        s32 hud_get_value(enum HudDisplayValue type)
        void hud_set_value(enum HudDisplayValue type, s32 value)
        void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height)
2022-04-30 17:33:38 -07:00
PeachyPeach
6726a6280a
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
bc7821a1e9 Added custom mod packets 2022-04-22 00:13:58 -07:00
MysterD
ef7dc41560 Added HOOK_ON_DEATH 2022-04-21 18:34:12 -07:00
MysterD
4b63a16056 Added passes_pvp_interaction_checks() 2022-04-20 18:27:34 -07:00
MysterD
2347ab61c1 Added HOOK_ON_OBJECT_RENDER 2022-04-19 22:36:47 -07:00
MysterD
6b67c983ec exposed sequence ids to lua 2022-04-15 21:51:18 -07:00
MysterD
9653a19c7d Improve rom hack camera's collisions in tight spaces and focus underwater. Add HOOK_ON_SET_CAMERA_MODE 2022-04-13 00:10:50 -07:00
MysterD
431af75d88 Add a vanilla-like camera for romhacks 2022-04-11 21:04:15 -07:00
MysterD
ef4a83dc88 Quick fixes for test 2022-04-10 10:11:13 -07:00
MysterD
957e03cd81 Added HOOK_GET_STAR_COLLECTION_DIALOG 2022-04-10 02:44:11 -07:00
MysterD
3db42f1700 Allow coop mods to use the backup save slot independently of the normal one 2022-04-10 00:30:47 -07:00
MysterD
653ab58a5d Allow course names/acts to be changed from Lua 2022-04-09 23:28:36 -07:00
MysterD
c75e71f24e Unhardcoded all behavior dialogs, allowed replacement of dialogs 2022-04-09 19:50:50 -07:00
MysterD
98f02458e3 Added a way to bind to movtexqc ids through lua, added the rest of the object constants 2022-04-09 01:47:20 -07:00
MysterD
6751829f91 Adjustments for Lua/Mods 2022-04-06 18:24:50 -07:00
MysterD
52e705c9d8 Merge branch 'unstable' into level-scripts 2022-04-06 01:36:33 -07:00
MysterD
de048928ce Added ability for Lua mods to adjust gServerSettings 2022-03-26 01:08:15 -07:00
MysterD
322e4983ae Add HOOK_ON_PAUSE_EXIT 2022-03-25 23:06:14 -07:00
Isaac
65df754b09
Add save file flag functions to lua api (#41) 2022-03-24 19:30:15 -07:00
MysterD
c58702df93 Misc Lua fixes/enhancements
approach_s32 now stays within 32 bits
Fixed SOUND_ARG_LOAD
Added OBJ_COL_FLAGS_*
Added reset_rumble_timers
Added get_hand_foot_pos_*
Added get_water_surface_pseudo_floor
Adjusted new hooks to be called at the appropriate times
2022-03-19 00:56:59 -07:00
MysterD
11649ce1d8 Added HOOK_ON_OBJECT_UNLOAD, HOOK_ON_SYNC_OBJECT_UNLOAD 2022-03-17 01:43:08 -07:00
MysterD
0cd2a91e9c Added allocate_mario_action() 2022-03-17 01:17:34 -07:00
MysterD
7252d836a9 Added hooks: HOOK_ON_LEVEL_INIT, HOOK_ON_WARP, HOOK_ON_SYNC_VALID 2022-03-16 23:53:01 -07:00
MysterD
469e4ac4e4 Load Super Keeberghrh's ERROR model when DynOS can't find the model 2022-03-16 01:34:18 -07:00
MysterD
edf06bede0 Added ability for mods to load custom geos 2022-03-14 00:11:36 -07:00
MysterD
85d4012e89 Re-ran autogen 2022-03-13 00:25:36 -08:00
MysterD
b695cbd55a Merge branch 'unstable' of github.com:sm64ex-coop-dev/sm64ex-coop into unstable 2022-03-13 00:25:22 -08:00
Prince Frizzy
84aa5ad890
Fixes for multiple players getting a star cutscene, Even if they didn't spawn it. (#22)
* Fix up star cutscene issues.
2022-03-13 00:22:48 -08:00
MysterD
3ce66ac312 Added hook: HOOK_ALLOW_PVP_ATTACK, disabled friendly fire in football 2022-03-12 23:43:47 -08:00
MysterD
08d4818ba7 Added Lua definitions for autocomplete in visual studio code 2022-03-12 21:28:57 -08:00