Lua Plugin for Script Hook V (Reloaded) JM36-v20220805.0-Stable-ForUsersLua Developers Script Hook
Interested in having a nice, fast, easy way to write/add and/or test your own Lua scripts or use existing Lua scripts for Grand Theft Auto V with ease and virtually zero/no performance loss/impact (especially when compared to the older/traditional Lua Plugin)?
Have FiveM Lua experience/knowledge that you would like to take/bring into normal GTA?
Interested in having the ability to interface various in-game things to various external/out of game things (say trigger an action on/in an external unrelated program or create your own Discord rich presence with an external utility for example, maybe even create yourself a remote game interaction api) with ease?
Well, recently I've somewhat departed from FiveM (with 3+ years of experience) and thought it would be cool to port over some of my scripts to singleplayer, finding headscript's/gallexme's Lua Plugin for Script Hook V in the process, which just simply didn't suit my needs nor meet my expectations (especially in regards to performance), and it has pretty much been abandoned for years now, so I've decided to adopt it as my own and dramatically/drastically improve my fork of it far beyond what anyone could've ever imagined being possible with this, and I plan on introducing new performance/optimization features/techniques over time and releasing updates somewhat frequently.
Mod description: Write/Use custom Lua scripts for GTA V
- Lua is a lightweight scripting language that tends to be beginner-friendly, but powerful in the hands of an advanced user at the same time. Although Lua might not have the same popularity as that of other scripting languages such as C# or C++ (.NET), Lua's expandability makes it equally as capable as the others, while remaining easy-to-use and often more resource efficient.
Summary of installation instructions: https://github.com/JayMontana36/LuaPlugin-GTAV/wiki/Overview#installation-guide
Bugs and features:
1: Bug - Lua Plugin itself **cannot** be reloaded, but Lua scripts *can* be reloaded.
2: Feature - Introduced newer FiveM style Lua game native function calls (alongside the older/legacy game native function calls (via namespaces) which are strictly for compatibility with older/existing Lua Plugin scripts and have not been updated/touched).
3: Feature - An external Lua script(s) directory that you can place anywhere.
4: Feature - Lua script reloading script for developers with DebugMode variable set true.
5: Feature - Maintain compatibility with older/existing Lua Plugin scripts.
6: Feature - Universal timer and variables containing relevant player information to avoid having to (excessively) use certain/common game native calls across numerous scripts (and avoid wasting resources by doing so).
7: Feature - Universal built in native config file reader/writer functions for data storage/retention/persistence.
8: Feature - Included examples and documentation via GitHub wiki.
9: Feature - Automatic caching of certain game native function calls (for better speed and efficiency).
10: Feature - Quality of life improvements and enhancements for older/existing Lua Plugin scripts.
11: Feature - Scripts no longer conflict nor block/delay other scripts from running
Credits and, if applicable, notices of permission for content re-use:
1: Credits | JayMontana36 - This version/fork of Lua Plugin with completely homemade/rewritten externals (currently ALL of the included Lua scripts with the exception of "GUI.lua" were all written/original content by me)
2: Credits | headscript/gallexme - The original author of Lua Plugin who's ASI files are currently still used in this project/fork due to my lack of knowledge to create my own.
3: Notice of permission for content re-use - https://github.com/gallexme/ScriptHook-Lua-Plugin/blob/master/README.md - Applies to the ASI files and the "GUI.lua" file used in this project/fork; for everything else, http://creativecommons.org/licenses/by-nc-sa/4.0
- ** JM36-v20220805.0-Stable-ForUsers ** -
1: Misc internal improvements/rewrites
2: Update RAGE native function (re)maps
3: Optimize package/distribution/download for users - stripped out example scripts and precompiled for faster loading - developers must now get "source" from GitHub.
- ** JM36-v20220420.0-Stable ** -
NOTICE: If you have previously downloaded and installed v20220418.0, be sure to delete the "1_Threads.lua" file from your "Modules", otherwise it'll cause problems loading Lua scripts and conflict because it has been integrated (and as such, that module is for that version and older and is incompatible with this version and newer).
1: Fully integrate the previously implemented coroutine/thread system and make it the new/default standard across everything, including any/all loaded older/legacy/original Lua Plugin scripts as well as all JM36 Lua Plugin scripts via wrapping.
2: Scripts can (and will) no longer block other scripts from running (or being able to run) whenever a "wait" is called - Primarily affects/concerns the older/legacy/original Lua Plugin scripts in a great/awesome way.
3: (Actually) Fix broken compatibility with older/legacy/original Lua Plugin scripts (for real this time).
- ** JM36-v20220418.0-Stable ** -
1: Fix broken compatibility with older/legacy/original Lua Plugin scripts.
2: Implement a basic coroutine/thread system, which will become the new/default standard and be fully integrated in the near future.
- ** JM36-v20220412.0-Stable ** -
1: Completely/Massively rewrite/overhaul the JM36 Lua Plugin's eCore for performance and efficiency and structural purposes.
2: JM36 Lua Plugin's init/startup and script reloads should now be way/much more efficient (and faster).
3: Engineered and implemented modular caching libraries for use with both functions and scripts.
4: Modularized the "Info" var/param/table as well as it's "Player" subtable (it works the same).
5: Updated the "Info" update interval to be per frame instead of every 500ms.
6: Added caching to a few common game native function calls (for speed).
7: Integrate JM36 Function (Re)Mapper to no longer need/require a separate download (LP is now more usable out of the box).
8: Updated the Function (Re)Mapper to work with the new JM36 LP filesystem structure.
9: Updated the Function (Re)Mapper's ini file with newer game native function names.
- ** JM36-v5.3-Stable ** -
1: Fix issues with some scripts which fail to function correctly or at all prior to a (forced) script reload (or in the case of non-technical users or non-developers, did not work at all).
2: Add a built in automatic migrator from/for old/legacy LuaPlugin to JM36 LuaPlugin.
- ** JM36-v5.2-Stable ** -
1: Compatibility fixes for supporting more legacy `Lua Plugin` scripts.
- ** JM36-v5.1-Stable ** -
1: Fixed inconsistencies with the "_0x" game native function calls to make it even easier to work with them in a more consistent manner.
- ** JM36-v5.0-Stable ** -
1: Skipped a version (v4.0); v4.0 was unofficially released as a private "beta".
2: Fixed typo in "Info.Player.Vehicle.Name" that prevented the vehicle's name from coming back correctly as anything.
3: Add new "Handle" variable to "Info.Player" and "Info.Player.Vehicle".
4: Make it easier to call "0x" hexadecimal game native functions by prefixing them with an underscore ("_") like FiveM does.
5: Several optimizations to the internal "_init" function and the FiveM style game native function call function generator.
6: Remove/Replace an unnecessary internal function for accessing "secondary" globals, making it a more direct access while keeping transparency.
7: Renamed a few included scripts primarily for better/optimal DebugMode operation.
8: Optimized DebugMode tick/loop further.
9: Attempt to simplify installation for new and/or basic users by defaulting ScriptsDir-Lua into GameDir-GTAV scripts dir.
10: Removed "All Lua Scripts Loaded Without Error" message; you will now only ever see errors (and script prints) printed in console (with developer asi).
11: Overall code cleanup and optimization.
12: Add/Include version information within secondary global which can be used by scripts to require a certain minimum version of this plugin and/or change behaviors depending upon the version (such as error for incorrect version or so).
- ** JM36-v3.0-Stable ** -
1: Fixed FiveM style game native function calls randomly (not) working (hopefully) once and for all and removed the excess code/checks related to this issue/bug
2: Fixed "Info.Player.Vehicle.IsOp" variable not updating whenever the player becomes the vehicle operator or a vehicle passenger
3: Implemented feature number 7 from above (config file read/write)
4: Updated the included example scripts
- ** JM36-v2.0-Stable ** -
1: Implemented feature number 6 from above
2: Implemented a check and a fix for the commonly left out "\\" ending in the "Scripts_Path" string variable (which whenever absent in the previous release/version would have caused things to completely break and fail to function).
3: Implemented a new "Info" variable which is exposed directly to your loop functions, containing plenty of useful player (and vehicle) information as well as the time which is mostly useful for wait(ing) or for delayed execution or for special script loop run timings; more Information and usage examples regarding the new "Info" variable can be found on the wiki - https://github.com/JayMontana36/LuaPlugin-GTAV/wiki/The-Basics---Getting-Started---Scripting-Examples#the-info-variable-1st-argument-sent-to-loop-functions-and-game-native-function-call-examples
4: gta5-mods specific release version - include the above wiki page (The Basics - Getting Started - Scripting Examples) as well as the "Overview" wiki page as htm/html files as a simple and effective way to "include documentation" just in case developers don't go to the GitHub for the documentation or don't know that the GitHub with the documentation exists (being that the other Lua Plugin completely lacks any documentation whatsoever in general, which is not the case here with my version).
First Upload: April 12, 2021 Last Updated: August 05, 2022