Prof_Farnsworth Posted June 29, 2015 Share Posted June 29, 2015 Hey all, any word on Vector3 import export from ini? Also, my script is not saving an integer. We just use "SetValue" no? Thanks in advance. Link to comment Share on other sites More sharing options...
Inco Posted June 30, 2015 Share Posted June 30, 2015 Hey all, any word on Vector3 import export from ini? Also, my script is not saving an integer. We just use "SetValue" no? Thanks in advance. You can convert Vector3 to a string and parse from a string to Vector3. private static string ToStr( Vector3 vector ){ return vector.X + ";" + vector.Y + ";" + vector.Z;}private static Vector3 Parse( string str ){ float[] arr = Array.ConvertAll( str.Split( ';' ), float.Parse ); return new Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] );} Link to comment Share on other sites More sharing options...
unknown modder Posted June 30, 2015 Share Posted June 30, 2015 Hey all, any word on Vector3 import export from ini? Also, my script is not saving an integer. We just use "SetValue" no? Thanks in advance. You can convert Vector3 to a string and parse from a string to Vector3.private static string ToStr( Vector3 vector ){ return vector.X + ";" + vector.Y + ";" + vector.Z;}private static Vector3 Parse( string str ){ float[] arr = Array.ConvertAll( str.Split( ';' ), float.Parse ); return new Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] );}surely you should try using the vector3 to string override instead of making your own Link to comment Share on other sites More sharing options...
Inco Posted June 30, 2015 Share Posted June 30, 2015 (edited) surely you should try using the vector3 to string override instead of making your own Then he should remove from string next substrings: "X: ", "Y: " and "Z: " when parsing Vector3 from string. Edited June 30, 2015 by Inco Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted June 30, 2015 Share Posted June 30, 2015 surely you should try using the vector3 to string override instead of making your own Then he should remove from string next substrings: "X: ", "Y: " and "Z: " when parsing Vector3 from string. Haha thanks guys. Overrides and parsing I haven't used much, but I'll see what I can come up with. Link to comment Share on other sites More sharing options...
unknown modder Posted July 1, 2015 Share Posted July 1, 2015 surely you should try using the vector3 to string override instead of making your own Then he should remove from string next substrings: "X: ", "Y: " and "Z: " when parsing Vector3 from string. Haha thanks guys. Overrides and parsing I haven't used much, but I'll see what I can come up with.the override you don't need to worry about, just use vector3.tostring() Link to comment Share on other sites More sharing options...
Rushlink Posted July 1, 2015 Share Posted July 1, 2015 I'm having serious problems with task sequences... class TaskTest : Script { bool doTasks = false; public TaskTest() { Tick += onTick; KeyDown += onKeyDown; } private void onTick(object sender, EventArgs e) { if(doTasks) { Vehicle veh = Game.Player.Character.CurrentVehicle; TaskSequence toDo = new TaskSequence(); toDo.AddTask.CruiseWithVehicle(veh, 20.0f); toDo.Close(); Game.Player.Character.Task.PerformSequence(toDo); } } private void onKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && e.Shift) doTasks = !doTasks; } } The above code simply does not work. Either nothing happens, or my game crashes... Any suggestions?Yes... the player is in a vehicle when the task sequence is activated. Matt Link to comment Share on other sites More sharing options...
unknown modder Posted July 1, 2015 Share Posted July 1, 2015 I'm having serious problems with task sequences... class TaskTest : Script { bool doTasks = false; public TaskTest() { Tick += onTick; KeyDown += onKeyDown; } private void onTick(object sender, EventArgs e) { if(doTasks) { Vehicle veh = Game.Player.Character.CurrentVehicle; TaskSequence toDo = new TaskSequence(); toDo.AddTask.CruiseWithVehicle(veh, 20.0f); toDo.Close(); Game.Player.Character.Task.PerformSequence(toDo); } } private void onKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && e.Shift) doTasks = !doTasks; } }The above code simply does not work. Either nothing happens, or my game crashes... Any suggestions? Yes... the player is in a vehicle when the task sequence is activated. Matt you don't need task sequences for one task. But the issue here is you keep creating the task sequence and playing it every tick. Once you play the sequence, set dotask to false Link to comment Share on other sites More sharing options...
julionib Posted July 1, 2015 Share Posted July 1, 2015 you guys have plans to add support for the recently added directx hook in ScripthookV? Link to comment Share on other sites More sharing options...
crosire Posted July 3, 2015 Author Share Posted July 3, 2015 you guys have plans to add support for the recently added directx hook in ScripthookV? Yes, done. Link to comment Share on other sites More sharing options...
julionib Posted July 3, 2015 Share Posted July 3, 2015 you guys have plans to add support for the recently added directx hook in ScripthookV? Yes, done. amazing Link to comment Share on other sites More sharing options...
alexslx Posted July 3, 2015 Share Posted July 3, 2015 I have a question. Why you read a settings file manually instead of using WritePrivateProfileString / GetPrivateProfileString methods from Windows? Regards, Link to comment Share on other sites More sharing options...
crosire Posted July 3, 2015 Author Share Posted July 3, 2015 I have a question. Why you read a settings file manually instead of using WritePrivateProfileString / GetPrivateProfileString methods from Windows? Regards, Because they do neither support trailing nor C++ syle comments. =) Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted July 4, 2015 Share Posted July 4, 2015 (edited) Do we have an efficient method of dealing with blips? I am specifically having a hard time detecting if they exist since they are not an entity. Calling "blip.exists" crashes the script unless using a try catch, but if it's not there, the try will exit anyway. Best I can figure is to set a separate flag for each blip in order to only create one on the fly, as without the exists check it creates on every tick. Any help is appreciated. EDIT: The workaround is great, but if anyone knows anything else that works directly for the blips, feel free to help. Edited July 4, 2015 by Prof_Farnsworth Link to comment Share on other sites More sharing options...
unknown modder Posted July 4, 2015 Share Posted July 4, 2015 Do we have an efficient method of dealing with blips? I am specifically having a hard time detecting if they exist since they are not an entity. Calling "blip.exists" crashes the script unless using a try catch, but if it's not there, the try will exit anyway. Best I can figure is to set a separate flag for each blip in order to only create one on the fly, as without the exists check it creates on every tick. Any help is appreciated. EDIT: The workaround is great, but if anyone knows anything else that works directly for the blips, feel free to help. are you making sure the blip is not null, that sounds like the issue Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted July 4, 2015 Share Posted July 4, 2015 Do we have an efficient method of dealing with blips? I am specifically having a hard time detecting if they exist since they are not an entity. Calling "blip.exists" crashes the script unless using a try catch, but if it's not there, the try will exit anyway. Best I can figure is to set a separate flag for each blip in order to only create one on the fly, as without the exists check it creates on every tick. Any help is appreciated. EDIT: The workaround is great, but if anyone knows anything else that works directly for the blips, feel free to help. are you making sure the blip is not null, that sounds like the issueMy concern was if something doesn't exist, does it automatically equal null? I'm not sure if there is another result that is possible. Link to comment Share on other sites More sharing options...
crosire Posted July 5, 2015 Author Share Posted July 5, 2015 My concern was if something doesn't exist, does it automatically equal null? I'm not sure if there is another result that is possible. You might want to mention which kind of exception it throws =). Link to comment Share on other sites More sharing options...
alexslx Posted July 5, 2015 Share Posted July 5, 2015 I have a question. Why you read a settings file manually instead of using WritePrivateProfileString / GetPrivateProfileString methods from Windows? Regards, Because they do neither support trailing nor C++ syle comments. =) That is true, I forgot completely about the commenting into INI files. I've sent you a PM. Regards, Link to comment Share on other sites More sharing options...
tall70 Posted July 5, 2015 Share Posted July 5, 2015 I would guess there is no easy way to change INSERT reset key to something else out of the way, whole right side set of keys i'm using for game since those are nicely isolated. REaly the best would be combination of two keys, because many people have everything assign twice with scripts in game and stuff. Just asking for consideration. Link to comment Share on other sites More sharing options...
bigtiny779 Posted July 6, 2015 Share Posted July 6, 2015 (edited) hey guys i really need some help. i can play the game normaly with my controller, but as soon as i touch any key on my keyboard the game crashes... it only does this when i have scripthookv .net active. any body got any ideas? Edited July 6, 2015 by bigtiny779 Link to comment Share on other sites More sharing options...
unknown modder Posted July 6, 2015 Share Posted July 6, 2015 Do we have an efficient method of dealing with blips? I am specifically having a hard time detecting if they exist since they are not an entity. Calling "blip.exists" crashes the script unless using a try catch, but if it's not there, the try will exit anyway. Best I can figure is to set a separate flag for each blip in order to only create one on the fly, as without the exists check it creates on every tick. Any help is appreciated. EDIT: The workaround is great, but if anyone knows anything else that works directly for the blips, feel free to help. are you making sure the blip is not null, that sounds like the issueMy concern was if something doesn't exist, does it automatically equal null? I'm not sure if there is another result that is possible.If the error you are getting is a null argument error, it usually means you are trying to use a variable that hasn't been set to anything. Checking if it's null could be your solution Link to comment Share on other sites More sharing options...
crosire Posted July 8, 2015 Author Share Posted July 8, 2015 Released v1.1, adds support for drawing custom textures and some new features due to native memory access (like World.GetNearbyPeds/Vehicles overloads which take a position and World.GetAllPeds/Vehicles), LtFlash 1 Link to comment Share on other sites More sharing options...
identitymatrix Posted July 8, 2015 Share Posted July 8, 2015 Crosire, how do you go about native functions that require a hash say... Dim fPos As Vector3 = Fjet.PositionDim pPos As Vector3 = player.PositionNative.Function.Call(Native.Hash.SHOOT_SINGLE_BULLET_BETWEEN_COORDS, fPos.X, fPos.Y, fPos.Z, pPos.X, pPos.Y, pPos.Z, 15, True, HASH_HERE, player, True, True, -1) There is no data type for hash in vb.net, well i can't pass a raw hash as a param or I will get error, e.g 0x398hf093 or something Private Function getHash(ByVal weapon As String) As Int32 Dim hashkey As Int32 = Native.Function.Call(Of Int32)(Native.Hash.GET_HASH_KEY, weapon) Return hashkey End Function Link to comment Share on other sites More sharing options...
identitymatrix Posted July 8, 2015 Share Posted July 8, 2015 Crosire, how do you go about native functions that require a hash say... Dim fPos As Vector3 = Fjet.PositionDim pPos As Vector3 = player.PositionNative.Function.Call(Native.Hash.SHOOT_SINGLE_BULLET_BETWEEN_COORDS, fPos.X, fPos.Y, fPos.Z, pPos.X, pPos.Y, pPos.Z, 15, True, HASH_HERE, player, True, True, -1) There is no data type for hash in vb.net, well i can't pass a raw hash as a param or I will get error, e.g 0x398hf093 or something Private Function getHash(ByVal weapon As String) As Int32 Dim hashkey As Int32 = Native.Function.Call(Of Int32)(Native.Hash.GET_HASH_KEY, weapon) Return hashkey End Function ah, it is native.hash, always gets me. Link to comment Share on other sites More sharing options...
identitymatrix Posted July 8, 2015 Share Posted July 8, 2015 (edited) Crosire, how do you go about native functions that require a hash say... Dim fPos As Vector3 = Fjet.PositionDim pPos As Vector3 = player.PositionNative.Function.Call(Native.Hash.SHOOT_SINGLE_BULLET_BETWEEN_COORDS, fPos.X, fPos.Y, fPos.Z, pPos.X, pPos.Y, pPos.Z, 15, True, HASH_HERE, player, True, True, -1) There is no data type for hash in vb.net, well i can't pass a raw hash as a param or I will get error, e.g 0x398hf093 or something Private Function getHash(ByVal weapon As String) As Int32 Dim hashkey As Int32 = Native.Function.Call(Of Int32)(Native.Hash.GET_HASH_KEY, weapon) Return hashkey End Function ah, it is native.hash, always gets me. Well, it still don't work, I guess I doing something wrong: Dim fPos As Vector3 = Fjet.Position Dim pPos As Vector3 = player.Position Dim weapon_hash As New Native.WeaponHash weapon_hash = Native.WeaponHash.HeavyShotgun Native.Function.Call(Native.Hash.SHOOT_SINGLE_BULLET_BETWEEN_COORDS, fPos.X, fPos.Y, fPos.Z, pPos.X, pPos.Y, pPos.Z, 15, True, weapon_hash, player, True, True, -1) Edited July 8, 2015 by TheVideoVolcano Link to comment Share on other sites More sharing options...
unknown modder Posted July 8, 2015 Share Posted July 8, 2015 Crosire, how do you go about native functions that require a hash say... Dim fPos As Vector3 = Fjet.PositionDim pPos As Vector3 = player.PositionNative.Function.Call(Native.Hash.SHOOT_SINGLE_BULLET_BETWEEN_COORDS, fPos.X, fPos.Y, fPos.Z, pPos.X, pPos.Y, pPos.Z, 15, True, HASH_HERE, player, True, True, -1)There is no data type for hash in vb.net, well i can't pass a raw hash as a param or I will get error, e.g 0x398hf093 or something Private Function getHash(ByVal weapon As String) As Int32 Dim hashkey As Int32 = Native.Function.Call(Of Int32)(Native.Hash.GET_HASH_KEY, weapon) Return hashkey End Function for what you are doing the, why not just use the model struct, something like dim weaponModel as new Model("weapon name goes here"). I don't know vb but i think it would be something like that Link to comment Share on other sites More sharing options...
Alabeo Posted July 9, 2015 Share Posted July 9, 2015 Does it work in latest patch? Link to comment Share on other sites More sharing options...
unknown modder Posted July 9, 2015 Share Posted July 9, 2015 Does it work in latest patch?test it yourself, i see no reason why it shouldn't given script hook v has been updated Link to comment Share on other sites More sharing options...
Drewgamer Posted July 9, 2015 Share Posted July 9, 2015 Does it work in latest patch? Works fine for me, at least that I can tell. Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted July 10, 2015 Share Posted July 10, 2015 For some reason the BlipSprite "Crosshair2" no longer works for me, it just doesn't show up. Anyone know a reason why. Other Sprite types do show up, such as the default blip, and "Crosshair". Thanks in advance! 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