Commit Graph

43 Commits (1bb90ae4b6743607b816341a4302f5471ce7ca6e)

Author SHA1 Message Date
MysterD 103e184270 Make gMarioStates->controller immutable in Lua 2023-04-01 17:16:18 -07:00
MysterD c1322b7aa1 Figure out a ping between every player, adjust resend rate based on it 2023-03-27 11:50:32 -07:00
Agent X 17c9b1d5d5 Expose Paintings to Lua (#279)
* Expose paintings to Lua

* Make some "dangerous" fields immutable

I just thought being able to edit paintings IDs from Lua was a little bit too much.
2023-02-16 18:54:38 -05:00
Agent X 659552fc7b 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
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
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
TheGag96 a1bcd19529 Arbitrary shirt, pants, glove colors + settings menu (#145)
* Support for more granular player colors

You can now configure RGB values for shirt, pants, gloves, and shoes.
Due to some limitations, configuring shoes does nothing at the moment.

* Remove paletteIndex and friends

Restructured and filled in some remaining code to account for that.

* Add Edit Palette panel to Player panel

* Change PlayerPalette contents to an enum-indexed array, remove shoes

This gets rid of all the hokey code doing switch cases on the
different parts.

* Fix goof with player model selection box

Should actually have affect now even if a custom palette is being used.

* Fix gap in player color display list commands

The extra space was leftover from when I was trying to get shoes
working. Forgot to clean it up.

* Standardize PlayerParts enum, including for lua constants autogen

* djui_panel_player.c: Properly hook sending palette changes on unpause

Editing the palette and then unpausing should send out the packet to
everyone with the new palette changes (and update the palette preset
selection box), but since we weren't hooking that situation before, it
would stay changed only for you. You would have had to press the Back
button for it to work right.

* Allow Lua mods to continue using `paletteIndex`, `overridePaletteIndex`

This lets mod code like this still work unchanged:

if s.team == 2 then
    np.overridePaletteIndex = 7
elseif s.team == 1 then
    np.overridePaletteIndex = 15
else
    np.overridePaletteIndex = np.paletteIndex
end

It's essentially faked, and would work strangely if the value of either
variable was inspected more closely directly. This should at least
handle the typical use case, though.

Every frame, `overridePaletteIndex` is checked to see if it was modified
from its previous value. If so, `overridePalette` is set to the preset
corresponding to the index. `paletteIndex` contains a special value that
when used to assign to `overridePaletteIndex`, it copies `palette` into
`overridePalette` to restore the real colors, which of course may not
follow the presets at all.

* characters.h: Pack `PlayerPalette` to eliminate size differences between computers

* mario_misc.c: Remove remaining "TODO GAG"
2022-08-07 15:13:19 -07:00
MysterD 1a1f593a38 Added ability to have completely custom levels that don't override anything 2022-06-05 21:55:31 -07:00
MysterD 6d6995e5da Make bass sound interface easier to handle 2022-05-08 04:04:14 -07:00
MysterD 41fbf6cd7f Use binary search for all Lua cobject fields 2022-04-22 18:51:25 -07:00
MysterD 86889da980 Added gActiveMods global to lua 2022-04-22 18:44:59 -07:00
MysterD 37e2593279 Unhardcoded all behavior dialogs, allowed replacement of dialogs 2022-04-09 19:50:50 -07:00
MysterD 38ac873568 Made trajectories overridable from Lua 2022-04-08 23:01:41 -07:00
MysterD 6500173464 Allow Lua to adjust default star spawn positions 2022-04-08 00:37:20 -07:00
MysterD 5efd8565eb Added ability for Lua mods to adjust gServerSettings 2022-03-26 01:08:15 -07:00
MysterD f38741ba4a Make new timers immutable 2022-03-25 21:39:03 -07:00
MysterD 12e28f4099 Added Lua definitions for autocomplete in visual studio code 2022-03-12 21:28:57 -08:00
MysterD dacc7d9b9c Allowed Lua mods to override player models and palettes 2022-03-10 18:23:25 -08:00
MysterD 316bf8afa0 Moved smlua_XXX_utils.[ch] to src/pc/lua/utils/ 2022-03-09 23:09:33 -08:00
MysterD 01cd49273e Added the ability to set surface collisions on custom behaviors 2022-03-09 23:02:20 -08:00
MysterD 9334840448 Added ability for Lua to spawn non-synchronized objects 2022-03-09 21:25:34 -08:00
MysterD ed95ad3cb7 Added the ability to spawn particles from Lua
Added particles to football
Increased the object cap for particles
2022-03-09 21:25:07 -08:00
MysterD 37d1d70a59 Add collision_find_surface_on_ray() 2022-03-05 14:24:58 -08:00
MysterD b6004d7358 Update Lua documentation autogeneration 2022-03-04 22:22:31 -08:00
MysterD e6fac87fdc Add networking for custom behaviors 2022-03-04 20:03:00 -08:00
MysterD a562c4be9b Add object animations to Lua, add CPointer allowlist 2022-03-03 18:31:45 -08:00
MysterD 3de0900bbc Initial custom behavior commit 2022-03-03 01:04:15 -08:00
MysterD a0832d0cfe Various Lua object API improvements
Lifted immutablity of most Lua struct fields
Added object constants to Lua API
Added ability to set struct pointers in Lua API
Prevented respawners for Lua-spawned objects
2022-02-25 18:30:05 -08:00
MysterD 6a15de3443 Fix compile issues for Linux/Mac 2022-02-20 20:23:10 -08:00
MysterD 52f3368756 Added object fields to Lua API 2022-02-19 13:51:02 -08:00
MysterD 688dc5a73d Binary search Lua struct fields 2022-02-18 23:39:18 -08:00
MysterD a9e6cd532a Added global textures 2022-02-15 22:14:55 -08:00
MysterD a73b828106 Created TextureInfo struct 2022-02-15 22:13:10 -08:00
MysterD 2d70b235ff Added CPointers to Lua/autogen 2022-02-15 22:09:21 -08:00
MysterD 956efe1e86 Print totals when autogenerating lua documentation 2022-02-05 13:33:22 -08:00
MysterD 0831fec716 Added read-only column to Lua struct documentation 2022-02-04 01:32:19 -08:00
MysterD 3677a1ac7f Added support for returning structs from C to Lua 2022-02-03 00:43:08 -08:00
MysterD f92ac3b472 Added immutable strings to autogen, added djui_popup_create 2022-02-03 00:42:31 -08:00
MysterD 39cefa6ec4 Added gNetworkPlayers to lua api 2022-02-02 19:24:51 -08:00
MysterD eefb52880c Autogenerated Lua documentation 2022-01-29 22:47:22 -08:00
MysterD b26f3e43fc More improvements to Lua
autogenerated functions for characters.h

Fixes in autogen:
	improvements to LVT/LOT conversion
	improvements to immutability status

Updates to character-movesets.lua, every character has a moveset now

Added .type to stuct Character

Prevented unimplemented actions from crashing the game
2022-01-26 20:35:13 -08:00
MysterD a606c99cd1 More Lua improvements
convert_functions.py no longer hardcodes acceptable LOT_ values
Added characters.h and surface_collision.h to convert_structs.py
Prevented mod filenames with a slash in it from being considered acceptable
Sanitized mod filenames when received from the server
2022-01-25 20:28:34 -08:00
MysterD 5a0a2eb9e0 Lua: autogenerated cobjects 2022-01-25 19:28:10 -08:00