HazardX Posted January 17, 2009 Author Share Posted January 17, 2009 One little question:Is Visual Basic 2008 working on Vista Home Premium 64bit? Cause I downloaded and installed Visual Basic but there was no application i could start... only a debugger which didnt work.... Usually it does work. Are you able to open the SLN files now? If not, try to install it again. Maybe something went wrong during installation. @CoMPMStR: Position and Velocity should be settable. This should push the player into the air: Player.Character.Velocity += new Vector3(0,0,20) Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 17, 2009 Share Posted January 17, 2009 Im impatient for the new release. Is there any beta release? Maybe you could put what you have done so far, and we can test it, get some new ideas to the front. Im working on getting information from nearby peds, but im having problem with understanding function "GetClosestPed( Vector3, Single)... So what would be proper look of the function in use? What do i use for single? 1.0F, 6.0F? It should be like radius, so how do set proper radius in game metrics? Coz this way i get very random result, i dont know which ped gets found by this function. Also, how can I put Peds back into a same game group? They sometimes go and kill each other. And I noticed that if you put like 10-20 guards, some of them dont follow you. I tried refreshing them, all one by one, with 'for each' by SetPathFinding, but they just then go after me, start to shoot at me. Maybe it has to do that after player dies, game just remove all peds from your custom group... Link to comment Share on other sites More sharing options...
HazardX Posted January 17, 2009 Author Share Posted January 17, 2009 Im impatient for the new release. Is there any beta release? Maybe you could put what you have done so far, and we can test it, get some new ideas to the front. Im working on getting information from nearby peds, but im having problem with understanding function "GetClosestPed( Vector3, Single)... So what would be proper look of the function in use? What do i use for single? 1.0F, 6.0F? It should be like radius, so how do set proper radius in game metrics? Coz this way i get very random result, i dont know which ped gets found by this function. Also, how can I put Peds back into a same game group? They sometimes go and kill each other. And I noticed that if you put like 10-20 guards, some of them dont follow you. I tried refreshing them, all one by one, with 'for each' by SetPathFinding, but they just then go after me, start to shoot at me. Maybe it has to do that after player dies, game just remove all peds from your custom group... I hope to get the new release up in the next hours. The GetClosestPed functions is very tricky currently... you are right, the parameter is the distance (in meters/yards... at least almost). but thats not the problem. internally there are 2 more parameters that seem to control what kind of peds will be returned by the functions. however, i found no combination yet that gives reliable results. Groups have a maximum number of members. for the player group it seems to be 7. As soon as you add more, one of them will just "fall out" of the group. the roblem is, that the function to get the maximum number of members is still completely unknown. i've got the name (FIND_MAX_NUMBER_OF_GROUP_MEMBERS) but noone seems to know which parameters it takes. i'll try to find it out though. Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 17, 2009 Share Posted January 17, 2009 Can you explain GTA.FunctionContext? Does it have to do something with calling native functions? There are lot of things when i declare new FunctionContext object. I see like 'GetArgumentFloat', 'GetArgumentInt','SetArgument'...'PushPtr'. How can i use it? If you could post some basic test code for it, it would be great. Link to comment Share on other sites More sharing options...
CoMPMStR Posted January 17, 2009 Share Posted January 17, 2009 @CoMPMStR:Position and Velocity should be settable. This should push the player into the air: Player.Character.Velocity += new Vector3(0,0,20) Ahh I see, I was doing Player.Character.Velocity.X = newVect.X. Still have to get used to how it all works.. Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 18, 2009 Share Posted January 18, 2009 I found out that you can use more than 7 guards by putting them into separate groups. 7+7+7... So basically you can have as many peds as you want as your bodyguards, following you and defending. Good thing is putting all used peds into an array, so you can control each one of them separately. Maybe a good idea: Is there possibility to control Ped movement? To script ped moves left or right on a key press or something like that. It could open up a new era of modding, and give a possibility to make your friend could use maybe a joypad2 on the system to control a bodyguard. Could you imagine GTA4 in full cooperative mod? Link to comment Share on other sites More sharing options...
HazardX Posted January 18, 2009 Author Share Posted January 18, 2009 (edited) NEW VERSION: GTAIV .Net Script Hook v0.73 BETA Changes in Version 0.73 BETA: - Scripts reload now if the game reloads - Fixed wrong color values - Renamed many functions to make more sense (don't complain, i warned you ) - also renamed Ped.Tasks to Ped.Task - more examples (including the more complex AnyTaxiScript) - new Classes/Functionality: -> Many Tasks and TaskSequences for Peds -> Native Function support (Native.Function.Call) -> Minimal Camera support -> Minimal Blip support -> MANY more small things... The mentioned AnyTaxiScript allows you to enter any car as passenger and force the driver to bring you to a specific coordinate... as fast as possible. Also very interesting are the new Tasks and TaskSequences. Use Ped.Task if you want to run a single task, or create a (reuseable) sequence of tasks with TaskSequence. Here is an example: Private FleeTask As New TaskSequence FleeTask.AddTask.SwapWeapon(Weapon.Handgun_Glock) FleeTask.AddTask.FightAgainst(Player, 5000) ' fight 5 sec FleeTask.AddTask.FleeFromChar(Player, False, 5000) ' flee 5 sec FleeTask.AddTask.Die() ' and then die ped.Task.PerformSequence(FleeTask) Native calls are now possible too: Dim CarPointer As New Native.Pointer(GetType(Vehicle)) Native.Function.Call("GET_CAR_CHAR_IS_USING", Player.Character, CarPointer) Dim ModelPointer As New Native.Pointer(GetType(Model)) Native.Function.Call("GET_CAR_MODEL", CarPointer.ToInputParameter, ModelPointer) return Native.Function.Call(Of String)("GET_DISPLAY_NAME_FROM_VEHICLE_MODEL", ModelPointer.ToInputParameter) @iriedreadlock23: The old FunctionContext class (which was for Lua-like native calling) has been replaced by the new and much better Native.Function.Call (see above). Edited January 18, 2009 by HazardX Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 18, 2009 Share Posted January 18, 2009 Great!! Thanks for the answers! This is really great release, wonderful. I just love it. Now GTA4 can be modded, and extended to its full potential. Can you tell me about 'VehicleDoor'? How can i use it? Like i want to get information into player vehicle. I get vehicle object, but i need now to access door. How do i set Hood to be opened? Link to comment Share on other sites More sharing options...
HazardX Posted January 18, 2009 Author Share Posted January 18, 2009 Great!! Thanks for the answers! This is really great release, wonderful. I just love it. Now GTA4 can be modded, and extended to its full potential. Can you tell me about 'VehicleDoor'? How can i use it? Like i want to get information into player vehicle. I get vehicle object, but i need now to access door. How do i set Hood to be opened? Thanks. VehicleDoor is just to open, close and break doors. The Hood is also handled as a door. just use them like this: somevehicle.Door(VehicleDoor.LeftFront).Close()orsomevehicle.Door(VehicleDoor.Hood).Open() To get into a car you don't need to access the door. There is a task defined to enter a car. here is the example code: Player.Character.Task.EnterVehicle(somevehicle, VehicleSeat.RightFront) in both examples "somevehicle" is a variable of type "Vehicle". Link to comment Share on other sites More sharing options...
loczek47 Posted January 19, 2009 Share Posted January 19, 2009 This is awesome , thank you so much for .cs , it reminds me CLEO for SA , makes making script easier Link to comment Share on other sites More sharing options...
juboaku Posted January 19, 2009 Share Posted January 19, 2009 nice Link to comment Share on other sites More sharing options...
loczek47 Posted January 19, 2009 Share Posted January 19, 2009 Hey , the reload script doesn't work. After I will load my another save , it will crash after 1 minute Link to comment Share on other sites More sharing options...
HazardX Posted January 19, 2009 Author Share Posted January 19, 2009 Hey , the reload script doesn't work. After I will load my another save , it will crash after 1 minute Does this happen all the time for you, or just sometimes? @all: Has anyone else noticed the problem? Link to comment Share on other sites More sharing options...
loczek47 Posted January 19, 2009 Share Posted January 19, 2009 Hey , the reload script doesn't work. After I will load my another save , it will crash after 1 minute Does this happen all the time for you, or just sometimes? @all: Has anyone else noticed the problem? Well , always. But I noticed that the time when crash appear randomly changes - one time it crashes when I get out of savehouse , another time it crashes after 5 minutes of playing. By the way - just like I said - I start my game , game automatically loads my save - it's okay - but when I load my another save , then it crashes. Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 19, 2009 Share Posted January 19, 2009 If anyone is interested in helping out with new great extended bodyguard mod written in vb.net, send me private msg. I have added couple great functions so far, like multiple controllable bodyguard groups (7+ each), smart bodyguards stealing and driving any vehicle, bodyguards available at all time (even after player dies). You can set wheter they will walk to you, or they drive to certain position on the map. Also you can control Bodyguard movement via keyboard, and if someone help me out, we will make first full GTA Cooperative Mission mod, with 2+ Players support. Script works, but is still a bit buggy, so any help would be appreceated. Many more ideas in the script, waiting their time. Its still beta, so if you wish to try it out, just contact me. I will answer any question, and help with any good mod for GTA4... Link to comment Share on other sites More sharing options...
loczek47 Posted January 19, 2009 Share Posted January 19, 2009 If anyone is interested in helping out with new great extended bodyguard mod written in vb.net, send me private msg. I have added couple great functions so far, like multiple controllable bodyguard groups (7+ each), smart bodyguards stealing and driving any vehicle, bodyguards available at all time (even after player dies). You can set wheter they will walk to you, or they drive to certain position on the map. Also you can control Bodyguard movement via keyboard, and if someone help me out, we will make first full GTA Cooperative Mission mod, with 2+ Players support. Script works, but is still a bit buggy, so any help would be appreceated. Many more ideas in the script, waiting their time. Its still beta, so if you wish to try it out, just contact me. I will answer any question, and help with any good mod for GTA4... Holy sh*t , this sounds awesome. So bad I can't help you Link to comment Share on other sites More sharing options...
loczek47 Posted January 19, 2009 Share Posted January 19, 2009 If anyone is interested in helping out with new great extended bodyguard mod written in vb.net, send me private msg. I have added couple great functions so far, like multiple controllable bodyguard groups (7+ each), smart bodyguards stealing and driving any vehicle, bodyguards available at all time (even after player dies). You can set wheter they will walk to you, or they drive to certain position on the map. Also you can control Bodyguard movement via keyboard, and if someone help me out, we will make first full GTA Cooperative Mission mod, with 2+ Players support. Script works, but is still a bit buggy, so any help would be appreceated. Many more ideas in the script, waiting their time. Its still beta, so if you wish to try it out, just contact me. I will answer any question, and help with any good mod for GTA4... Sorry for double post , but I would like to try it out realy much. Link to comment Share on other sites More sharing options...
HazardX Posted January 19, 2009 Author Share Posted January 19, 2009 If anyone is interested in helping out with new great extended bodyguard mod written in vb.net, send me private msg. I have added couple great functions so far, like multiple controllable bodyguard groups (7+ each), smart bodyguards stealing and driving any vehicle, bodyguards available at all time (even after player dies). You can set wheter they will walk to you, or they drive to certain position on the map. Also you can control Bodyguard movement via keyboard, and if someone help me out, we will make first full GTA Cooperative Mission mod, with 2+ Players support. Script works, but is still a bit buggy, so any help would be appreceated. Many more ideas in the script, waiting their time. Its still beta, so if you wish to try it out, just contact me. I will answer any question, and help with any good mod for GTA4... Wow, this sounds really amazing! Can't wait to see it in action. If you've got any questions, or feature request or whatever, just ask. Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 19, 2009 Share Posted January 19, 2009 Anything we make is thanks to HazardX! After this Extended Bodyguard Mod is done, source code will be posted for users to analyze it, and reuse it in threir own scripts. However, I am now intrested into new native functions of GTA. But i just cant understand how it works. How do i read data from Native function? Can I use strings or something to store data from function? HazardX: Did you manage to crack TASK_SIT_DOWN native function? There seems to be lot of functions that control actor moves and all. It would be great to add all those in future release. So we can script hand shakes, sitting, hands up, and all those nice little character moves. Link to comment Share on other sites More sharing options...
AnttiAnA Posted January 19, 2009 Share Posted January 19, 2009 I crash instantly if i go to multiplayer Link to comment Share on other sites More sharing options...
HazardX Posted January 19, 2009 Author Share Posted January 19, 2009 (edited) Anything we make is thanks to HazardX! After this Extended Bodyguard Mod is done, source code will be posted for users to analyze it, and reuse it in threir own scripts. However, I am now intrested into new native functions of GTA. But i just cant understand how it works. How do i read data from Native function? Can I use strings or something to store data from function? HazardX: Did you manage to crack TASK_SIT_DOWN native function? There seems to be lot of functions that control actor moves and all. It would be great to add all those in future release. So we can script hand shakes, sitting, hands up, and all those nice little character moves. Native functions return data in two ways: - by result value: Dim resultvalue As Ped = Native.Function.Call(Of Ped)("NAME_OF_NATIVE_FUNCTION", a, b, c) - by pointer: Dim pointer As New Native.Pointer(GetType(Ped))Native.Function.Call("NAME_OF_NATIVE_FUNCTION", a, b, c, pointer)Dim resultvalue As Ped = pointer in both cases i've chosen "Ped" as return type and a, b and c as any type of parameter. which parameters a function takes, and which it returnes is defined in the game and we can only guess, which makes it hard to find the right values. Thats why i haven't included more Tasks yet, i just don't know which parameters they need. I used OpenIV alot to browse through scripts of the game to find clues and it helped alot already, but you can't find out everything that way. @AnttiAnA: Could you post the content of your ScriptHookDotNet.log file directly after such a crash? Edited January 19, 2009 by HazardX Link to comment Share on other sites More sharing options...
AnttiAnA Posted January 19, 2009 Share Posted January 19, 2009 2009-01-18 22:07:11 - Initializing ScriptHookDotNet v0.72 BETA 2009-01-18 22:07:11 - SEARCHING FOR SCRIPTS... 2009-01-18 22:07:11 - Loading Assembly 'C:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\TestScriptVB.net.dll' ... 2009-01-18 22:07:11 - ...found script 'TestScriptVB.BodyguardScript'! 2009-01-18 22:07:11 - DONE! 1 valid scripts found! 2009-01-18 22:08:54 - STARTING SCRIPTS... 2009-01-18 22:08:54 - ...successfully started script 'TestScriptVB.BodyguardScript'! 2009-01-18 22:15:08 - SCRIPTS TERMINATED! 2009-01-18 22:15:10 - STARTING SCRIPTS... 2009-01-18 22:15:10 - ...successfully started script 'TestScriptVB.BodyguardScript'! Link to comment Share on other sites More sharing options...
diryboy Posted January 20, 2009 Share Posted January 20, 2009 (edited) big thanks for the great work & info u provide! y not make it open source on google code or something? Edited January 21, 2009 by diryboy Link to comment Share on other sites More sharing options...
iriedreadlock23 Posted January 21, 2009 Share Posted January 21, 2009 You could put next functions to next release: CREATE_OBJECT (ObjectHash, X, Y, Z, returned ObjectPointer, 1) ATTACH_OBJECT_TO_CAR( ObjectPointer, CarPointer, 0, X ,Y, Z, X Roto Offset, Y Roto Offset, Z Roto Offset); SET_OBJECT_HEADING( ObjectPointer, Angle); ATTACH_OBJECT_TO_PED ( Object pointer, Char Pointer , 1219, X, Y, Z, Roto Offset X, Roto Offset Y, Roto Offset Z); SET_OBJECT_VISIBLE ( ObjectPointer, 1); // TRUE FALSE DELETE_OBJECT (ObjectPointer); IS_OBJECT_ATTACHED (ObjectPointer) DETACH_OBJECT(ObjectPointer, 1); REQUEST_MODEL(ObjectHash); HAS_MODEL_LOADED(ObjectHash)) LOCK_CAR_DOORS( VehiclePointer, DoorIndex); also, you could extend GetClosestPed function so it actually match ingame function, which has 7 parameters. I have checked many of these functions within game scripts, and retrieved parameter information. It may have certain mistakes, but i carefully checked every param in different scripts. You can PM me and i will give you all of functions parameters i have translated. Also, it would be great to put an option so Animations can be used. Like Character animations. I have these: HAVE_ANIMS_LOADED( "AnimationName" ) IS_CHAR_PLAYING_ANIM ( PED, "AnimationName", "AnimationExec") TASK_PLAY_ANIM_WITH_FLAGS( PED, "CreateSpliff", "[email protected]_spliff", 8.00, -1, 3328); GET_CHAR_ANIM_CURRENT_TIME( PED, "CreateSpliff", "[email protected]_spliff", &Var4); -- Link to comment Share on other sites More sharing options...
Remos Posted January 23, 2009 Share Posted January 23, 2009 (edited) Hey, I'm working on a script, and I'm not sure if 'GET_PED_BONE_POSITION' returns an Array, a Vector or something else. And I'm not exactly sure what I'm meant to do here: Dim Bonepointer As New Native.Pointer(GetType(Vector3))Native.Function.Call("GET_PED_BONE_POSITION", 1232, Convert.ToDecimal(0.0), Convert.ToDecimal(0.0), Convert.ToDecimal(0.0), Bonepointer) I need to access the X, Y and Z coords individually. But I don't think that Native.Pointers support Arrays or Vectors. Edited January 23, 2009 by Remos Link to comment Share on other sites More sharing options...
diryboy Posted January 23, 2009 Share Posted January 23, 2009 I used OpenIV alot to browse through scripts of the game to find clues and it helped alot already, but you can't find out everything that way. I downloaded OpenIV 0.8.163 but don't know where the scripts locates, i opened data/script but no files it can open.. can u tell me how did u browse through scripts of the game? and my game also crash when save reload.. btw, Vehicle.Speed += 200f; Vehicle.Explode(); this is super! i love it!! thank u HazardX! Link to comment Share on other sites More sharing options...
Remos Posted January 23, 2009 Share Posted January 23, 2009 Are you opening OpenIV then browsing to data/scripts and opening a .img while in OpenIV. Or are you opening .img's with OpenIV from windows explorer? Because you should be doing the first one. Link to comment Share on other sites More sharing options...
diryboy Posted January 23, 2009 Share Posted January 23, 2009 Are you opening OpenIV then browsing to data/scripts and opening a .img while in OpenIV.Or are you opening .img's with OpenIV from windows explorer? Because you should be doing the first one. no, data/script folder is empty.. but i found another data/cdimages/script.img, seems this would be it. Link to comment Share on other sites More sharing options...
Remos Posted January 23, 2009 Share Posted January 23, 2009 Oh yeah, sorry. Wasn't really thinking that much... >.> Link to comment Share on other sites More sharing options...
HazardX Posted January 23, 2009 Author Share Posted January 23, 2009 Hey, I'm working on a script, and I'm not sure if 'GET_PED_BONE_POSITION' returns an Array, a Vector or something else. And I'm not exactly sure what I'm meant to do here: Dim Bonepointer As New Native.Pointer(GetType(Vector3))Native.Function.Call("GET_PED_BONE_POSITION", 1232, Convert.ToDecimal(0.0), Convert.ToDecimal(0.0), Convert.ToDecimal(0.0), Bonepointer) I need to access the X, Y and Z coords individually. But I don't think that Native.Pointers support Arrays or Vectors. yes, you are right. Native.Fucntion.Call does not support arrays or Vector3. i included Vector3 support now, but there seems to be another problem with functions that take a vector3 pointer. the results are complete nonsense. i guess the game handles them in a different way. still trying to figure it out. @diryboy: yes, data/cdimages/script.img is correct. 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