Jump to content

[V|REL|HOOK] LUA Plugin for Script Hook V


Recommended Posts

diamond-optic

ok i might have solved my issue..

 

not sure exactly what did it, but here is the last few things I did:

 

 

- Renamed the 'Rockstar Games' folder in C:\Users\USERNAME\Documents (this folder was backed up from my old win7 install).

- Went into my GTA install folder removed the dxgi.dll from sweetfx

- also in the gta install folder I went to the 'CommonRedist\DirectX\Jun2010' folder and ran the DXSETUP.exe (even though I had already used the dxwebsetup.exe downloaded from microsoft..)

- Started the game and played the intro crap again till I could save the game and had no crashes..

- exited the game

- went back into the documents folder and deleted the new rockstar games folder and renamed my old rockstar games folder backup again

- started the game and my save loaded fine and seemed to work with no crashes

- put the sweetfx dxgi.dll back into the gta install folder

- loaded the game and it crashed!

- removed the sweetfx dll and restarted the game.. no crash

 

 

so now im wondering if its actually sweetfx causing this crash. It seems to crash when the sweetfx on screen msg says that its reloading.. which happens when alt-tabbing or changing some graphics related stuff.. and it also happens when this plugin (i run the SDK version) causes my game to switch to windowed mode when the console opens.

..no idea why its causing it to crash now but wasnt before, im going to keep working on this and see what I can figure out as I dont want to play without my custom sweetfx config anymore lol

 

 

 

*EDIT*

 

OMG i am so dumb haha

 

yeah it was sweetfx causing it (in combination with the lua sdk console causing the game to switch to windowed mode) because I completely forgot to add the gta exe to the exclusion list for the OSD in evga precision.. as now I remember this same thing happened months ago when i first put sweetfx on lol. Even with the OSD turned off it still causes it to crash, but now with it in the exlusion list the game works fine..

 

 

 

gahhh so embarrassing lol

Edited by diamond-optic

if anyone wants to continue it

https://github.com/gallexme/ScriptHook-Lua-Plugin

here is the source of it (its older(2months older then lastes changes) and maybe a bit broken

if anyone willing to update it just make some pull requests and i will update the mod here

Edited by headscript
  • 2 weeks later...
diamond-optic

LUA Plugin Download is inactive, please reupload

 

you can still download it on github...

 

 

 

 

but on a side note, im now starting to wonder if its a good time for me to learn how to convert my lua scripts to asi files instead. But I havent touched visual studio in a while lol (not since compiling my own custom builds of xbmc for my softmodded original xbox lol) ..I miss this plugin being updated :( but i understand none the less...

Edited by diamond-optic

 

LUA Plugin Download is inactive, please reupload

 

you can still download it on github...

 

 

 

 

but on a side note, im now starting to wonder if its a good time for me to learn how to convert my lua scripts to asi files instead. But I havent touched visual studio in a while lol (not since compiling my own custom builds of xbmc for my softmodded original xbox lol) ..I miss this plugin being updated :( but i understand none the less...

 

you could still update the plugin :D (i may gonna do it this month, if no one is willing to update it)

3 people said they would do it, but only one told me that he started(since then i only heard that its compilling fine)

diamond-optic

you could still update the plugin :D (i may gonna do it this month, if no one is willing to update it)

3 people said they would do it, but only one told me that he started(since then i only heard that its compilling fine)

yeah, if I could I would lol.. But taking an outdated source that you said might be a little broken is probably way beyond me. The majority of coding that ive done in recent years was in Pawn and even that wasnt all that recent, but it did make picking up LUA pretty simple. Not sure how it would go if I tried to do something with this plugin's source...

Current Version: 9,10.0

Description:

Write any LUA Script for GTA5

you are able to use all Natives from NativeDB

 

 

 

Changelog

 

Requirements:

Installation Instructions:

  1. Extract LUA.zip
  2. Move the LUA.asi in the GTA5 Folder where the ScriptHookV.dll is located
  3. Place the scripts folder in the GTA 5 Folder
  4. Add any Scripts you want into the scripts/addins folder
  5. Run GTA 5 over Steam or Rockstar Launcher

Extra Note:

I can convert your Lua Scripts to fully Independent .asi files for safety/speed just write me a PM

Example:

local basemodule = {}basemodule.GUI = Libs["GUI"]function basemodule.unload()endfunction basemodule.giveWeapon(weapon)    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PLAYER.PLAYER_PED_ID(), GAMEPLAY.GET_HASH_KEY(weapon), 1000, true)endfunction basemodule.init()    bodyguard.GUI.addButton("Give Me RAILGUN",basemodule.giveWeapon,"WEAPON_RAILGUN",0,0.2,0.05,0.05)endfunction basemodule.tick()    basemodule.GUI.tick()endreturn basemodule 

Download:

LUA Plugin Download

 

Found a Bug?

Report them here: https://github.com/gallexme/LuaPlugin-GTAV/issues

 

Thanks for your Love and Support: martysama0134 (i owe you something)

 

Current Version: 9,10.0

Description:

Write any LUA Script for GTA5

you are able to use all Natives from NativeDB

 

 

 

Changelog

 

Requirements:

Installation Instructions:

  1. Extract LUA.zip
  2. Move the LUA.asi in the GTA5 Folder where the ScriptHookV.dll is located
  3. Place the scripts folder in the GTA 5 Folder
  4. Add any Scripts you want into the scripts/addins folder
  5. Run GTA 5 over Steam or Rockstar Launcher

Extra Note:

I can convert your Lua Scripts to fully Independent .asi files for safety/speed just write me a PM

Example:

local basemodule = {}basemodule.GUI = Libs["GUI"]function basemodule.unload()endfunction basemodule.giveWeapon(weapon)    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PLAYER.PLAYER_PED_ID(), GAMEPLAY.GET_HASH_KEY(weapon), 1000, true)endfunction basemodule.init()    bodyguard.GUI.addButton("Give Me RAILGUN",basemodule.giveWeapon,"WEAPON_RAILGUN",0,0.2,0.05,0.05)endfunction basemodule.tick()    basemodule.GUI.tick()endreturn basemodule 

Download:

LUA Plugin Download

 

Found a Bug?

Report them here: https://github.com/gallexme/LuaPlugin-GTAV/issues

 

Thanks for your Love and Support: martysama0134 (i owe you something)

 

The download link does not work

headscript please update this plugin, i still use this to make my mod and this is very outdated, many users say its not working for them and if this working there some issue or sometime crash.

Edited by rayblazes

headscript please update this plugin, i still use this to make my mod and this is very outdated, many users say its not working for them and if this working there some issue or sometime crash.

i got no time to work for no money anymore, every minute i work i do for living

you could update the mod yourself, or let someone else do it , or collect money that i will do it

The Duke of Rockford

Any suggestions on where to find the latest maintained versions of this now that you are no longer maintaining it? It's required for a plugin I used (Ped Money [LUA]) and I'm not sure if it will work with latest GTA V patch. I don't know who is taking up work on this now or where to go now.

Any suggestions on where to find the latest maintained versions of this now that you are no longer maintaining it? It's required for a plugin I used (Ped Money [LUA]) and I'm not sure if it will work with latest GTA V patch. I don't know who is taking up work on this now or where to go now.

 

 

Both the LUA Plugin (from here: https://github.com/gallexme/LuaPlugin-GTAV/archive/master.zip [last compiled 06-14-15]) and the Ped Money script work fine with the latest gtav version

Edited by diamond-optic
  • 2 weeks later...

I've been looking everywhere but I can't seem to figure out how to write to .txt file - could someone be so kind as to post an example?

 

I have checked all of the LUA documentation I have tried the following:

 

local file = io.open("test.txt", "w")

file:write("test")

 

But the script bombs out and no text appears in my file.

diamond-optic

I've been looking everywhere but I can't seem to figure out how to write to .txt file - could someone be so kind as to post an example?

 

I have checked all of the LUA documentation I have tried the following:

 

local file = io.open("test.txt", "w")

file:write("test")

 

But the script bombs out and no text appears in my file.

 

 

 

are you closing the file after you write it?

 

 

this works (the time related stuff is just to stop one keypress from registering as a bunch..):

 

 

local WriteTest = {}

 

local CurrentTime

local GameTime

 

function WriteTest.init()

 

GameTime = GAMEPLAY.GET_GAME_TIMER()

 

end

 

function WriteTest.tick()

 

if(get_key_pressed(Keys.F12)) then

 

CurrentTime = GAMEPLAY.GET_GAME_TIMER()

 

if((CurrentTime - GameTime) > 500) then

 

GameTime = CurrentTime

 

local file = io.open("test.txt", "w")

file:write("write test...")

file:close()

 

end

end

end

 

return WriteTest

 

Edited by diamond-optic

 

I've been looking everywhere but I can't seem to figure out how to write to .txt file - could someone be so kind as to post an example?

 

I have checked all of the LUA documentation I have tried the following:

 

local file = io.open("test.txt", "w")

file:write("test")

 

But the script bombs out and no text appears in my file.

 

 

 

are you closing the file after you write it?

 

 

this works (the time related stuff is just to stop one keypress from registering as a bunch..):

 

 

local WriteTest = {}

 

local CurrentTime

local GameTime

 

function WriteTest.init()

 

GameTime = GAMEPLAY.GET_GAME_TIMER()

 

end

 

function WriteTest.tick()

 

if(get_key_pressed(Keys.F12)) then

 

CurrentTime = GAMEPLAY.GET_GAME_TIMER()

 

if((CurrentTime - GameTime) > 500) then

 

GameTime = CurrentTime

 

local file = io.open("test.txt", "w")

file:write("write test...")

file:close()

 

end

end

end

 

return WriteTest

 

 

Yup, I got it working, not sure where it was going wrong before:

 

Buttkicker = ScriptThread("Buttkicker")

Buttkicker:Register()

function Buttkicker:Run()

car = ("incar")

ped = ("ped")

while self:IsRunning() do

player_in_vehicle = LocalPlayer():IsInVehicle()

if player_in_vehicle == true then

local file = io.open ("GTALua/addons/Buttkicker/Buttkicker.txt", "w")

file:write(car)

io.close(file)

end

if player_in_vehicle == false then

local file = io.open ("GTALua/addons/Buttkicker/Buttkicker.txt", "w")

file:write(ped)

io.close(file)

end

self:Wait(1000)

end

end

 

 

its just a simple script to pass if I'm on foot or in a vehicle to text so AHK can then read it and adjust my subwoofer volume to use one of two presets - a quieter one for on foot and louder one with rev cycle for in vehicles. Its much more reliable then button based macros.

 

Cheers for the quick reply,

 

I do not like encore v please show me how to turn it off, because I'm using enhanced native trainer

 

 

what is encore v?

 

this is encore v

E6loCrb.jpg

Here is the error when using the Enhance trainer

wDxHBg7.jpg

I moved into caps lock hotkey instead f4 as before but still fails

bXXZl9J.png
Edited by hybaby9

oh hmm, changing the menu key for Enhanced Native Trainer works fine for me.. thats odd

 

 

why are you using two trainers that seem to have basically the same menus though?

changing menu keys do not work for me :(
available in lua plugin menu is not right for me, and I think I need to disable it to use enhanced native trainer
Edited by hybaby9
  • 4 weeks later...

Looks like I made not the best choice to develop savehouse mod based on this plugin. Nevertheless, thank you for all your work, headscript.

Does anyone by any chance know how hard it is to migrate from LUA to C# or something else? Code is currently 2300 lines long and mod uses persistence system: https://github.com/prexis74/GTAV-SH-Mod

You could still migrate to Python 3. ;) It might not be the best kind of deal in comparison to the .NET hook but it's very easy to maintain and extend (I've just updated to the latest patch and Python 3.5.0 with no problems at all). And we could really use more contributors... this is actually the most significant problem.

  • 3 weeks later...

Current Version: 9,10.0

Description:

Write any LUA Script for GTA5

you are able to use all Natives from NativeDB

 

 

 

Changelog

 

Requirements:

Installation Instructions:

  1. Extract LUA.zip
  2. Move the LUA.asi in the GTA5 Folder where the ScriptHookV.dll is located
  3. Place the scripts folder in the GTA 5 Folder
  4. Add any Scripts you want into the scripts/addins folder
  5. Run GTA 5 over Steam or Rockstar Launcher

Extra Note:

I can convert your Lua Scripts to fully Independent .asi files for safety/speed just write me a PM

Example:

local basemodule = {}basemodule.GUI = Libs["GUI"]function basemodule.unload()endfunction basemodule.giveWeapon(weapon)    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PLAYER.PLAYER_PED_ID(), GAMEPLAY.GET_HASH_KEY(weapon), 1000, true)endfunction basemodule.init()    bodyguard.GUI.addButton("Give Me RAILGUN",basemodule.giveWeapon,"WEAPON_RAILGUN",0,0.2,0.05,0.05)endfunction basemodule.tick()    basemodule.GUI.tick()endreturn basemodule 

Download:

LUA Plugin Download

 

Found a Bug?

Report them here: https://github.com/gallexme/LuaPlugin-GTAV/issues

 

Thanks for your Love and Support: martysama0134 (i owe you something)

Download link isn't working asking for username and password ?

(...)

Download link isn't working asking for username and password ?

Use the download mirror on gta5-mods.com https://www.gta5-mods.com/tools/lua-plugin-for-script-hook-v instead, as downloads there are available for unregistered users also.

 

Please some moderator / admin to fix download link on first post as change original download link with any mirror on GTAInside, GTA5-mods or something else because seems nobody can enter or access that unknown website http://178.62.61.147 provided by OP without authorization as it just kicks out everyone...

Edited by 65536
  • 3 weeks later...
thebunnyrules

Hi everyone, I'm trying to make variation of svado's car persistence script where the script only saves aircrafts.

 

I want to do this by putting a series of if statements or a loop that checks the type of vehicle and compares it to a list of GTAV aircrafts.

 

It would look something like this:

if(vehicle=hydra) set isaircraft=1

if(vehicle=frogger) set isaircraft=1

etc

 

if(isaircraft=1) run the part of the persistence script that's related to saving

 

I don't know anything about coding LUA or making LUA scripts for the LUA GTA pluggin, can someone suggest a good reference I can use to teach myself?

Edited by thebunnyrules
  • 1 month later...
mockba.the.borg

Hi There...

I have downloaded the source code from the github as I have a feeling that a new patch for GTA V will come out soon, so I want to be able to rebuild LUA at any time.

I have places the build files from the scripthook SDK so they are visible from the LUA solution, but I believe those files are not related to the latest 1.31 patch.

Is there a step-by-step documentation or dependencies list anywhere I could use to successfully rebuild LUA with the latest .h include files?

What other include files are needed to build it successfully?

 

Thanks a lot,

Mockba.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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