Commit graph

212 commits

Author SHA1 Message Date
Agent X
1f2e09da6e Re-arrange some parameters and add math.round
Co-Authored-By: xLuigiGamerx <88401287+xLuigiGamerx@users.noreply.github.com>
2025-05-28 22:34:45 -04:00
PeachyPeach
69e129805e
More math improvements (#820)
* More math improvements

* more math functions

* stack check

* added error message when trying to modify read-only table; fix gSmluaConstants printed to console
2025-05-29 02:52:31 +02:00
NitroDisPro
dea7247d9f
Add HOOK_MARIO_OVERRIDE_FLOOR_CLASS (#812)
* Update lua_definitions constants.lua

* you kiddin' dude

* Update lua docs constants.md

* Update smlua_constants_autogen.c

* Update smlua_hooks.h

* Update mario.c to add HOOK_MARIO_OVERRIDE_FLOOR_CLASS to mario_get_floor_class(m)

yeah i sure love using web interface

* Update lua guide hooks.md

* Whoops
2025-05-28 18:13:46 -04:00
PeachyPeach
bbabaa3c79
Fix hand/foot pos and get any Mario part position (#816)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Fix hand/foot pos and get any Mario part position
2025-05-21 23:52:04 +02:00
PeachyPeach
8db6356754
Improving math functions (#813)
* Improving math functions

* Isaac review
2025-05-21 23:50:49 +02:00
Prince Frizzy
02c9a4146b
More Optimizations (#792)
* Initial work on optimizations.

* Requested Changes Part 1

* Requested Changes Part 2

* Requested Changes Part 3

* Requested Changes Part 4

* Requested Changes Part 5

* Requested Changes Part 6

* Update deprecated.lua

---------

Co-authored-by: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
2025-05-16 20:27:49 -04:00
PeachyPeach
0d4fd39a00
Fix interactions again (#795) 2025-05-08 08:51:44 +10:00
Agent X
954af5bc0a this should fix SDL_Joystick lag [build] 2025-05-04 18:41:38 -04:00
Blockyyy
a0f557bf68
fix HOOK_BEFORE_WARP (#753)
* fix HOOK_BEFORE_WARP

* actual fix and correct hooks.md

* reset arg, make WARP_ARG_EXIT_COURSE -1
2025-04-30 18:22:31 -04:00
PeachyPeach
507e6f6102
Fix autogen documentation (#769)
* Fix autogen documentation

* verbose
2025-04-27 17:24:29 -04:00
Blockyyy
ea353af5c9
HOOK_ON_INSTANT_WARP (#747)
* make HOOK_ON_WARP trigger on instant warps

* oops

* HOOK_ON_INSTANT_WARP

* make the displacement a Vec3s, hooks.md

* fix hooks.md oversight

* get rid of this
2025-04-27 17:21:17 -04:00
Agent X
bf85d9f9d5 Lay some groundwork for more documentation, fix compilation error, put backgrounds into enum 2025-04-26 23:29:21 -04:00
PeachyPeach
467b22e939
Gfx set command: v2 + Gfx/Vtx dynamic alloc (#718)
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
* set_gfx_command part 2

* part 3

* get gfx/vtx from name; copy gfx/vtx

* gfx/vtx dynamic allocation lua

* gfx/vtx_new: don't take level/model/vanilla names

* Clean up gbi constants

* update example

* Isaac review; add gfx_get_next_command and vtx_get_next_vertex

* make all commands length 1; missing NULL checks
2025-04-12 18:19:14 -04:00
Blockyyy
43d2248727
HOOK_BEFORE_WARP, added params to HOOK_ON_LEVEL_INIT and HOOK_ON_WARP (#736) 2025-04-10 17:17:59 -04:00
Agent X
490939bc95 Bump version
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-04-10 16:55:27 -04:00
Baconator2558
ce8350514c
Add HOOK_ALLOW_FORCE_WATER_ACTION (#731)
* Update constants.md

* Update constants.lua

* Update smlua_constants_autogen.c

* Update surface_terrains.h

* Update hooks.md

* Add files via upload

* Update constants.lua

* Update smlua_hooks.h

* Update smlua_constants_autogen.c

* Update constants.md

* Update mario_actions_airborne.c

* Update mario_actions_airborne.c

* Update mario_actions_stationary.c

* Update mario_actions_automatic.c

* Update mario_actions_object.c

* Update mario_actions_moving.c

* Update mario_actions_submerged.c

* Update mario_actions_airborne.c

* Update mario_actions_stationary.c

* Update mario_actions_automatic.c

* Update mario_actions_object.c

* Update mario_actions_moving.c

* Update mario_actions_submerged.c

* Update hooks.md

* Update hooks.md

* Update mario_actions_submerged.c

* Update hooks.md

* deal with gCamera being exposed incorrectly

* update gCamera as the pointer is updated

* served time for crimes against C

* Update revamped flying damage (#722)

* forgot to null check it

* lois (#5)

* deal with gCamera being exposed incorrectly

* update gCamera as the pointer is updated

* served time for crimes against C

* Update revamped flying damage (#722)

* forgot to null check it

* Fix/optimize/improve lighting engine

* Camera fixes

---------

Co-authored-by: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-authored-by: Sunk <69110309+Sunketchupm@users.noreply.github.com>
Co-authored-by: Agent X <44549182+AgentXLP@users.noreply.github.com>

* Update lighting_engine.c

* Update lighting_engine.c

* bart (#6)

* deal with gCamera being exposed incorrectly

* update gCamera as the pointer is updated

* served time for crimes against C

* Update revamped flying damage (#722)

* forgot to null check it

* Fix/optimize/improve lighting engine

* Camera fixes

* Fix small LE whoopsie

* Update CS to v1.13

* New coopnet libraries for macOS (#725)

* Fix camera issues (#726)

* Fix vanilla camera in automatic

* Correct dpad movement direction

Matches the same direction as romhack camera now

* Make Git hash only dev or debug

* Fixes

* fix some script errors in mods that pass in nil objects

technically this is the mod's fault, but this is more consistent behavior for a cheap fix

* Further fix camera (#727)

* Further fix camera

* Remove re-override

* fix scrolling textures simply not scrolling

this was caused by the duplicated vertices commit

* free stuff

---------

Co-authored-by: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-authored-by: Sunk <69110309+Sunketchupm@users.noreply.github.com>
Co-authored-by: Agent X <44549182+AgentXLP@users.noreply.github.com>
Co-authored-by: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com>

* Update smlua_cobject.c

* Update mario_step.c

* Update bettercamera.inc.h

* Update camera.c

* Update smlua_cobject.h

* Update camera.c

* Add files via upload

* Update constants.lua

* Update constants.md

* Update hooks.md

* Update smlua_constants_autogen.c

* Update smlua_hooks.h

* Update smlua_hooks.h

* Update smlua_hooks.c

* Update mario_actions_airborne.c

* Update mario_actions_automatic.c

* Update mario_actions_moving.c

* Update mario_actions_object.c

* Update mario_actions_stationary.c

* Update mario_actions_submerged.c

* Update mario_step.c

* Update mario_actions_airborne.c

* Update mario_actions_automatic.c

* Update mario_actions_moving.c

* Update mario_actions_object.c

* Update mario_actions_stationary.c

* Update mario_actions_submerged.c

* Update hooks.md

* Update mario_actions_airborne.c

* Update mario_actions_automatic.c

* Update mario_actions_moving.c

* Update mario_actions_object.c

* Update mario_actions_stationary.c

* Update mario_actions_submerged.c

* Update mario_actions_submerged.c

* Update mario_step.c

* Update mario_actions_stationary.c

* Update mario_actions_submerged.c

* Update mario_step.c

* Update mario_actions_airborne.c

* Update mario_actions_airborne.c

* Update mario_actions_automatic.c

* Update mario_actions_moving.c

* Update mario_actions_object.c

* Update mario_actions_submerged.c

---------

Co-authored-by: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-authored-by: Sunk <69110309+Sunketchupm@users.noreply.github.com>
Co-authored-by: Agent X <44549182+AgentXLP@users.noreply.github.com>
Co-authored-by: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com>
2025-04-07 18:47:52 -04:00
Cooliokid956
3bfa75e32b
Miscellaneous Additions: Addendum (#723)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* More autogen work

- made the `Pointer_` classes into aliases instead so that they're actually associated with their true type
- "Total constants" metric is now accurate

* High Quality Master Volume

* Audio work

it's 12:55am and there are some bright flashes outside (lightning)

- cracked the code (interpreted the "Acc" in `tempoAcc`)
- added several functions that will help greatly in the Streamed Music department (you can now match sequenced music fading (transitions, eepy, etc.))
- introducing `gMasterVolume`! a variable that is only updated when it needs to be, theoretically improving performance (by some amount). this variable is used in many places in place of recalculations of the same number
- made it so that muting the game skips some audio processing (not the main process since that would linger after unmuting (not good))
- fixed an oversight where lua volumes were not taken into account when `audio_stream_set_volume`
- it's its 😁
- removed additional `#include "audio/external.h"`

it is 1:06am
gn

* Add mouse status functions

you can now check if mouse buttons were held, clicked, or released

* Sorting was a bad idea

disabled sorting for constants so that they are represented more closely to their original defines

* Expose playerlist page index

also noticed that sorting still sucks

* Minor (very important) detail

lalette

* Addressing the PeachyPeachSM64 reviews

* Return of the Forced 4:3 Mode

shoutouts to DISPLAY.FORCE_4BY3 for sticking through the toughest of times, waiting for this day to come

* Added scroll support

- Scrolling added to chat box (hold ctrl to scroll fewer lines, shift to scroll faster)
- Scrolling functions added to smlua

* Addressing the Isaac0-dev review + fixes

- mouse scroll is now accumulated
- djui_gfx_get_dimensions
- forced 4:3 won't kick in if the window isn't wide enough
- game now recognizes horizontal resizing when in 4:3 mode

* Run autogen

* gfx_get_dimensions

works just as well
2025-04-05 13:52:14 -04:00
Isaac0-dev
c2823c268e fix some script errors in mods that pass in nil objects
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
technically this is the mod's fault, but this is more consistent behavior for a cheap fix
2025-04-01 16:13:56 +10:00
Agent X
c0e547e2d1 [build] Increment version to 1.3 2025-03-27 17:13:14 -04:00
Agent X
3e540790a3
Basic Vertex Point Lighting Engine (#716)
* CONCEPT: Basic vertex lighting engine

Set the geometry mode on your model to G_LIGHTING_ENGINE_EXT, spawn a `bhvAmbientLight`, spawn some `bhvPointLight`s, and then you got yourself a mighty interesting scene.

* Fixes

* How did I miss this

* Make light set home pos
2025-03-27 16:36:02 -04:00
Baconator2558
c26e968076
Allow wind to be ignored with HOOK_ALLOW_HAZARD_SURFACE (#721)
* Update constants.md

* Update constants.lua

* Update smlua_constants_autogen.c

* Update surface_terrains.h

* Update hooks.md

* Add files via upload
2025-03-27 14:48:36 -04:00
Cooliokid956
efcfff210d
Miscellaneous additions (#711)
- Fixed script file path shortening for Windows in console errors (what I could at least, the one left unfixed is preprocessed and I can't mess with that)
- Adjusted audio sanity check messages to sound more natural
- 9 new functions added:

## `audio_stream_set_loop_points(audio, start, end)`
Sets an audio stream's loop points in samples, no longer requiring a hacky method to loop streams in mods

## `get_active_mod()`
Returns the mod currently being processed, can be used by mods with APIs to determine what they're being used by and react accordingly

## `get_area_update_counter()`
Returns `gAreaUpdateCounter`, can be used to determine various in-game statistics, as well as if the game is being updated

## Exposed several object pointers
`get_current_object()` to retrieve `gCurrentObject`
`get_dialog_object()` to retrieve `gContinueDialogFunctionObject`
`(get|set)_cutscene_focus()` to retrieve/assign `gCutsceneFocus`
`(get|set)_secondary_camera_focus()` to retrieve/assign `gSecondCameraFocus`
2025-03-24 07:31:06 +10:00
Agent X
0f0997a2ac Add mod menu text hook and make hook functions return index
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-03-15 18:04:59 -04:00
Sunk
edacdcc7e4
More settings to the Camera settings menu (#555)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Sherbie's suggestions from #497 and #538, as well as suggestions from others on discord.
Add 2 new camera settings to free camera, being camera collision and dpad usage.
Add an entire new camera submenu for romhack camera, which are now no longer exclusive to romhacks.
2025-03-14 13:01:51 +10:00
Agent X
3792f0aebb Raise custom object fields limit from 16 to 64 2025-03-13 22:09:46 -04:00
Isaac0-dev
04ea4d6ad4 smlua use lot and lvt names rather than an index 2025-03-10 12:21:48 +10:00
Isaac0-dev
f238b3d0f5
allow Lua to manipulate displaylists and vertices (#675)
Co-authored-by: ManIsCat2 <137772623+ManIsCat2@users.noreply.github.com>
2025-02-27 14:27:55 +10:00
Isaac0-dev
a457f48959 remove some whitespace in gSmluaConstants 2025-02-24 19:55:43 +10:00
Isaac0-dev
cd5b5f9934 bump version 2025-02-15 08:08:41 +10:00
Isaac0-dev
ff83d6a037 autogen array implementation
arrays are pushed to Lua via tables
2025-02-12 17:38:38 +10:00
Isaac0-dev
9a13c298ad added HOOK_ON_INTERACTIONS
this is called after mario's interactions are processed
2025-02-11 17:58:57 +10:00
Isaac0-dev
d53d20c11c HOOK_ON_DIALOG fixes, expose set_dialog_box_state 2025-02-10 18:31:59 +10:00
Agent X
bc9273900f Increment version 2025-01-11 15:16:07 -05:00
Isaac0-dev
6abf4695cf run autogen 2025-01-07 09:08:25 +10:00
Amy54Desu
1f1683815e
HOOK_MARIO_OVERRIDE_GEOMETRY_INPUTS (#591) 2024-12-31 10:38:52 +10:00
Agent X
c17b82a7a3 Mod Storage: SUPERCHARGED 2024-12-30 18:18:14 -05:00
jayden
c8faa22072
Final touches for geo hooks (#588)
* new geo process children hook

* EXPOSE the mat stack

* fix formatting (oops)
2024-12-28 08:44:36 -05:00
jayden
1291350bed
Add hooks to graph node processing (#587)
* geo process hooking

* autogen update!
2024-12-27 22:07:31 -05:00
Agent X
982e2f1594 Raise mod storage limits to 1024 2024-12-19 16:24:30 -05:00
xLuigiGamerx
6757a3abb7
Added FONT_SPECIAL (#556)
* Fixed player and mod lists not updating on language change

* Added `FONT_SPECIAL` which is based on the special controls letters in dialog boxes
2024-12-17 08:58:38 -05:00
Agent X
faceaa684a Document sound functions 2024-12-16 20:18:28 -05:00
Agent X
f7a48d23fe HOOK_ON_DJUI_THEME_CHANGED 2024-12-11 23:55:10 -05:00
Agent X
eac580e04a Expose more lag compensation things to Lua 2024-12-01 16:46:05 -05:00
Agent X
78e3271391 Update version number 2024-11-28 10:41:44 -05:00
Sunk
947ce9f080
Rework PvP Balance (#357)
* PvP Rework

This rearranges the damages of last PR. The underused attacks should still see some buffs.

* Adjust how punches apply invincibility

Also increase punch invincibility timer to 12

* EmeraldLoc's easy suggestions

* Rework punching pvp

Punching no longer reduces invincibility frames. Instead, punches can ignore knockback invincibility and the full punch punch kick combo can be done.

* Adjust numbers

Breakdances should not deal 3 damage

* Potential fix for more common tripping

"Trip" here refers to 1 damage kicks

* Add temporary invincibility to rollouts

This is a test to see how different pvp feels with this change. Suggestion by sausrelics.

* Fix invincibility

* Prevent low damage/low knockback kicks altogether

* Update ignored attack list

* Allow dives to be attacked by most actions

A lot of people don't want dives to be entirely invincible and some suggested to make dives be able to only pierce through jump kicks

* Slightly nerf kick knockback

Suggestion by emily

* Rework dive piercing

Instead of all actions being able to hit dives other than jumpkicks, now only slidekicks (and ground pounds) can hit dives.

* Mild kick knockback increase from nerf

* Change direct equality to checking flag

* Decrease dive and punch knockback

* Prevent trades against dives with slidekicks

* Revert "Prevent trades against dives with slidekicks"

This reverts commit 2a2c3266a7.

* Allow ground pounds to always hit a sliding player

* Add server setting to change pvp

* Add pvp settings to config

* Add selection to menu

* Fix issues + autogen

* Rewrite goto statement to not use goto
2024-11-25 20:48:40 +10:00
EmeraldLockdown
904c4c9c13
Change MAX_KEY_VALUE_LENGTH to 512 (#386) 2024-10-23 10:49:23 +10:00
Sunk
9621424069
Fix early hits (#363)
Sometimes, the player can ground pound a pole before even landing or punch/kick an enemy at high speeds which will kill the enemy but not give bounce back to the player. This fixes those, although there are definitely mod incompatibilities.
2024-10-17 18:31:01 +10:00
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
EmeraldLockdown
c3d3f8545a
HOOK_ON_NAMETAGS_RENDER (#213) 2024-09-12 19:01:16 +10:00
Agent X
a4ed5ddb53 v1.0.3 2024-09-01 19:00:38 -04:00