easy-games / chickynoid

A server-authoritative networking character controller for Roblox.
https://easy-games.github.io/chickynoid/
MIT License
221 stars 31 forks source link

Character mod hotswap #22

Closed seyaidev closed 1 year ago

seyaidev commented 1 year ago

Before this change, calling playerRecord:SetCharacterMod(characterModName) after a character model has already been created and initialized did nothing but send a dirty world state. However, no visible changes were made with this new dirty world state. This aims to reflect new simulation constants and character models to the client and server when calling SetCharacterMod, allowing for the hotswapping of different simulation "settings" (simulation.constants) during gameplay. An example of this characterMod hotswap can be found in Server\InitPlayerRecord.lua where local function ToggleMoveset() will swap between two sets of constants, HumanoidChickynoid and NicerHumanoid which can be found in example\customclient\Character.

My current use case for this feature is to toggle between "roller skates" and "walking" simulation constants in real-time during gameplay. This also meant reconstructing the player model to utilize roller skate models attached to the character's feet with an added Y offset to account for them during movement. I found it underwhelming and misleading when I found that playerRecord:SetCharacterMod() didn't produce any visible changes out of the box. I don't know if this is the intended functionality of the method, but it was already very lightweight to begin.

seyaidev commented 1 year ago

Realized that this is really niche of a change right now and will rework it for a more limited scope later on down the line 👍🏽