Drewgamer Posted June 13, 2015 Share Posted June 13, 2015 Updated the official release to v1.0. =) Any idea how bad this will break scripts compiled around v0.9? There are a couple mods I want to keep from 0.9 but there are also some mods from 1.0 I want to use. I was going to do the recompile myself but, unfortunately, these mods don't have source code available and (from my limited knowledge of .net) recompiling from a dll is not possible? Link to comment Share on other sites More sharing options...
Cyron43 Posted June 13, 2015 Share Posted June 13, 2015 And also 2 little notes with the new 1.0 release: Please compile your mods against the new 1.0 release You would do all users a favor if you compile your dll/(.cs) against the new 1.0 release. By doing this, every user can use the same new ScriptHookVDotNet version and does not have to downgrade if he wants to use your mod. We also implemented a lot of new cool stuff, so make sure you checkout the github page! Stick to the released 1.* versions (no nightlies/custom built versions) This is also in the users interest. We will make sure all 1.* versions will contain either no breaking changes or will support proper backwards compatability. This will make sure all scripts compiled against 1.0 will work with them and the user can keep the 1.0 DLL. Thanks Will do. Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted June 13, 2015 Share Posted June 13, 2015 (edited) Nevermind, thanks anyway. Edited June 15, 2015 by Prof_Farnsworth Link to comment Share on other sites More sharing options...
marhex Posted June 16, 2015 Share Posted June 16, 2015 i can't use Hash vehicleModel in my code Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z , Function.Call<float>(Hash._0xF417C2502FFFED43, veh_racer1.GetHashCode()), 1, VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1); i have this error cannot convert from 'GTA.Native.VehicleHash' to 'GTA.Native.InputArgument' Link to comment Share on other sites More sharing options...
Inco Posted June 16, 2015 Share Posted June 16, 2015 Cast to int: (int)VehicleHash.Comet2 Link to comment Share on other sites More sharing options...
marhex Posted June 16, 2015 Share Posted June 16, 2015 Cast to int: (int)VehicleHash.Comet2 i make it like this Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z , Function.Call<float>(Hash._GET_VEHICLE_MAX_SPEED, veh_racer1.GetHashCode()), 1, (int)VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1); then i have this error Constant value '3249425686' cannot be converted to a 'int' (use 'unchecked' syntax to override) Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 (edited) How would i use this? I download the files and open visual studio and create a new windows form application and import the .net script hook as a reference.. now what? All i've seen people all over this forum do is download and instantly start coding, Confusing because there is no tutorial available that i can find about starting coding for .NET Visual Basic... I have the C++ version working though, I'm able to spawn random pedestrians with guns that follow me, but i want to do this is visual basic... Any help would be greatly aprechiated Vector3 me_local_coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 0.0, 0.0);Ped rped1 = PED::CREATE_RANDOM_PED(me_local_coords.x, me_local_coords.y, me_local_coords.z);if (rped1 != playerPed){ PED::SET_PED_MAX_HEALTH(rped1, 9999999); PED::SET_PED_AS_GROUP_MEMBER(rped1, PLAYER::GET_PLAYER_GROUP(PLAYER::GET_PLAYER_INDEX())); WEAPON::GIVE_WEAPON_TO_PED(rped1, 0xAF113F99, 999, true, true); PED::SET_PED_ACCURACY(rped1, 100); PED::SET_PED_CAN_SWITCH_WEAPON(rped1, true); PED::SET_PED_COMBAT_ABILITY(rped1, 2);} Edited June 16, 2015 by Enumerator Link to comment Share on other sites More sharing options...
marhex Posted June 16, 2015 Share Posted June 16, 2015 How would i use this? I download the files and open visual studio and create a new windows form application and import the .net script hook as a reference.. now what? All i've seen people all over this forum do is download and instantly start coding, Confusing because there is no tutorial available that i can find about starting coding for .NET Visual Basic... I have the C++ version working though, I'm able to spawn random pedestrians with guns that follow me, but i want to do this is visual basic... Any help would be greatly aprechiated Vector3 me_local_coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 0.0, 0.0);Ped rped1 = PED::CREATE_RANDOM_PED(me_local_coords.x, me_local_coords.y, me_local_coords.z);if (rped1 != playerPed){ PED::SET_PED_MAX_HEALTH(rped1, 9999999); PED::SET_PED_AS_GROUP_MEMBER(rped1, PLAYER::GET_PLAYER_GROUP(PLAYER::GET_PLAYER_INDEX())); WEAPON::GIVE_WEAPON_TO_PED(rped1, 0xAF113F99, 999, true, true); PED::SET_PED_ACCURACY(rped1, 100); PED::SET_PED_CAN_SWITCH_WEAPON(rped1, true); PED::SET_PED_COMBAT_ABILITY(rped1, 2);} you can start with those like i did: Enumerator 1 Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 (edited) you can start with those like i did: [EDIT] this is for C# not Visual Basic, I'm looking for the visual basic version. Edited June 16, 2015 by Enumerator Link to comment Share on other sites More sharing options...
Inco Posted June 16, 2015 Share Posted June 16, 2015 Cast to int: (int)VehicleHash.Comet2 i make it like this Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z , Function.Call<float>(Hash._GET_VEHICLE_MAX_SPEED, veh_racer1.GetHashCode()), 1, (int)VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1); then i have this error Constant value '3249425686' cannot be converted to a 'int' (use 'unchecked' syntax to override) https://msdn.microsoft.com/en-us/library/a569z7k8.aspx Link to comment Share on other sites More sharing options...
marhex Posted June 16, 2015 Share Posted June 16, 2015 Cast to int: (int)VehicleHash.Comet2 i make it like this Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z , Function.Call<float>(Hash._GET_VEHICLE_MAX_SPEED, veh_racer1.GetHashCode()), 1, (int)VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1); then i have this error Constant value '3249425686' cannot be converted to a 'int' (use 'unchecked' syntax to override) https://msdn.microsoft.com/en-us/library/a569z7k8.aspx thenk you Link to comment Share on other sites More sharing options...
marhex Posted June 16, 2015 Share Posted June 16, 2015 please help me how can add this task to TaskSequence TASK_VEHICLE_DRIVE_TO_COORD TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE and thx Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 (edited) Can someone just upload their [VISUAL BASIC.NET] project file so i can dive straight into it? preferebly with a menu and atleast one hotkey triger. NOT C# or C++ Edited June 16, 2015 by Enumerator Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 Anyone? Link to comment Share on other sites More sharing options...
unknown modder Posted June 16, 2015 Share Posted June 16, 2015 Anyone? havent used VB in about 5 years, but this is basically what you need Imports GTAImports System.Windows.FormsPublic Class EmptyScript Inherits Script Sub New() Interval = 0 End Sub Sub Ontick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick End Sub Sub OnKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown End Sub Sub OnKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyUp End SubEnd Class Remember to create the project as a class library (if using visual studio), add a reference to the ScriptHookVDotNet.dll and System.Windows.Forms.dll. Change the build properties of the project under the compile tab from target cpu = anycpu to x64 and you're good to go Enumerator 1 Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 (edited) Anyone? havent used VB in about 5 years, but this is basically what you need Imports GTAImports System.Windows.FormsPublic Class EmptyScript Inherits Script Sub New() Interval = 0 End Sub Sub Ontick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick End Sub Sub OnKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown End Sub Sub OnKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyUp End SubEnd Class Remember to create the project as a class library (if using visual studio), add a reference to the ScriptHookVDotNet.dll and System.Windows.Forms.dll. Change the build properties of the project under the compile tab from target cpu = anycpu to x64 and you're good to go How do i get that to export the ASI? Also does the scripting also allow threading? Edited June 16, 2015 by Enumerator Link to comment Share on other sites More sharing options...
unknown modder Posted June 16, 2015 Share Posted June 16, 2015 Anyone? havent used VB in about 5 years, but this is basically what you need Imports GTAImports System.Windows.FormsPublic Class EmptyScript Inherits Script Sub New() Interval = 0 End Sub Sub Ontick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick End Sub Sub OnKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown End Sub Sub OnKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyUp End SubEnd Class Remember to create the project as a class library (if using visual studio), add a reference to the ScriptHookVDotNet.dll and System.Windows.Forms.dll. Change the build properties of the project under the compile tab from target cpu = anycpu to x64 and you're good to go How do i get that to export the ASI? Also does the scripting also allow threading? when you compile it it will create a dll which you can copy to a folder called script in the gtav directory, or you can just put the raw .vb file in that folder Enumerator 1 Link to comment Share on other sites More sharing options...
Enumerator Posted June 16, 2015 Share Posted June 16, 2015 when you compile it it will create a dll which you can copy to a folder called script in the gtav directory, or you can just put the raw .vb file in that folder Good stuff, Now all i need to know is where are all the functions like CREATE_RANDOM_PED? Link to comment Share on other sites More sharing options...
Andross90 Posted June 17, 2015 Share Posted June 17, 2015 Is there a changelog at all? Link to comment Share on other sites More sharing options...
Inco Posted June 17, 2015 Share Posted June 17, 2015 Is there a changelog at all? https://github.com/crosire/scripthookvdotnet/compare/v0.9...v1.0 Link to comment Share on other sites More sharing options...
Enumerator Posted June 17, 2015 Share Posted June 17, 2015 Nevermind i found most of the stuff, but it's really strange.... I need both ScripthookV and ScripthookVNet right? Link to comment Share on other sites More sharing options...
unknown modder Posted June 17, 2015 Share Posted June 17, 2015 Nevermind i found most of the stuff, but it's really strange.... I need both ScripthookV and ScripthookVNet right? Yes, and dinput8.dll, should come with scripthookV Enumerator 1 Link to comment Share on other sites More sharing options...
Enumerator Posted June 17, 2015 Share Posted June 17, 2015 (edited) Yes, and dinput8.dll, should come with scripthookV Thanks, I'm able to kill all pedestrians within a certain radius of the player Dim peds As Ped() = World.GetNearbyPeds(Game.Player.Character, 1000.0F)For Each Ped As Ped In peds Ped.Kill()Next However what i'm more interested in is why do i have to restart GTA V every time i create a new Class.DLL? I have developer mode enabled 'ScriptHookV.dev' file in GTA V directory but it only works with the ASI, not for reloading the gamedir/script/*dll's Any reason why we can't do this? Edited June 17, 2015 by Enumerator Link to comment Share on other sites More sharing options...
Inco Posted June 17, 2015 Share Posted June 17, 2015 Yes, and dinput8.dll, should come with scripthookV Thanks, I'm able to kill all pedestrians within a certain radius of the player Dim peds As Ped() = World.GetNearbyPeds(Game.Player.Character, 1000.0F)Dim me_pos As Vector3 = Game.Player.Character.PositionFor Each Ped As Ped In peds Ped.Kill()Next However what i'm more interested in is why do i have to restart GTA V every time i create a new Class.DLL? I have developer mode enabled 'ScriptHookV.dev' file in GTA V directory but it only works with the ASI, not for reloading the gamedir/script/*dll's Any reason why we can't do this? Press Insert to reload .net scripts. Enumerator 1 Link to comment Share on other sites More sharing options...
Enumerator Posted June 17, 2015 Share Posted June 17, 2015 (edited) Here is the code i've built, No one else could use it unless they have an MBED and is using my ILI9340C_Serial_Control Repository code. https://developer.mbed.org/users/Elitism/code/ILI9340C_Serial_Control/ However this should give a base of how to connect through serial ports and sending data via scripthookvdotnet Imports GTAImports GTA.MathImports GTA.NativeImports System.IO.PortsImports System.Windows.FormsPublic Class Class1 Inherits Script ''My Serial Port Private WithEvents COMPort As New SerialPort Sub New() Interval = 0 End Sub ''Constantly UPDATING Variables Dim me_pos As Vector3 Dim me_infront As Vector3 Dim me_temp_pos As Vector3 Dim refresh_tick As Integer = 0 Dim connect_count As Integer = 0 Dim tick_wait As Integer = 2 Sub Ontick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick ''Constantly Updating Variables With Game.Player.Character me_pos = .Position ''My Positition me_infront = .ForwardVector * 10 ''Position infront of me, 10 meters ''Serial Data If connect_count = 1 And me_pos <> me_temp_pos Then If refresh_tick = tick_wait Then COMPort.WriteLine("frect,0,0,240,10,255,255,0") ''Clear previous values (Crappy method) ElseIf refresh_tick = tick_wait * 2 Then COMPort.WriteLine("text," + me_pos.X.ToString + "/" + me_pos.Y.ToString + "/" + me_pos.Z.ToString + ",1,1,1,255,0,0") ''Send Location me_temp_pos = me_pos refresh_tick = 0 End If refresh_tick += 1 End If End With ''Connect to serial port If Game.IsKeyPressed(Keys.PageUp) Then If connect_count = 0 Then connectToPort(921600, "COM3") connect_count = 1 End If End If ''Kill Pedestrians within range 1000 If Game.IsKeyPressed(Keys.K) Then killPedsInRangeofPed(Game.Player.Character, 1000.0F) End If End Sub Private Sub connectToPort(ByVal Baud As Long, ByVal portName As String) COMPort.BaudRate = Baud COMPort.PortName = portName COMPort.Open() End Sub Private Sub killPedsInRangeofPed(ByVal nearWho As Ped, ByVal range As Single) Dim peds As Ped() = World.GetNearbyPeds(nearWho, range) For Each Ped As Ped In peds Ped.Kill() Next End Sub#Region "Not required yet" Sub OnKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown End Sub Sub OnKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyUp End Sub#End RegionEnd Class Edited June 17, 2015 by Enumerator Link to comment Share on other sites More sharing options...
unknown modder Posted June 17, 2015 Share Posted June 17, 2015 Here is the code i've built, No one else could use it unless they have an MBED and is using my ILI9340C_Serial_Control Repository code. https://developer.mbed.org/users/Elitism/code/ILI9340C_Serial_Control/ However this should give a base of how to connect through serial ports and sending data via scripthookvdotnet <snip> Why exactly are you using SerialPorts with shv.net Link to comment Share on other sites More sharing options...
Enumerator Posted June 17, 2015 Share Posted June 17, 2015 (edited) Here is the code i've built, No one else could use it unless they have an MBED and is using my ILI9340C_Serial_Control Repository code. https://developer.mbed.org/users/Elitism/code/ILI9340C_Serial_Control/ However this should give a base of how to connect through serial ports and sending data via scripthookvdotnet <snip> Why exactly are you using SerialPorts with shv.net To send/receive data to my mbed display, To display data outside the game, It could be useful for a MPH display Or To activate functions without touching the keyboard/mouse using an SPI touch display. Many possibilities. As you can see i'm displaying my players coordinates in real time on that display which updates every 2 ticks of gametime. Edited June 17, 2015 by Enumerator Link to comment Share on other sites More sharing options...
Enumerator Posted June 17, 2015 Share Posted June 17, 2015 (edited) Anyone know why this does not return an entity when i aim at anything? Dim ent As Entity = World.Raycast(Game.Player.Character.Position, Game.Player.GetTargetedEntity.Position, IntersectOptions.Everything).HitEntity Edited June 18, 2015 by Enumerator Link to comment Share on other sites More sharing options...
unknown modder Posted June 17, 2015 Share Posted June 17, 2015 Anyone know why this does not return an entity when i aim at anything? Dim ent As Entity = World.Raycast(Game.Player.Character.Position, Game.Player.GetTargetedEntity.Position, IntersectOptions.Everything).HitEntity What are you trying to achieve with that? Link to comment Share on other sites More sharing options...
Enumerator Posted June 18, 2015 Share Posted June 18, 2015 (edited) Anyone know why this does not return an entity when i aim at anything? Dim ent As Entity = World.Raycast(Game.Player.Character.Position, Game.Player.GetTargetedEntity.Position, IntersectOptions.Everything).HitEntity What are you trying to achieve with that? It's a ray-tracer, it should draw an invisible line and detect which entity it hits on the second vector and get the details of that HitEntity It would be useful in figuring out where you're aiming or what entity you're aiming at because i don't see a function to "get aimed entity" nothing works..... What we need is a "get aimed weapon raytrace".... that so that we can get all the details of anything when we point at something with our guns. Rock* did it at the beginning of the game with those bank vault guards detecting if the player is aiming at them... Edited June 18, 2015 by Enumerator Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now