Project Zomboid

Project Zomboid

Advanced Trajectory's Realistic Overhaul
Changes to your code to allow easier time for other modders
Hello I'm a Project Zomboid modder who made a framework for zombies in the game. Your ATRO mod caused an incompatibility with my framework which I looked into

One thing I can't understand about your mod: why the ♥♥♥♥ do you make it so impossible to decrypt for other modders ? Please change the use of indexing within your `vt` table and instead uses keys
For example to access the player you do `vt(19)` to access index 19 of the vt table but instead use vt.player. This would make the code way easier to decrypt for other modders and even for yourself if you forgot what an index is

Secondly, please divide your code in multiple functions. Your entire `Advanced_trajectory.checkontick()` function is 400 lines long !!!
This means that in my case I had to rewrite a small portion of the code which is like 10 lines long at best and I end up having to overwrite the complete 400 lines just to modify a tiny part of it. This means that whenever another modder wants to patch the part handling player hit for example instead, they will have to overwrite my function too and conflict with my mod

Instead have your checkontick() activate multiple different functions that way if someone wants to modify some parts of the code they just have to modify the function called in checkontick() that handles players to take the example from before and that way I also just have to modify the part that handles zombies

Thirdly, make your functions local inside modules:
--file.lua local module = {} ... -- end of file return module
-- other_file.lua local module = require "file.lua"
The reason is that local is way more efficient than global and modules still allow other modders to access it by importing the module. This is extremely important considering your code handles a big chunk of a system in the game and optimizing it should be your number 1 priority

Thank you for reading this, if you want more detail or to talk more in-depth on it I invite you to add me / join the modding Discord I link in my mods
Last edited by Sir Doggy Jvla; 25 May, 2024 @ 6:08pm