Commit Graph

24 Commits (af2a80007a10067dbe31cc0f7a736e65770eeee2)

Author SHA1 Message Date
Sunk af2a80007a 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
Sunk 2c4ff40a23 Document manual.lua (#443)
* Properly set Mario's y vel to 0 on popping

* Change 0 to 0.0f, just in case

* Massively increase surface pool size

Also exposed the surface pool counts by creating a few functions to get them. They only existed for debugging but may as well keep them.

* Allow extended moveset to be toggled from a chat command

I got permission to edit extended moveset. Eventually I'll try to see if I can improve upon this moveset.

* Remove old surface code

Part 1

* Heavily document manual.lua

Hopefully nothing I added is wrong

* Small change in descriptions
2023-07-18 18:00:35 -04:00
MysterD 13b865e1ed Allow other mods to add levels to arena 2023-05-31 16:56:57 -07:00
PeachyPeach 7d70778a64 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
PeachyPeach e7e59d6f60 Expose globally custom behaviors defined with hook_behavior (#345)
* Expose globally custom behaviors defined with hook_behavior; macros for mod strings max length

* fixes

* made customBehaviorIndex a mod field to be more relevant
2023-04-17 21:54:55 -07:00
PeachyPeach 1d9cabd613 level_script_parse description (#340)
enhanced level_script_parse description
2023-04-10 12:25:26 +02:00
Agent X 92141488ea Add gServerSettings to Lua manual tables 2023-03-07 17:46:09 -05: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
Isaac0-dev fe02152649 Give Lua mods access to a form of level script preprocessing (#258)
* Give Lua mods access to a form of level script preprocessing

* Disable acts setting
2023-01-31 07:24:56 -05:00
Isaac0-dev 2b22b3520f add HOOK_OBJECT_SET_MODEL (#236)
* add HOOK_OBJECT_SET_MODEL
runs whenever a behaviour sets a model.
2022-11-30 00:37:43 -08:00
PeachyPeach 340aedd660 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
TheGag96 591c0b58d5 Fix issues Extended Moveset mod (+ extras) (#146)
* Allow Lua action hooks to specify custom functions for more behavior

...like gravity, and update all current mods to match.

Spin jump and wall slide from the Extended Moveset mod now have gravity
code basically matching the original mod.

Currently, any place you'd want to use one of these new action hooks
still requires an O(n) check through all action hook per call. This
should probably be changed.

* Fix some remaining issues with Extended Moveset Lua port

- Remove divergent spin jump code
- Remove divergent roll code
- Remap roll button to Y
- Reimplement dive slide to make dive hop work like the original
- Allow spin from double jump, backflip, side flip

* Fix more issues with Extended Moveset Lua port

- Reimplement all users of update_walking_speed to incorporate the Tight
  Controls edits and modified speed caps
- Fix instances of angle arithmetic to wrap properly across the mod

* Don't chop off group bits of custom action flags; assign missing groups in mods

This fixes the Extended Moveset's underwater actions. Chopping off those
bits was making the game consider the underwater actions to be a part of
the Stationary group, which caused `check_common_stationary_cancels`,
which upwarps Mario to the surface.

* Tweak roll sliding angle tendency

Rolling will now gradually (but fairly quckly) try to tend Mario's
facing angle down the slope.

This is cleaner than my old method that tries to flip Mario's angle
(wrongly) when he begins moving downward, having that logic coexist with
the logic for normal sliding actions that can also tend Mario to face
backward down the slope. Just looks ugly now by comparison.

* Disallow spin jump on slides in Extended Moveset port

This matches the original mod

* Extended Moveset: Crazy Box Bounce check

* Extended Moveset: Fix hugging the wall when spin jumping after wall kick

* Extended Moveset: Fix ledge drop snapping up to ground

Just reimplement `act_air_hit_wall` ourselves.

* Extended Moveset: Add Kaze's walking speed fix

* smlua_hooks.c: Restore option to use old API for hook_mario_action

The intent is to allow mods outside of this repo to continue working.

Co-authored-by: djoslin0 <djoslin0@users.noreply.github.com>
2022-08-07 15:25:00 -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 83f441cd4e Add djui_hud_world_pos_to_screen_pos, and render interpolated rect/texture 2022-05-13 19:54:49 -07:00
MysterD 51296bd36b Allow Lua to get any vanilla texture 2022-05-07 03:05:25 -07:00
MysterD 86889da980 Added gActiveMods global to lua 2022-04-22 18:44:59 -07:00
MysterD 2552d22cf9 Added custom mod packets 2022-04-22 00:13:58 -07:00
MysterD 2d159af4cc Allow coop mods to use the backup save slot independently of the normal one 2022-04-10 00:30:47 -07:00
MysterD 2e8017a39c Allow course names/acts to be changed from Lua 2022-04-09 23:28:36 -07:00
MysterD 38ac873568 Made trajectories overridable from Lua 2022-04-08 23:01:41 -07:00
MysterD d25159fd77 Refactored StarPositions 2022-04-08 19:46:01 -07:00
MysterD 8805ec2a07 Made the entry level configurable by Lua 2022-04-08 19:39:22 -07:00
MysterD 6500173464 Allow Lua to adjust default star spawn positions 2022-04-08 00:37:20 -07:00
MysterD 12e28f4099 Added Lua definitions for autocomplete in visual studio code 2022-03-12 21:28:57 -08:00