Updates
-
Added :runSuperMethod(method, …) to the framework adaptor. This allows inherited modules to search through their parents to gather all methods of the same name and run them.
- Primary use is for the object :created() method, which gets triggered whenever a new object is made. If it’s inheriting from another module then it will also trigger that module’s created() method and so on.
-
Switched the Signal class over to the GoodSignal implementation.
-
Property signals created by the :registerProperty() method are automatically added to the object’s maid for easy clean-up (helps prevent memory leaks after the game has been running for a while).
-
Swapped out existing coroutines and heartbeat waits in the framework for the task library instead.
-
Created the Registry class for keeping track of objects and easily grabbing them by their ID from any module in the game.
- When an object is being destroyed, it will automatically be removed from all registries that it has previously been added to.
-
Created the Replicator classes on the server and client.
-
Property changes are automatically replicated.
-
For non-property values to replicate, you must set the index as replicatable by using the :replicates() method. From then on, any changes made to that index will automatically replicate.
-
Objects keep a “replicatedTo” list that makes it easy to replicate objects only to players that they haven’t already been replicated to.
-
-
Added a getAsset(directory, name) method to make fetching shared assets easier.
-
Changed :addSignal(name) to :addSignal(…) so that you can add multiple signals at once.
-
Added object:compare(otherObject, ignoreIndices, getDifferences). Typical use would be comparing stackable objects in an inventory to see if there are different values that would result in the object not stacking.
-
Added inventory methods. An inventory created for a PlayerManager will automatically be added to the PM’s maid. Objects registered to an inventory will automatically be assigned the inventories PM.
-
:canStore(object)
-
Returns true if the inventory has space for the specified object (accounting for stack sizes).
-
Uses an object’s :compare() method to check for similarities for stacking. If two objects are the same class but have different attributes (pretend weapons are stackable and say you have two “Iron Swords” but one of them is enchanted, meaning that the comparison should fail and cause the two items to be unstackable).
-
-
:deposit(object)
- Adds an item to the inventory (using the :canStore() method above to check for storage capacity). Automatically fires the “Deposited” signal [i.e; inventory.Deposited:Connect(function(item) end)]
-
:withdraw(object)
- Removes an item from the inventory. Automatically fires the “Withdrawn” signal [i.e; inventory.Withdrawn:Connect(function(item) end)]
-
Patches
- The object :compare() method with the “get differences” variable toggled on would result in incorrect comparisons between properties (it was mistakenly checking for the property.Value rather than the property.Name on one of the objects).