boomer678 0 Posted February 6, 2009 this question was for HazardX, but thanks anyway. I asked is there a way to push/apply force to any created object with HazardX's ScriptHook library, or with any Native function. So objects actually fall from the sky. Ah .... there might be a native. you would have to look. Quote Share this post Link to post Share on other sites
SlingShotUK 58 Posted February 6, 2009 Hi Hazard, Could the console reload problem be affecting normal game reloading? I only ask because I installed the hook for the first time tonight along with a single mod - the super spawner script. This works fine but as soon as I load up a save game GTA crashes. As soon as I removed the .NET hook it worked fine again. Any ideas? Quote Share this post Link to post Share on other sites
CoMPMStR 1 Posted February 6, 2009 Are there any examples on how to utilize the console commands yet? I'm trying to print some strings to the console but I don't know how the method is called. I already tried calling GTA.Console and I also tried assigning it to a variable, but I don't know what to assign to the variable so it isn't null. Quote Share this post Link to post Share on other sites
HazardX 13 Posted February 6, 2009 (edited) Could the console reload problem be affecting normal game reloading? Sadly, yes. I'm working hard to fix it, but no luck yet. There is a very nasty conflict between the unmanged threads and the .Net Garbage Collector. @iriedreadlock23: You could change the Velocity of the Object. ApplyForce is already included, but i can't release a new version until the crashing problem is solved. @CoMPMStR: use the existing console. it's Game.Console . Use Game.Console.Print to write text to the console window and Game.Console.SendCommand to send a console command by script. If you want to catch console commands in your script you have to override the "ConsoleCommand" method in your script class. Edited February 6, 2009 by HazardX Quote Share this post Link to post Share on other sites
SlingShotUK 58 Posted February 6, 2009 Could the console reload problem be affecting normal game reloading? Sadly, yes. I'm working hard to fix it, but no luck yet. There is a very nasty conflict between the unmanged threads and the .Net Garbage Collector. No problem at all Hazard - thanks for confirming the problem. I know you will fix this so I'm happy to wait. Just good to know that it's not a problem with my config. Was exciting to try the mods last night.. I'm really getting into the idea of making my own. The main thing I'd like to learn though is how to do menu's etc (like used on the in game trainer mod). Would love to see some code examples on how to achieve this kind of effect if possible.. Quote Share this post Link to post Share on other sites
CoMPMStR 1 Posted February 6, 2009 (edited) After I got the console to print (thanks hazard ), I ran across another little problem. This time I'm messing around with the PerFrameDrawing method. I put a line to draw a rectangle, in the center, but it doesn't show anything. Graphics.DrawRectangle(Game.Resolution.Width / 2, Game.Resolution.Height / 2, 100, 100, Drawing.Color.Blue) This is how you'd do it right? When I go ingame, there's no rectangle there. Just so you know, I added the references and imports for System.Drawing which is why I don't know why it's not working. Thanks in advance. EDIT: I'm not only talking to HazardX. Anyone who know's what's the problem, or how to solve this is more than welcome to post the solution. <---- For the one who comes forward with the answer. Edited February 7, 2009 by CoMPMStR Quote Share this post Link to post Share on other sites
diryboy 0 Posted February 7, 2009 (edited) hi, hazard, i think adding these methods into Script class would be cool: protected void BindKey(Keys key, Action action); and protected void RegisterCheatCode(string code, Action action); Action is a delegate: public delegate void Action(); doing that enable us to write the script in a more descriptive way, we can call these two methods in the constructor like: public MyScript(){ BindKey(Keys.O, SpawnCar); RegisterCheatCode("GiveMeChicks", GiveMeChicks);} then we could write the private method to implement SpawnCar and GiveMeChicks instead of playing with the switch blocks. it's also convient to override OnKeyDown method to provide our own logic, but providing these two common feature would be absolutely free the developer from dealing with the input in most common occasion. maybe it's possible to do this with a Dictionary<Keys, Action> and a Queue<char> internally. i hope you can include these features in the next version. ps: i love the console, it's great! Edited February 7, 2009 by diryboy Quote Share this post Link to post Share on other sites
Indi 714 Posted February 7, 2009 Can anyone go through with me on how to change your character? Quote Share this post Link to post Share on other sites
Phnx 6 Posted February 7, 2009 Could someone provide a script to center the camera behind Niko when unarmed and when in a car center it behind the car (not Niko)? That would be awesome! Quote Share this post Link to post Share on other sites
pwd 0 Posted February 7, 2009 I'm trying to play around with peds that attack. I'm using the script in TestScripts as a base. Here is what I have done(basic modifacations): Public Class AttackScript Inherits Script Private FleeTask As New TaskSequence Protected Overrides Sub Startup() ' Add tasks to the TaskSequence FleeTask.AddTask.SwapWeapon(Weapon.Handgun_Glock) FleeTask.AddTask.FightAgainst(Player, -1) 'FleeTask.AddTask.FleeFromChar(Player, False, 5000) 'FleeTask.AddTask.Die() End Sub Protected Overrides Sub KeyDown(ByVal key As Keys) If key <> Keys.K Then Return Dim p As Ped = World.CreatePed(Player.Character.Position.Around(3.0F)) p.CurrentRoom = Player.Character.CurrentRoom p.Weapons.Glock.Ammo = 1000 p.Task.PerformSequence(FleeTask) p.Health = 500 End SubEnd Class Bassically I would like to have a random ped spawn then attack forever. The -1 seems to work, but it always crashes after a while of playing. I like this idea because I like being chased in a car(the spawned ped does, most of the time, hop in a car). I'm assumeing if I spawn a ped with a submachine gun, they will attack from the car? Is there a way to spawn an attacking ped without a task sequence? i'd appreciate some help. Thanks! Quote Share this post Link to post Share on other sites
CoMPMStR 1 Posted February 7, 2009 I'm trying to play around with peds that attack. I'm using the script in TestScripts as a base. Here is what I have done(basic modifacations): submitted code Bassically I would like to have a random ped spawn then attack forever. The -1 seems to work, but it always crashes after a while of playing. I like this idea because I like being chased in a car(the spawned ped does, most of the time, hop in a car). I'm assumeing if I spawn a ped with a submachine gun, they will attack from the car? Is there a way to spawn an attacking ped without a task sequence? i'd appreciate some help. Thanks! This is how I'd do it: Protected Overrides Sub KeyDown(ByVal key As Keys) If key = Keys.K Then Dim p As Ped = World.CreatePed(World.GetGroundPosition(Player.Character.Position.Around(3.0F))) If Exists(p) Then p.CurrentRoom = Player.Character.CurrentRoom p.Health = 500 p.Weapons(Weapon.Handgun_Glock).Ammo = 1000 p.Weapons(Weapon.Handgun_Glock).Select() p.Task.FightAgainst(Player.Character, Integer.MaxValue) End If End If End Sub I hope it helps. Quote Share this post Link to post Share on other sites
pwd 0 Posted February 8, 2009 That works great! Thanks alot CoMPMStR. Quote Share this post Link to post Share on other sites
Canada505 0 Posted February 8, 2009 Hello yesterday I installed .Net ScriptHook by Hazard to play with Compmaster SuperSpawn script. When I try to run GTA I hear only some ERROR sound and nothing happens. From Alexander Blade ASI loader I get this code: ....Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\PlayerSelector.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\PlayerSelector.asi, Address 0x036D0000[b]Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\ScriptHookDotNet.asi[/b] and nothing. Tryed with: NET Framework 2.0, 3.5 Alexander Blade ASI loader YAASIL loader GTA IV version 1.0.2.0 (original) When I close my PC I get "Microsoft Visual ... Error" - after trying this mod. Can someone help me ? Quote Share this post Link to post Share on other sites
pwd 0 Posted February 8, 2009 Hmm, so are you able to load a saved game or does it just crash when you start GTA? Did you check the log file in the GTA folder? Quote Share this post Link to post Share on other sites
Canada505 0 Posted February 8, 2009 It crash when I start GTA. My full ASI log: // -- GTA IV ASI LOADER LOG -- ////-- © Alexander Blade 2008 -- //C:\WINDOWS\system32\dsound.dll is loaded, address 0x73EA0000Hooking dsound proc named "DirectSoundCreate""DirectSoundCreate" hooked, address 0x73EA473BHooking dsound proc named "DirectSoundEnumerateA""DirectSoundEnumerateA" hooked, address 0x73EC708DHooking dsound proc named "DirectSoundEnumerateW""DirectSoundEnumerateW" hooked, address 0x73EC70AAHooking dsound proc named "DllCanUnloadNow""DllCanUnloadNow" hooked, address 0x73ECBE61Hooking dsound proc named "DllGetClassObject""DllGetClassObject" hooked, address 0x73EB09C5Hooking dsound proc named "DirectSoundCaptureCreate""DirectSoundCaptureCreate" hooked, address 0x73EC68BBHooking dsound proc named "DirectSoundCaptureEnumerateA""DirectSoundCaptureEnumerateA" hooked, address 0x73EC70C7Hooking dsound proc named "DirectSoundCaptureEnumerateW""DirectSoundCaptureEnumerateW" hooked, address 0x73EC70E4Hooking dsound proc named "GetDeviceID""GetDeviceID" hooked, address 0x73EC6D42Hooking dsound proc named "DirectSoundFullDuplexCreate""DirectSoundFullDuplexCreate" hooked, address 0x73EC6A32Hooking dsound proc named "DirectSoundCreate8""DirectSoundCreate8" hooked, address 0x73EC67F5Hooking dsound proc named "DirectSoundCaptureCreate8""DirectSoundCaptureCreate8" hooked, address 0x73EC696FLoading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\Alice.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\Alice.asi, Address 0x033B0000Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\Car Bomber.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\Car Bomber.asi, Address 0x034F0000Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\God Mode.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\God Mode.asi, Address 0x03640000Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\Guards.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\Guards.asi, Address 0x03680000Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\PlayerSelector.asiASI loaded : C:\Program Files\Rockstar Games\Grand Theft Auto IV\PlayerSelector.asi, Address 0x036D0000Loading ASI C:\Program Files\Rockstar Games\Grand Theft Auto IV\ScriptHookDotNet.asi Quote Share this post Link to post Share on other sites
algrn912005 0 Posted February 8, 2009 try using the xliveless asi loader Quote Share this post Link to post Share on other sites
Canada505 0 Posted February 8, 2009 Thx you algrn912005 now it works ! Quote Share this post Link to post Share on other sites
CoMPMStR 1 Posted February 8, 2009 Thx you algrn912005 now it works ! Hmm that's weird that Hazard's own ASI loader doesn't work with his compiled ASI. I use xliveless though, so I've never had problems. Quote Share this post Link to post Share on other sites
algrn912005 0 Posted February 8, 2009 is it possible to create new lines with the Game.DisplayText function? When I use \n is doesn't work and is still on the same line. Quote Share this post Link to post Share on other sites
loczek47 0 Posted February 9, 2009 Hey HazardX, what's the .p for glock weapon? I mean, this is for MP5: p.Weapons.SMG_MP5.Ammo = 30000; and what is for Glock? (the black pistol with 17 bullets in magazine) Quote Share this post Link to post Share on other sites
Donny78 0 Posted February 9, 2009 Graphics.DrawRectangle(Game.Resolution.Width / 2, Game.Resolution.Height / 2, 100, 100, Drawing.Color.Blue) I think the screen is from 0.0 to 1.0 so try: Graphics.DrawRectangle( 0.5, 0.5, 0.1, 0.1, Drawing.Color.Blue) That should make a box at the center of the screen which is 80x60 pixels based off an 800x600 canvas or maybe I'm wrong about the 80x60 but it shouldn't be that big on your screen. Quote Share this post Link to post Share on other sites
loczek47 0 Posted February 9, 2009 Hey HazardX, what's the .p for glock weapon? I mean, this is for MP5: p.Weapons.SMG_MP5.Ammo = 30000; and what is for Glock? (the black pistol with 17 bullets in magazine) Bump, because I'm afraid hazardX won't read previous page Quote Share this post Link to post Share on other sites
Donny78 0 Posted February 9, 2009 Hey HazardX, what's the .p for glock weapon? I mean, this is for MP5: p.Weapons.SMG_MP5.Ammo = 30000; and what is for Glock? (the black pistol with 17 bullets in magazine) Bump, because I'm afraid hazardX won't read previous page It would be Glock wouldn't it ? p.Weapons.Glock. Quote Share this post Link to post Share on other sites
loczek47 0 Posted February 9, 2009 (edited) Nah I don't think so, but I will check it out. I don't think so because most of weapons have realy long names "Assault_Rifle_M4" etc. EDIT: It works, thank You. Edited February 9, 2009 by loczek47 Quote Share this post Link to post Share on other sites
Intosia 0 Posted February 9, 2009 Why is 'Model.name' property not working? It says in not in the final build? Or something? Tobad, would be usefull. Quote Share this post Link to post Share on other sites
HazardX 13 Posted February 9, 2009 (edited) Please excuse my silence, i've been visiting Brussels (in Belgium, very interesting city BTW) in the last days and thus haven't been to the boards. @loczek47: It is indeed just "Glock". I thought the name was obvious enough by itself. It is best to use Visual Studio to edit the scripts, it will show you exactly which names are available. @CoMPMStR: Screen coordinates are always in range 0.0 to 1.0 , just as Donny78 said. @diryboy: Your BindKey and RegisterConsoleCommand suggestions would be great additions. I guess i'll implement them. @Intosia: I never tried it. Just included it because the related native function sounded fitting. The problem is that models are given as hash-codes of the name. Turning the hashcode into the full name again is not possible unless the game provides such a function for known model names. Edited February 9, 2009 by HazardX Quote Share this post Link to post Share on other sites
iriedreadlock23 50 Posted February 9, 2009 How could i set object velocity? I am trying to get information from the function, GET_OBJECT_VELOCITY, but i get long number from it... 12395813... something like this... i will try now if setting velocity will work... let me know if you know tested way to set velocity.. Thanks Quote Share this post Link to post Share on other sites
Phnx 6 Posted February 9, 2009 Could someone provide a script to center the camera behind Niko when unarmed and when in a car center it behind the car (not Niko)? That would be awesome! No way to do it?! Quote Share this post Link to post Share on other sites
SlingShotUK 58 Posted February 9, 2009 Please excuse my silence, i've been visiting Brussels (in Belgium, very interesting city BTW) in the last days and thus haven't been to the boards. Hey great city to visit. We went there for the first time last July. Some nice architecture although I much preferred visiting the many cool bars and indulging (or is that over-indulging) on lovely Belgium fruit beers.. Did you do a lot while you were there? Quote Share this post Link to post Share on other sites
algrn912005 0 Posted February 9, 2009 is it possible to create new lines with the Game.DisplayText function? When I use \n is doesn't work and is still on the same line. lol my post got buried... so can anyone answer? Quote Share this post Link to post Share on other sites