Jump to content

[WIP] Simplify - Utility Mod


Zeros

Recommended Posts

Heya, I've been working on this utility mod for awhile now. It's nothing much but should be good enough for modders to use. It'll be uploaded to github when I have time to do so.

 

Mod Link:

Steam Workshop - Simplify

 

Available Upcoming Features (Massive Overhaul):

 

1. Extended Require Function

- Allows you to load lua from 'cache/lua/[server_name]' and root mod folder.

 

2. Switch Function

- Better coding style for selection control.

 

3. Extended Metatable

- Extended looping function (next, pairs, and ipairs) to support custom metatable metamethods (Support LUA 5.2 __next, __pairs, __ipairs / simplify custom metatable).

- Introduce global 'size' function to get table's size.

 

4. Extended Table

- Introduce table.freeze(t) and table.isfrozen(t).

- It's a pure lua implementation so the performance is not the same as C API.

 

5. Text File Utilities

- Less error prone file function call.

- Read text files from 'cache/lua/[server_name]' and root mod folder.

- Utilities to get all of the text content and execute function per line.

 

6. CSV

- Read CSV files. Header and custom separator supported. File extension is not enforced

 

7. Event Manager

- Allows you to register custom event and triggers it with variable arguments.

 

8. Streamlined Event Hook Implementation

- You can easily hook an event by simply declare 'ModCustomEventsTable.EventName = function'.

- Set the value to nil to remove the callback.

 

9. Command Channels

- Streamlined 'OnServerCommand' and 'OnClientCommand' hooks. Same new event hook style.

 

10. Mod Loader (Scripts)

- Introduce branch folder concept. You can switch from unstable version to stable version using custom mod loader.

- Streamlined concept where you don't need proxy files to load scripts outside of media folder. The mod loader will look for 'loader.lua' at the root mod folder.

- Option's method for changing branch might or might not be supported.

 

And more.. There's too many prototype features I've ALREADY made for the upcoming update and those need intensive testing. Such as custom database, system / in-game timers, and custom meta events manager.

 

Feedbacks on this framework mod is highly appreciated so that I can improve it. Just note that I'm not a professional so the quality might be lacking for you.

 

edited (31/08/2022):

I'm too shy to make a new post for attention. The overhaul is almost done. This mod originally meant to be used as simple utility mod. But, due to lack of tools and game architecture's problem for my mods, It has been repurposed into a proper framework. Lot of stuffs will be introduced in the new update and note that there might be some oversights from me. There's too many things I need to consider for the designs and it's hard to check for what I've failed to include into my consideration. Earliest ETA for the update would be one week from now.

 

Edited by Zeros
info update
Link to comment
Share on other sites

I've uploaded the current version of the mod to the github.

https://github.com/Li-Zero/PZ-Simplify

 

Some stuffs are not included yet because they're in unfinished state. And, there's no comment for the new stuffs. So, you might want to take a look at the examples. And also the extension folder. There's nothing much but overall, it should enhance your coding style. Unless you like those heavily nested codes. Do take note that I've extended the 'require' function to include 'cache/lua/server_name' and root mod folders. The only problem is that, those files will print inaccurate errors if there's any and will be improvised if possible. The provided modloader is just an example and you don't need to pay attention to it for now.

 

For those who needs tools for adding custom events and triggers, you can use available 'EventManager' and 'Events' modules. I've done some tests and it should work as expected. The methods for adding and removing hooks are finalized and wouldn't be changed. This also includes the 'CommandChannels' module.

 

Lastly, I'm looking for collaborators to improve this framework. The direction for this framework would be providing the tools modders need and also workaround for architecture's limitations. Please pm me if you're interested.

 

Please submit bug reports at github alright.

Edited by Zeros
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...