Create any C# Script in Game and compile in Game 2
276
10
276
10
You did not misread. This script, packaged with a demo mod menu template, will allow the GTA V RAGE engine to assist you in writing and compiling, yes even compiling, a c# script while you are playing the game. This has never been done before.
Major Enhancement Version 2 - Compilation done in GTA V
You no longer need Visual Studio to be open! For those using Visual Studio, the Code Creator Script now will automatically compile your target script which in this demo is the Menu mod script.
Can you imagine no longer going back and forth from Visual Studio to game. No editing and recompiling and alt tabbing dozens of times. The edits and the compilation (build or rebuild) are done in GTA V, in the game itself at run time. You don't even need to have Visual Studio open while editing and adding new code.
IMPORTANT: make sure all the paths are your own including any post build paths you might have, if not this will drive you nuts.
IMPORTANT: if you're creating a mod menu, based on this code, remember that the index must start at 0. If not this will also drive you crazy. If in doubt, just delete the Counter.txt file in the Menu folder.
By default, F5 is for location name, capture, and append. F6 is for compilation. After compilation, restart SHDVN. This part will not be automated as it should be on demand.
Introduction
I had a dream. What if you could actually write a script while in GTA V, I mean while you're in the game. I don't mean alt tabbing or ctrl escaping back and forth, I meant the game would record player stats like positions, or record car colors and extras, or what a ped was wearing and which hairstyle with the game generating the code - RTC - ready to compile code!
They said it couldn't be done. Well that's what I was told when I started modding and didn't know any better. Who was I to question the experts? Fast forward to today and I come to realize this is actually much simpler than it seems and is entirely doable. In fact it's done and now uploaded.
The Tools
The download contains two customizable tools in the form of C# source code:
1. A simple LemonUI Menu Script with pre-defined standard functions but non-functional as is.
2. The second tool is the Creator Script which ofc creates the script.
In our demo this is a simple LemonUI Mod for teleports, but it is created while in game. Yes, while in game. The Creator script captures input by the dev (or user) and appends it to the Menu Script. Of course you will need to recompile the Menu script as code is appended directly to it, in the background while you are in game. The code is appended by the Creator Script. After the recompile you will need to refresh SHVDN.
Installation
None required. Source codes needs to be compiled with VS or other compiler. File paths need to be updated to reflect user's directories/folders rather than mine. Requirements are the usual: SH5 and latest build of SHVDN and LemonUI. You might need nightly build of SHVDN.
Configuration
You can change whatever you want since you have the source code. Keep in mind the comments that start with \\ INSERT are used by the Creator code so caution if you play with these. Also, a Counter.txt file is also saved to keep track of how many locations (in this demo) you have created as the items are incremented. Also note that the items in the LemonUI menu must start at 0, so start with a clean counter text file. If necessary, delete the file. It will be recreated. Also good practice to close the Menu Script while in game.
N.B. The Counter.txt allows you to create locations, shutdown, restart, and have the counter properly reflect where you are.
Major Enhancement Version 2 - Compilation done in GTA V
You no longer need Visual Studio to be open! For those using Visual Studio, the Code Creator Script now will automatically compile your target script which in this demo is the Menu mod script.
Can you imagine no longer going back and forth from Visual Studio to game. No editing and recompiling and alt tabbing dozens of times. The edits and the compilation (build or rebuild) are done in GTA V, in the game itself at run time. You don't even need to have Visual Studio open while editing and adding new code.
IMPORTANT: make sure all the paths are your own including any post build paths you might have, if not this will drive you nuts.
IMPORTANT: if you're creating a mod menu, based on this code, remember that the index must start at 0. If not this will also drive you crazy. If in doubt, just delete the Counter.txt file in the Menu folder.
By default, F5 is for location name, capture, and append. F6 is for compilation. After compilation, restart SHDVN. This part will not be automated as it should be on demand.
Introduction
I had a dream. What if you could actually write a script while in GTA V, I mean while you're in the game. I don't mean alt tabbing or ctrl escaping back and forth, I meant the game would record player stats like positions, or record car colors and extras, or what a ped was wearing and which hairstyle with the game generating the code - RTC - ready to compile code!
They said it couldn't be done. Well that's what I was told when I started modding and didn't know any better. Who was I to question the experts? Fast forward to today and I come to realize this is actually much simpler than it seems and is entirely doable. In fact it's done and now uploaded.
The Tools
The download contains two customizable tools in the form of C# source code:
1. A simple LemonUI Menu Script with pre-defined standard functions but non-functional as is.
2. The second tool is the Creator Script which ofc creates the script.
In our demo this is a simple LemonUI Mod for teleports, but it is created while in game. Yes, while in game. The Creator script captures input by the dev (or user) and appends it to the Menu Script. Of course you will need to recompile the Menu script as code is appended directly to it, in the background while you are in game. The code is appended by the Creator Script. After the recompile you will need to refresh SHVDN.
Installation
None required. Source codes needs to be compiled with VS or other compiler. File paths need to be updated to reflect user's directories/folders rather than mine. Requirements are the usual: SH5 and latest build of SHVDN and LemonUI. You might need nightly build of SHVDN.
Configuration
You can change whatever you want since you have the source code. Keep in mind the comments that start with \\ INSERT are used by the Creator code so caution if you play with these. Also, a Counter.txt file is also saved to keep track of how many locations (in this demo) you have created as the items are incremented. Also note that the items in the LemonUI menu must start at 0, so start with a clean counter text file. If necessary, delete the file. It will be recreated. Also good practice to close the Menu Script while in game.
N.B. The Counter.txt allows you to create locations, shutdown, restart, and have the counter properly reflect where you are.
First Uploaded: August 29, 2024
Last Updated: August 30, 2024
Last Downloaded: 5 hours ago
21 Comments
More mods by JohnFromGWN:
You did not misread. This script, packaged with a demo mod menu template, will allow the GTA V RAGE engine to assist you in writing and compiling, yes even compiling, a c# script while you are playing the game. This has never been done before.
Major Enhancement Version 2 - Compilation done in GTA V
You no longer need Visual Studio to be open! For those using Visual Studio, the Code Creator Script now will automatically compile your target script which in this demo is the Menu mod script.
Can you imagine no longer going back and forth from Visual Studio to game. No editing and recompiling and alt tabbing dozens of times. The edits and the compilation (build or rebuild) are done in GTA V, in the game itself at run time. You don't even need to have Visual Studio open while editing and adding new code.
IMPORTANT: make sure all the paths are your own including any post build paths you might have, if not this will drive you nuts.
IMPORTANT: if you're creating a mod menu, based on this code, remember that the index must start at 0. If not this will also drive you crazy. If in doubt, just delete the Counter.txt file in the Menu folder.
By default, F5 is for location name, capture, and append. F6 is for compilation. After compilation, restart SHDVN. This part will not be automated as it should be on demand.
Introduction
I had a dream. What if you could actually write a script while in GTA V, I mean while you're in the game. I don't mean alt tabbing or ctrl escaping back and forth, I meant the game would record player stats like positions, or record car colors and extras, or what a ped was wearing and which hairstyle with the game generating the code - RTC - ready to compile code!
They said it couldn't be done. Well that's what I was told when I started modding and didn't know any better. Who was I to question the experts? Fast forward to today and I come to realize this is actually much simpler than it seems and is entirely doable. In fact it's done and now uploaded.
The Tools
The download contains two customizable tools in the form of C# source code:
1. A simple LemonUI Menu Script with pre-defined standard functions but non-functional as is.
2. The second tool is the Creator Script which ofc creates the script.
In our demo this is a simple LemonUI Mod for teleports, but it is created while in game. Yes, while in game. The Creator script captures input by the dev (or user) and appends it to the Menu Script. Of course you will need to recompile the Menu script as code is appended directly to it, in the background while you are in game. The code is appended by the Creator Script. After the recompile you will need to refresh SHVDN.
Installation
None required. Source codes needs to be compiled with VS or other compiler. File paths need to be updated to reflect user's directories/folders rather than mine. Requirements are the usual: SH5 and latest build of SHVDN and LemonUI. You might need nightly build of SHVDN.
Configuration
You can change whatever you want since you have the source code. Keep in mind the comments that start with \\ INSERT are used by the Creator code so caution if you play with these. Also, a Counter.txt file is also saved to keep track of how many locations (in this demo) you have created as the items are incremented. Also note that the items in the LemonUI menu must start at 0, so start with a clean counter text file. If necessary, delete the file. It will be recreated. Also good practice to close the Menu Script while in game.
N.B. The Counter.txt allows you to create locations, shutdown, restart, and have the counter properly reflect where you are.
Major Enhancement Version 2 - Compilation done in GTA V
You no longer need Visual Studio to be open! For those using Visual Studio, the Code Creator Script now will automatically compile your target script which in this demo is the Menu mod script.
Can you imagine no longer going back and forth from Visual Studio to game. No editing and recompiling and alt tabbing dozens of times. The edits and the compilation (build or rebuild) are done in GTA V, in the game itself at run time. You don't even need to have Visual Studio open while editing and adding new code.
IMPORTANT: make sure all the paths are your own including any post build paths you might have, if not this will drive you nuts.
IMPORTANT: if you're creating a mod menu, based on this code, remember that the index must start at 0. If not this will also drive you crazy. If in doubt, just delete the Counter.txt file in the Menu folder.
By default, F5 is for location name, capture, and append. F6 is for compilation. After compilation, restart SHDVN. This part will not be automated as it should be on demand.
Introduction
I had a dream. What if you could actually write a script while in GTA V, I mean while you're in the game. I don't mean alt tabbing or ctrl escaping back and forth, I meant the game would record player stats like positions, or record car colors and extras, or what a ped was wearing and which hairstyle with the game generating the code - RTC - ready to compile code!
They said it couldn't be done. Well that's what I was told when I started modding and didn't know any better. Who was I to question the experts? Fast forward to today and I come to realize this is actually much simpler than it seems and is entirely doable. In fact it's done and now uploaded.
The Tools
The download contains two customizable tools in the form of C# source code:
1. A simple LemonUI Menu Script with pre-defined standard functions but non-functional as is.
2. The second tool is the Creator Script which ofc creates the script.
In our demo this is a simple LemonUI Mod for teleports, but it is created while in game. Yes, while in game. The Creator script captures input by the dev (or user) and appends it to the Menu Script. Of course you will need to recompile the Menu script as code is appended directly to it, in the background while you are in game. The code is appended by the Creator Script. After the recompile you will need to refresh SHVDN.
Installation
None required. Source codes needs to be compiled with VS or other compiler. File paths need to be updated to reflect user's directories/folders rather than mine. Requirements are the usual: SH5 and latest build of SHVDN and LemonUI. You might need nightly build of SHVDN.
Configuration
You can change whatever you want since you have the source code. Keep in mind the comments that start with \\ INSERT are used by the Creator code so caution if you play with these. Also, a Counter.txt file is also saved to keep track of how many locations (in this demo) you have created as the items are incremented. Also note that the items in the LemonUI menu must start at 0, so start with a clean counter text file. If necessary, delete the file. It will be recreated. Also good practice to close the Menu Script while in game.
N.B. The Counter.txt allows you to create locations, shutdown, restart, and have the counter properly reflect where you are.
First Uploaded: August 29, 2024
Last Updated: August 30, 2024
Last Downloaded: 5 hours ago
Created a new video which hopefully will answer some questions as to how this tool works although it really is meant for intermediate to advance scripters - not to magically create scripts, but rather how to save hours of manual coding by doing the code creation directly in game. When we say hours, we mean for mods that repeat similar functions such as saving locations and creating teleport code from those locations. The other major benefit is in game compilation and recompilation.
https://www.youtube.com/watch?v=ijLgkw6c9To
sir I want to learn. but make easy vedios.
and is this for teleports?we need different scripts.teleporting is easy with menu trainer
@dihan546 Hi. No, this isn't for teleports which, like you wrote, can be done by Trainers. I just used teleports as an example. GTA V, as you know, has thousands of native functions. Of interest here are the functions that provide information about basically everything. This proof of concept leverages those specific functions to "manufacture" working code directly in game.
Why did I choose locations? Not just because they ares simple and practical, but rather because it’s both useful and easy to grasp. Recently I uploaded a script dedicated to visiting (teleporting) sites in Blaine and Los Santos Counties. I essentially had 2 options to work with. I did not have the third option, the code in this download, until I was very advanced in my GTA V Tourist script – which is a shame considering how easy it would have made the process. Here are the 2 options at the time and the 3rd, newly created, to do this while in game.
1. Code all the locations manually by displaying them on the HUD, writing them on paper, and transferring them, by hand, one by one. Not fun, not efficient, very easy to make mistakes.
2. Use Menyoo Teleport Favourites to capture the location and store it in xml files. Then create a script to parse through all the xml and return the x, y, z, and headings and concatenate them into working code. An improvement and more efficient.
3. By script. Use this tool/script's approach. Native functions provide anything you want to know. What player is wearing, what car he is driving, the weather, the time, the closest ped etc. In this case, we just want the location. This script shows how to capture that location while in game. It then appends the captured data directly into 1 or more .cs files which are templates with minimal, but required, code. Once compiled, these appended files create the final product. In this case it is a mod menu. Using this method would have saved me 20 hours or so of coding.
To the best of my knowledge, AFAIK, this has never been done before. Certainly not to this extent. This goes far beyond just writing coordinates, or other date, to a text file. It actually creates ready to compile code. The fact that it is LemonUI based code doesn’t mean you can’t use a similar method for just about anything that involves data. The limits are your imagination and creativity.
@dihan546 To learn more, I encourage you to go through the code. There are two components. The first, and this applies specifically to this demo, are LemonUI based mod menus. You need to understand how to code these before going any further. I uploaded a template, here in the Tools section, that might help.
The next component is how to capture input in game and then append it to text files which in case are .cs files in a Visual Studio Project.
Go through the code and try to make sense of it. The code itself is straightforward. The approach however is innovative and extremely efficient.
FOR CLARIFICATION: this isn't a teleportation script. This is fully working proof of concept source code that allows a dev or very ambitious user to create c# dot net scripts in GTA V while in game. In other words a script that creates scripts. Rather than just appending strings to text files, this code goes a step further and creates ready to compile applications. In fact, and I'll look into this, it could be possible for this code also compile in the background from the VS command prompt. I'll look into that.
JFGWN, you again mate presenting a wonderful script! Your contribution to the community is amazing! I really really appreciate that and yes, I never imagine someone could do something like you did. Super congrats for this masterpiece!
dayuuum levelling up once again awesome!
just to clarify and apologies if this is a retard question. does creation include editing and fixing existing scripts?
for example in game could the hot coffee script be tweaked to also be hot latte or could the Koenigsegg door script be calibrated to whatever existing version of SHVDN the user is using?
disclaimer. i limit my scripts to the bare essentials so hot coffee is not one i use, the koenigsegg door script is one i want to use but currently cant.
@JohnFromGWN one last question can add sound and animation mod with this script?
@dihan546 I'll try and clarify this for you. There are 2 parts to the script.
1. The code creator captures user input, appends the input to the target script (point 2), and with version 2 compiles the target script. It can contain anything you want, peds, vehicles, animations, missions, whatever you want. The demo is for teleportation. This is the input.
2. The Target Script. This is the output. It will contain some code but most of the code will be in your Code Creator.
So getting back to the demo. Creator gets the name of the location from the user, the coordinates are from the game. It appends this to the Target Script (in this demo it just happens to be a Menu), and in Version 2 it compiles the script. You then restart SHVDN. The Target Script (Menu in demo) had some code as a framework which is completed by the Code Creator.
2
@gtavjamal thanks!
New video added that shows how easy it is to automatically compile the target script, the menu mod, directly from the game - while in GTA V. This is innovation!
@jrchaves Thank you, that's very kind and appreciated. This mod of course is niche, but I hope it can help. For example, if someone had the inclination, that could quickly code a menu that has all the interiors from the Open or Enable Interiors script or whatever it's called (I don't use it personally).
@gtavjamal No this is definitely not an editor, it will not fix broken code. With respect to Hot Coffee I wrote a version for myself, as a learning experience, which is a hundred times better than the ones found here. Why? Because it is 100% immersive, no menus, no stupid ringing notifications, and the partner doesn't walk away when finished. With respect to the door script, what is the issue? I can teach you how to decompile for personal use with free tools - but it's not a fun process when you get obfuscated crap or decimals instead of native functions - much better if you learn how to script yourself.
where to put these downloaded files ?there is no dll files.most of the files are visual studio files.
how to chat with you where is your discoed?
@dihan546 All the files are Visual Studio files, that's correct. This is why this mod is in the tools section and not the scripts section. What you have here is the source code for a menu and a code creator. Each can be customized. If you want dlls the code creater will create the menu mod and you will find it in your bin folder. If you want the dll to compile directly to your scripts folder you will need to go under Projects and look at the post build event. I'm sorry I'm not writing any tutorials on Visual Studio but you will find quite a few with Google or your fav search engine.
@dihan546 One thing I forgot to add. The reason I didn't package these as dlls, in addition to the source code, is that the paths are hard coded. My VS paths are on an M drive/partition and my output (scripts folder) is on a P drive. It would be one helluva of coincidence if other users had the same paths. In order to get this to work, you need to go in the source code, change the paths to reflect your drives and/or partitions and folders and subfolders.
@JohnFromGWN you are too kind thank you all the same but it's way over my head i know my limits lol. . one of my older bros is the programmer in the family but he is a serious mofo who hates games. btw nice latest goodies over at LL.
@JohnFromGWN sir please stop texting😥. make a vedio where you showed making a proper dll script to work this mod.i be learned making script from hkh19 but that is basic....your one is loking great.but small mistake will destroy scrippts.so we need vedio so that we can watch everytime and make this mod working.
@dihan546 There are 2 videos. What else do you want me to add? As I wrote before, the mod templates is just an example to create a mod menu. Anything else has to be customized yourself. Similarly, the code creator has 2 functions. 1. It appends code (which you need to customize unless you want a mod menu) and 2. It compiles the mod template so you don't alt tab out of GTA V. You will need to restart SHVDN however and that definitely should be on demand only.