An update that took a long time to arrive... I actually fixed the synchronization issues a week after v1.0 came out, thanks to the feedback I got. But then, life happened: a wave of personal problems and burnout. I’m just happy I finally found the strength to post this.
I haven't stopped working on it, though. I’ve overhauled the library to make it as clear and "final" as possible.
Everything is included in the
FullPack (zip) file (Core, Example, Defs, and Docs).
I also left the
Core script as a separate download for a quick drop-in.
Added documentation files
It took a while, but I think creating these files is cleaner than putting everything on the MB. Here's what's included:
- UserGuide: Basically the "Why" and "How".
- API Reference: The list of all functions and how to call them.
- Internals: For those who want to know how the gears turn inside.
Added a "defs" file (taskmanagerdefs.lua)
This is a "Definitions" file for developers. If you use an editor like VS Code with the EmmyLua extension, this file allows the editor to "understand" TaskManager.
It provides auto-completion (suggesting function names while you type), shows you the documentation and required arguments directly in your editor.
It's basically a map for your code editor so you don't have to check the documentation every 5 seconds.
Main Changes
- NetSafe Overhaul: As suggested by LJ, to handle NetVars correctly, I added
TaskMgr.RegisterTasks(...functions)
If you want to use a function with this lib, you must register the function itself first. This must be done unconditionally and in the same order on every client (you can just call this function right after its definition). I know it makes the system less "free," but it's the only way to maintain synchronization in multiplayer.
- New API Functions
ChangeDelay, Schedule, FindEntry, Move, Replace, TaskState, GetEntryInfo, EventState, GetEventState
More information in the API documentation file.
- For clarity, I changed some names
- ExecuteEvent -> Trigger
- UnregisterFromHandle -> Unregister
- Unregister -> UnregisterByMatch
- RegisterGiveHandle -> Register
- Internal Logic
- Registering a task now ONLY returns an entry_id, which is the specific index of the entry in the TMEntries global table.
- Most API functions now rely on this ID. Storing it in a variable makes things much easier (unregistering, changing delay, etc.).
- If you need information about an entry, GetEntryInfo(entry_id) returns a table containing all useful information about it!
- Also, many functions have been optimized internally for better stability.
For more explanations, please take a look at the documentation files.