Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sagoza

Compiling and applying script while never closing GTA V

Recommended Posts

Sagoza

Can someone tell me if its possible to script in Visual Studio, compile and merge the file you just created to the previous one and test it, without closing grand theft auto...?

 

If so, can some one either link me the forum link or teach me in few word in this thread?

 

Thankyou

Share this post


Link to post
Share on other sites
c39687

yes it is easy...

 

if you are using scripthookV for ASI plugins then make sure you created an empty file with the name mentioned in the readme (something like "ScripthookV.dev") and it is in the game folder (where the scripthookv.dll is). With this file there you can in game press Ctrl+R to unload all ASI plugins that were setup to unregister on DLL_PROCESS_DETACH in your DLLMain function. So anyways, After you press Ctrl+R and you hear a single beep, then your asi plugins are unloaded. You can now overwrite any ASI files. If you are using visual studio, setup a postbuild event to copy your compiled asi to the GTA V folder or GTAV/asi folder (depends where you put them). So compile your new ASI and install it. Then Alt+Tab back into the game and press Ctrl+R again. You will hear 3 beeps and this means your ASI's are now loaded. I recommend using windowed mode too so Alt-Tabbing is quick.

 

For the .net hook it should be easier as you dont need to unload first (in gta iv, .net script files were not locked while the game was running). The .net hook should have a reloadscripts function and you simply tab out of the game, compile and install your .net scripts, tab back into the game and use the reloadscripts function.

Share this post


Link to post
Share on other sites
Sagoza

@c39687 thankyou, godbless you saved me from alot of iteration timing...

Share this post


Link to post
Share on other sites
c39687

No prob man

Share this post


Link to post
Share on other sites
Ethenal

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

Share this post


Link to post
Share on other sites
c39687

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

Edited by c39687

Share this post


Link to post
Share on other sites
DylanJ

 

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

 

thanks so much for this info its seriously annoying to restart GTA. Anyway Im having trouble understanding what you mean about adding the DLL_PROCESS_DETACH to my script, how would i go about doing this?

Share this post


Link to post
Share on other sites
c39687

 

 

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

 

thanks so much for this info its seriously annoying to restart GTA. Anyway Im having trouble understanding what you mean about adding the DLL_PROCESS_DETACH to my script, how would i go about doing this?

 

In your DllMain function, in your asi plugin's main.cpp, add a case to your switch statement for DLL_PROCESS_DETACH (this will be recognized by Visual Studio as you type). In this case you need to call scriptUnregister (defined in main.h) and pass your script's main function into it... or the same function your script registered ;)

 

Make sure you have the latest release build for the scripthookv and look at the native trainer project for an example (he also registers and unregisters his keyboard code)

//from main.cpp of alexander blade's trainerBOOL APIENTRY DllMain(HMODULE hInstance, DWORD reason, LPVOID lpReserved){    switch (reason)    {    case DLL_PROCESS_ATTACH:        scriptRegister(hInstance, ScriptMain);        keyboardHandlerRegister(OnKeyboardMessage);        break;    case DLL_PROCESS_DETACH:        scriptUnregister(ScriptMain);        keyboardHandlerUnregister(OnKeyboardMessage);        break;    }            return TRUE;}
Edited by c39687

Share this post


Link to post
Share on other sites
DylanJ

 

 

 

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

 

thanks so much for this info its seriously annoying to restart GTA. Anyway Im having trouble understanding what you mean about adding the DLL_PROCESS_DETACH to my script, how would i go about doing this?

In your DllMain function, in your asi plugin's main.cpp, add a case to your switch statement for DLL_PROCESS_DETACH (this will be recognized by Visual Studio as you type). In this case you need to call unregister (defined in main.h) and pass your script's main function into it... or the same function your script registered ;)

 

Make sure you have the latest release build for the scripthookv and look at the native trainer project for an example (he also registers and unregisters his keyboard code)

 

 

 

 

Ah I didnt update my scripthook sdk! thanks a lot! but when im ingame and i press ctrl+r i dont hear no beeps?

Edited by DylanJ

Share this post


Link to post
Share on other sites
c39687

 

 

 

 

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

 

thanks so much for this info its seriously annoying to restart GTA. Anyway Im having trouble understanding what you mean about adding the DLL_PROCESS_DETACH to my script, how would i go about doing this?

In your DllMain function, in your asi plugin's main.cpp, add a case to your switch statement for DLL_PROCESS_DETACH (this will be recognized by Visual Studio as you type). In this case you need to call unregister (defined in main.h) and pass your script's main function into it... or the same function your script registered ;)

 

Make sure you have the latest release build for the scripthookv and look at the native trainer project for an example (he also registers and unregisters his keyboard code)

 

 

 

 

Ah I didnt update my scripthook sdk! thanks a lot! but when im ingame and i press ctrl+r i dont hear no beeps?

 

you didnt create the empty scripthookv.dev file then. The readme is updated too and explans it. Just create a new text document in your game directory. Then rename it to "ScriptHookV.dev". That empty file tells the scripthook you're a developer and it enables the script unload/load functions.

Share this post


Link to post
Share on other sites
DylanJ

 

 

 

 

 

Oh thanks for this, I didn't know that feature was implemented in the C++ script hook. In the .NET one you can press Insert by default, I have a Perl script that copies my .dll and .pdb to the GTA V/scripts folder and the perl script is called in a Post Build event in Visual Studio, so every time I click "Build" in Visual Studio it compiles my script and copies it into the GTA V folder for me and all I have to do is reload the scripts ingame. :D

yeah post build events are great... you can alt+tab out of the game, edit code, compile, alt-tab back into the game and reload scripts in a matter of seconds! :)

 

thanks so much for this info its seriously annoying to restart GTA. Anyway Im having trouble understanding what you mean about adding the DLL_PROCESS_DETACH to my script, how would i go about doing this?

In your DllMain function, in your asi plugin's main.cpp, add a case to your switch statement for DLL_PROCESS_DETACH (this will be recognized by Visual Studio as you type). In this case you need to call unregister (defined in main.h) and pass your script's main function into it... or the same function your script registered ;)

 

Make sure you have the latest release build for the scripthookv and look at the native trainer project for an example (he also registers and unregisters his keyboard code)

 

 

 

 

Ah I didnt update my scripthook sdk! thanks a lot! but when im ingame and i press ctrl+r i dont hear no beeps?

 

you didnt create the empty scripthookv.dev file then. The readme is updated too and explans it. Just create a new text document in your game directory. Then rename it to "ScriptHookV.dev". That empty file tells the scripthook you're a developer and it enables the script unload/load functions.

 

Finally i got it working! I feel so dumb now I created a folder -_-. thanks so freaking much!

Share this post


Link to post
Share on other sites
c39687

lol, no problem ;)

Share this post


Link to post
Share on other sites
FreeOffset

Did not know you could do this, this is so legit and is going to save me so much time :cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie:

Share this post


Link to post
Share on other sites
BoXz_modder

yes it is easy...

 

if you are using scripthookV for ASI plugins then make sure you created an empty file with the name mentioned in the readme (something like "ScripthookV.dev") and it is in the game folder (where the scripthookv.dll is). With this file there you can in game press Ctrl+R to unload all ASI plugins that were setup to unregister on DLL_PROCESS_DETACH in your DLLMain function. So anyways, After you press Ctrl+R and you hear a single beep, then your asi plugins are unloaded. You can now overwrite any ASI files. If you are using visual studio, setup a postbuild event to copy your compiled asi to the GTA V folder or GTAV/asi folder (depends where you put them). So compile your new ASI and install it. Then Alt+Tab back into the game and press Ctrl+R again. You will hear 3 beeps and this means your ASI's are now loaded. I recommend using windowed mode too so Alt-Tabbing is quick.

 

For the .net hook it should be easier as you dont need to unload first (in gta iv, .net script files were not locked while the game was running). The .net hook should have a reloadscripts function and you simply tab out of the game, compile and install your .net scripts, tab back into the game and use the reloadscripts function.

How do you reload .net scripts In-game?

Share this post


Link to post
Share on other sites
Inco

 

yes it is easy...

 

if you are using scripthookV for ASI plugins then make sure you created an empty file with the name mentioned in the readme (something like "ScripthookV.dev") and it is in the game folder (where the scripthookv.dll is). With this file there you can in game press Ctrl+R to unload all ASI plugins that were setup to unregister on DLL_PROCESS_DETACH in your DLLMain function. So anyways, After you press Ctrl+R and you hear a single beep, then your asi plugins are unloaded. You can now overwrite any ASI files. If you are using visual studio, setup a postbuild event to copy your compiled asi to the GTA V folder or GTAV/asi folder (depends where you put them). So compile your new ASI and install it. Then Alt+Tab back into the game and press Ctrl+R again. You will hear 3 beeps and this means your ASI's are now loaded. I recommend using windowed mode too so Alt-Tabbing is quick.

 

For the .net hook it should be easier as you dont need to unload first (in gta iv, .net script files were not locked while the game was running). The .net hook should have a reloadscripts function and you simply tab out of the game, compile and install your .net scripts, tab back into the game and use the reloadscripts function.

How do you reload .net scripts In-game?

 

Insert.

Share this post


Link to post
Share on other sites
Viggokatten

Is it possible to do this with OpenIV?

Share this post


Link to post
Share on other sites
codypilot

This is very helpful in that you can create a symlink (with Windows using MkLink) in your GTA folder which points to your compiled ASI, making the debugging process even more seamless.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.