Log in to reply
 

Would: A Complete ScriptHookVDotNet Mod Menu Guide be something of interrest?



  • Greetings,

    There's probably already a few guides out there, but would a complete guide on how to develop a mod for GTA 5 using ScriptHookVDotNet be something of interrest?

    A Basic Section for those new to programming in general, and a Advanced Section for those already familiar with programming who would like to get into modding in GTA 5?

    I'm thinking of everything from creating a menu using LemonUI, to working with hashes, saving and loading states, threading, additional eventhandlers on e.g. properties to keep as little logic in Ticks as possible. I'm not sure if it'll be worth it.



  • @KimonoBoy There aren't any good resources on scripting for GTA5 - this is based on my very frustrating personal experience. Nothing at all.

    There were 1 or 2 ppl here who would help on the forums but they seem to be long gone.

    To make a long story short, I learned by trial, error, and experimentation. My only true "guide" was the natives database and a few code snippets on the SHVDN wiki.

    I went on the Lemon discord server 2 or 3 times and although Lemon is very polite and helpful his help was invariably to just give me links to MSDN articles that would have been helpful if I had a doctorate in Computer Science.

    I did get some help on Stack Overflow but that community can be toxic as hell. Rude, arrogant, and impatient.

    Today I can script in VB.NET, C#.NET, and even lua for FiveM. All self-taught by looking at other scripts and once more trial and error. I have written dozens of LemonUI menus in C# and I recently wrote a terrific DLC selector menu in VB.

    So yes there is a need.

    Start with something basic and see what feedback you get, maybe just in text form (no compiling) to get ppl interested before they make the jump to VS.

    One great lesson for new users would be how to spawn a vehicle from a script. If they knew that, they wouldn't be constantly bitching about persistence or scrambling to add even more mods (for persistence) when one line of code would solve their issue.

    Edit: I'm not a programmer, no aspirations to ever be one, but I have a very solid background in computing and I'm at the stage where I can do everything I want through scripting, particularly with LemonUI.

    So if you need a contributor, a helping hand, count me in.



  • @JohnFromGWN

    Thank you for the reply, this response was way more positive than I did initially anticipate. And i'm glad you found your way through, even with the lack of support. But I guess that's to be expected.

    I was thinking of something like the following:

    Introduction

    • Purpose of the guide

    • Explanation of ScriptHookVDotNet (and ScriptHookV)

    Setting up ScriptHookVDotNet

    • Downloading ScriptHookVDotNet

    • Installing ScriptHookVDotNet

    • Setting up a development environment

    Understanding the basics of C# programming language (Short introduction to each, cover them with code examples in the next section??)

    • Variables

    • Data types

    • Operators

    • Methods

    • Return Values

    • Events

    Writing your first ScriptHookVDotNet script

    • Creating a new project

    • Importing ScriptHookVDotNet library

    • Writing code to display a message on the screen

    • Compiling and testing the script

    Advanced ScriptHookVDotNet techniques

    • Understanding Ticks

    • Interacting with game entities

    • Creating custom menus (LemonUI)

    • Handling user inputs

    • Implementing custom logic

    Best practices for ScriptHookVDotNet scripting

    • Code organization and commenting

    • Debugging techniques

    • Performance optimization tips

    Conclusion

    • Summary of key points covered in the guide

    • Final thoughts and recommendations for further learning.



  • @JohnFromGWN

    I was also thinking about just re-creating the script that ScriptHookV ships with, but in ScriptHookVDotNet - so basically just a guide on how to do the entire NativeTrainer, from start to finish.

    I'd be happy to get some help, I'll let you know when :thumbsup: But first, I think we can discuss here, how the overall form should be presented?



  • @KimonoBoy
    A couple points.
    First, that's an excellent curriculum but I'm going to suggest an additional step and one change.

    The additional step. To whet the appetites of novices, give them something simple and very useful to start. Just a text file (.3.cs format) to remove VS complexity at the start. Could be a simple script to spawn a ped fully customized (drawables/textures) or a vehicle with a color variation.
    Something along those lines. My thinking is that it will get people sitting on the fence to go "wow this is cool and easy", let's follow the rest of the course.

    The change. I wouldn't go the Native Trainer route because they all have Menyoo, Simple Trainer, ENT, or all 3 .....or even more.

    Instead, I'm going to suggest you demo a very simple LemonUI trainer and the advantages it has over all the others - i.e. the ability to organize your mods and spawn entities fully customized to your specifications. Menyoo has the limited ability to save teleports for example, but you end up with one huge ass list of teleports. LemonUI allows you to create submenus for the sake of being organized.

    Similarly, many users here have 500 cars or more installed. The addon spawner mod is ok, but can't compete with personal categories. For example, I have my huge collection of Ferraris the way I want them (by 8, 12 cylinders, classics, exotics, etc) and the flexibility to categorize them any way I want.



  • @JohnFromGWN said in Would: A Complete ScriptHookVDotNet Mod Menu Guide be something of interrest?:

    @KimonoBoy
    A couple points.
    First, that's an excellent curriculum but I'm going to suggest an additional step and one change.

    The additional step. To whet the appetites of novices, give them something simple and very useful to start. Just a text file (.3.cs format) to remove VS complexity at the start. Could be a simple script to spawn a ped fully customized (drawables/textures) or a vehicle with a color variation.
    Something along those lines. My thinking is that it will get people sitting on the fence to go "wow this is cool and easy", let's follow the rest of the course.

    The change. I wouldn't go the Native Trainer route because they all have Menyoo, Simple Trainer, ENT, or all 3 .....or even more.

    Instead, I'm going to suggest you demo a very simple LemonUI trainer and the advantages it has over all the others - i.e. the ability to organize your mods and spawn entities fully customized to your specifications. Menyoo has the limited ability to save teleports for example, but you end up with one huge ass list of teleports. LemonUI allows you to create submenus for the sake of being organized.

    Similarly, many users here have 500 cars or more installed. The addon spawner mod is ok, but can't compete with personal categories. For example, I have my huge collection of Ferraris the way I want them (by 8, 12 cylinders, classics, exotics, etc) and the flexibility to categorize them any way I want.

    The novice part is a great idea, but then I think the guide should be split in to two different topics?

    For the LemonUI part you mentioned (that was actually the idea) and just similar functionalities from NativeTrainer - like all the actions are the same, but using LemonUI to represent it. I'm not sure if in the best practices section, I should talk about abstract classes, interfaces, services and repositories. I myself prefer to have an abstract generic class that represents the UI-Layer, to keep each menu and submenu consistent and easier to maintain. But maybe this should also be a complete topic of its own.



  • @KimonoBoy You're the teacher I'll leave it up to you. Just keep in mind if your audience is novices, then give them more practice to begin with - quick wins.

    From my perspective, I wanted to do three things:

    1. Spawn Peds fully customized and organized
    2. Spawn Vehicles fully customized and organized
    3. Teleport, once more organized

    After that it was simple tasks.



  • @KimonoBoy I'll share an example with you.

    One of the first things I wanted to do when I started playing GTA 5 and modding was the ability to switch between the player and another ped.

    I searched everywhere. Nada, nothing.

    I posted here and other forums. Nope, not even a nibble.

    Finally I figured it out on my own and honestly I'm shocked nobody could help, or nobody wanted to help, with something so simple.

    My code lacks elegance, once more I'm not a programmer, but it works.

    if (e.KeyCode == Keys.NumPad0)  //SWITCH FROM PLAYER TO PED AND BACK
                {
                    if (Game.Player.Character == Player1)
                    {
                        Function.Call(Hash.CHANGE_PLAYER_PED, Game.Player, CurrentPed, true, true); // Player 1 is declared above
                        PedGroup PlayerGroup = Game.Player.Character.PedGroup;  //make them buddies
                        Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Player1, PlayerGroup);
                    }
                    else if (Game.Player.Character == CurrentPed)
                    {
                        Function.Call(Hash.CHANGE_PLAYER_PED, Game.Player, Player1, true, true);
                        PedGroup PlayerGroup = Game.Player.Character.PedGroup; //make them buddies
                        Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, CurrentPed, PlayerGroup);
                    }
    
                }
    


  • @JohnFromGWN said in Would: A Complete ScriptHookVDotNet Mod Menu Guide be something of interrest?:

    @KimonoBoy I'll share an example with you.

    One of the first things I wanted to do when I started playing GTA 5 and modding was the ability to switch between the player and another ped.

    I searched everywhere. Nada, nothing.

    I posted here and other forums. Nope, not even a nibble.

    Finally I figured it out on my own and honestly I'm shocked nobody could help, or nobody wanted to help, with something so simple.

    My code lacks elegance, once more I'm not a programmer, but it works.

    if (e.KeyCode == Keys.NumPad0)  //SWITCH FROM PLAYER TO PED AND BACK
                {
                    if (Game.Player.Character == Player1)
                    {
                        Function.Call(Hash.CHANGE_PLAYER_PED, Game.Player, CurrentPed, true, true); // Player 1 is declared above
                        PedGroup PlayerGroup = Game.Player.Character.PedGroup;  //make them buddies
                        Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Player1, PlayerGroup);
                    }
                    else if (Game.Player.Character == CurrentPed)
                    {
                        Function.Call(Hash.CHANGE_PLAYER_PED, Game.Player, Player1, true, true);
                        PedGroup PlayerGroup = Game.Player.Character.PedGroup; //make them buddies
                        Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, CurrentPed, PlayerGroup);
                    }
    
                }
    

    If it works, it works, and for this script, I don't really see how this should be written any better? Yeah, maybe a method containing it's logic to remove duplicate code, but the code is simple and readable.


Log in to reply
 

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