Log in to reply
 

[Tutorial] A Beginner's Guide to GTA V Scripting



  • Introducing NucleiLite and Nuclei

    Hello fellow Developers,

    I'd like to share with you a project I've been working on - a guide to developing mods for Grand Theft Auto V aimed at beginners.

    Together, we'll create a mod that offers menus allowing players to access various options related to health, armor, invincibility, and super jump abilities, all created using the ScriptHookVDotNet Framework and LemonUI Framework. The menus contain interactive items, including regular items, checkboxes and list items, which make it easy for the player to activate specific features.

    NucleiLite also includes features for spawning vehicles and providing the player with all the weapons available in the game, using loops and collections

    There's an associated Wiki-page that offers both a Simplified Version, designed for those with no developing background, and an Advanced Version, which delves into the concepts of C# and the ScriptHookVDotNet and LemonUI Libraries. The Wiki-page provides in-depth explanations, images, and examples, making it easy for beginners to follow along.

    The mod includes events that react to user inputs such as key presses, list item changes and checkboxes, as well as a Tick event that continuously checks for specific conditions to execute code.

    Feature List

    • Getting Started with Visual Studio Code
    • Creating your First Script
    • Six standalone scripts that are activated with KeyPresses
      • Fix Player Script
      • Invincible Script
      • Adjust Wanted Level Script
      • Super Jump Script
      • Spawn Vehicle Script
      • Give All Weapons Script
    • Setting up an IDE
    • A menu (F5) that implements each script using LemonUI
      • A Main Menu (NativeMenu) with three sub menus
        • Player Menu (NativeMenu)
          • Fix Player Item (NativeItem)
          • Invincible Checkbox (NativeCheckboxItem)
          • Wanted Level ListItem (NativeListItem)
          • Super Jump Checkbox (NativeCheckboxItem)
        • Vehicle Spawner Menu (NativeMenu)
          • A list of items (NativeItem) that represents each vehicle in game and spawns your favorite
        • Weapons Menu (NativeMenu)
          • Give All Weapons (NativeItem)

    Find it on GitHub

    Both the mod and its associated Wiki-page can be found at GitHub

    NucleiLite - Source Code
    NucleiLite - Wiki

    If you just want to see what we'll be building together, you can download the release here
    NucleiLite - Release

    Where to Next?

    There is a lot of concepts, best practices, functionality and code improvements we didn't cover in the NucleiLite version - however i'm working on a Complete Mod Menu with 100+ features, every NativeItem covered, services, abstract classes, generics, and much more using ScriptHookVDotNet and LemonUI called Nuclei - this will also have an associated Wiki-page

    The Nuclei is an early work-in-progress and the Wiki needs an overhaul, you can follow along as I continue the Jouney there.

    Nuclei - Source Code
    Nuclei - Wiki

    Note

    The Nuclei mod and Wiki were created prior to the development of the NucleiLite. Therefore, in order to maintain consistency in the structure, I need to pause and reevaluate how to implement the Nuclei mod so that both guides are aligned in terms of their content.

    Feedback

    Thank you for taking the time to check out my project, NucleiLite. I hope you found it informative and helpful for your modding experience in Grand Theft Auto V.

    I would love to hear your feedback on the project, including any suggestions or improvements you would like to see. Did you find the explanations clear and easy to follow? Were the examples helpful? Is there anything you feel was missing or could have been improved upon?

    Your feedback is important to me and will help me to continue to develop useful resources for the modding community. Thank you again for your time and consideration.



  • @KimonoBoy

    Hi.
    I've already provided my feedback and complimented you on a terrific asset for the community.
    Would strongly suggest you shorten and reword the Title.
    First and foremost I see this as a beginner's guide to scripting, although it's much more than that.
    Something along GTA 5 Beginner's Guide to Scripting would likely attract a broader audience than say "Mod Menu"
    Just my thoughts!

    @meimeiriver Can you pin this? Nothing else comes even close.



  • @JohnFromGWN said in [Tutorial] A Beginner's Guide to GTA V Scripting:

    @KimonoBoy

    Hi.
    I've already provided my feedback and complimented you on a terrific asset for the community.
    Would strongly suggest you shorten and reword the Title.
    First and foremost I see this as a beginner's guide to scripting, although it's much more than that.
    Something along GTA 5 Beginner's Guide to Scripting would likely attract a broader audience than say "Mod Menu"
    Just my thoughts!

    @meimeiriver Can you pin this? Nothing else comes even close.

    Updated per your suggestion! Thanks! And thank you for your support and feedback throughout this - I think it's in a pretty good state at this time! But more feedback, requests and the likes are welcome!

    I didn't implement your script from earlier, but I did find a use for it in the complete Nuclei Mod-section, you'll see in time :thumbsup:







  • @KimonoBoy said in [Tutorial] A Beginner's Guide to GTA V Scripting:

    But more feedback, requests and the likes are welcome!

    I'll share with you some frustrations from my own journey. I'm not a programmer but I managed to get to a level of autonomy where I can do essentially everything I want to do.

    As I wrote before, I wish a guide like yours had been available when I started. Most of my code is with native functions because I struggled finding the proper documentation for SHVDN. Didn't even realize at the time that V2 and V3 were not compatible. I did have intellisense but there were other features of VS that I wasn't aware of that could have facilitated my journey.

    I think you linked to the docs from nitanmarcel but unfortunately they are outdated and incomplete. I gave up on them very quickly.

    So an example of my frustration? Knowing how to install a modkit with the Native functions but not being able to find the equivalent in SVHDN:

    MyVehicle.Mods.InstallModKit(); //SVHDN

    and even trickier to find code like this:
    VehicleMod vehicleMod = vehicle39.Mods[VehicleModType.Spoilers];

    My suggestion? And I apologize if you already covered this in the wiki, beyond just intellisense, is to have a section on how to find documentation (other than just methods and properties).

    I would include using F12 to expose metadata and ctrl + alt + J for the object browser - with a robust explanation of how to use these with SHVDN.

    Also I would link to https://github.com/crosire/scripthookvdotnet/tree/main/source/scripting_v3
    and help the user decipher the enums and source code, so they, unlike me, can easily find Mods.InstallModKit() which was a huge PITA. Not even sure how i finally found it, which also explains why my code is almost all native functions.

    Edit: To find how to install a modkit, it is buried here:
    https://github.com/crosire/scripthookvdotnet/blob/main/source/scripting_v3/GTA/Entities/Vehicles/VehicleModCollection.cs

    It's relatively easy for me now, after many unproductive hours of searching, to know where to look...but it was intimidating asF when I first started out.



  • @JohnFromGWN said in [Tutorial] A Beginner's Guide to GTA V Scripting:

    @KimonoBoy said in [Tutorial] A Beginner's Guide to GTA V Scripting:

    But more feedback, requests and the likes are welcome!

    I'll share with you some frustrations from my own journey. I'm not a programmer but I managed to get to a level of autonomy where I can do essentially everything I want to do.

    As I wrote before, I wish a guide like yours had been available when I started. Most of my code is with native functions because I struggled finding the proper documentation for SHVDN. Didn't even realize at the time that V2 and V3 were not compatible. I did have intellisense but there were other features of VS that I wasn't aware of that could have facilitated my journey.

    I think you linked to the docs from nitanmarcel but unfortunately they are outdated and incomplete. I gave up on them very quickly.

    Honestly, I've never used the Documentation page, I used the object browser, IntelliSense and Go to Definition (F12) myself. I didn't double-check whether this documentation from nitanmarcel was up-to-date but used it as a reference because Crosire was referencing the docs himself. But i'll investigate.

    So an example of my frustration? Knowing how to install a modkit with the Native functions but not being able to find the equivalent in SVHDN:

    MyVehicle.Mods.InstallModKit(); //SVHDN

    and even trickier to find code like this:
    VehicleMod vehicleMod = vehicle39.Mods[VehicleModType.Spoilers];

    My suggestion? And I apologize if you already covered this in the wiki, beyond just intellisense, is to have a section on how to find documentation (other than just methods and properties).

    I would include using F12 to expose metadata and ctrl + alt + J for the object browser - with a robust explanation of how to use these with SHVDN.

    The object-browser is covered as part of the documentation section under Visual Studio Features - the F12 or CTRL + Click is also covered in that section!

    Also I would link to https://github.com/crosire/scripthookvdotnet/tree/main/source/scripting_v3
    and help the user decipher the enums and source code, so they, unlike me, can easily find Mods.InstallModKit() which was a huge PITA. Not even sure how i finally found it, which also explains why my code is almost all native functions.

    Edit: To find how to install a modkit, it is buried here:
    https://github.com/crosire/scripthookvdotnet/blob/main/source/scripting_v3/GTA/Entities/Vehicles/VehicleModCollection.cs

    It's relatively easy for me now, after many unproductive hours of searching, to know where to look...but it was intimidating asF when I first started out.

    In Nuclei we'll create a complete Vehicle Mod Menu-section, where we use smart logic to automatically determine all valid mods for the Vehicle, while also being able to change the mods and get immediately feedback in our menu with correct mod names, it'll even Categorize the mods and create sub menus if e.g. both Front Wheels and Rear Wheels are valid if not it'll only create a Wheels menu - I'm actually writing the code as we speak, and here is a sneak-peak

    No Vehicle, No Mod Menu Available
    Test

    In a Vehicle, Mod Menu Becomes Available
    alt text

    Quick draft of the Vehicle Mod Menu Itself
    alt text

    Quick draft of the Wheels menu when on Bike
    alt text

    Changing Vehicle by spawning directly into a new one - updates the menu immediately
    alt text



  • @KimonoBoy

    Looks awesome.



  • I'm necroposting this post because I don't understand why the hell it was never pinned. Seriously? This tutorial, actually 2 tutorials, is the most complete and comprehensive guide to GTA V scripting ever created. The rest, if you can find them buried in some garbage dump, are simplistic one pagers and/or completely outdated.

    It is also an excellent introduction to C# programming in the dot net environment - even covering Visual Studio and the installation of key scripting related mods/files.

    Overall this is the best GTA V modding tutorial, on any topic, period.

    Complete Tutorials:

    Beginner
    https://github.com/KimonoBoy/SHVDNTutorial-NucleiLite/wiki

    Advanced:
    https://github.com/KimonoBoy/SHVDNTutorial-Nuclei/wiki


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.