Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

[BETA] GTAIV .Net ScriptHook


HazardX
 Share

Recommended Posts

On that topic...

 

After installing the latest .net scripthook release (to use with grabscript), I started having a problem in the sjaak's Simple trainer. For some reason the "enter" button (numpad 5) for the trainer menu is acting strange. I have to hold the button down for at least 3 seconds for it to register. It only acts like this with the .net scripthook installed. Took it out and the enter button was responsive once again.

 

I'm on GTA4 1.0.0.4

 

Using ASI loader 1.0.2.0b

 

Tried aru's 0.30 c++ script hook (9-7-2009) as well as the one included.

 

 

Everything other button in the trainer seems to be working fine as far as I can tell... I even tried binding the enter button to a different key and it didn't work.

Say no more smile.gif

 

Exact same problem for me, I will recompile my trainer against Aru's latest scripthook tomorrow, as the one I'm using doesn't have this problem. Strange that it actually matters.

 

 

Link to comment
Share on other sites

It seems like I spoke too soon, as recompiling it against the lastest hook doesn't solve the problem, once I unload the .net hook (using the developer menu in aru's hook) num 5 works again.

 

To be honest, I have no clue at the moment sad.gif

Link to comment
Share on other sites

There's something weird, I've just installed the .NET scripthook and while I tried to play the game, after the savegame has been loaded, the game crash. No error. I'm using Xliveless (lastest), Patch 1.0.4.0.

Link to comment
Share on other sites

CaptainDingo

Got a problem with the new script hook.

 

This line used to be valid, but now it's not, and I don't understand why.

 

 

Player.Character.Animation.Play(animburger, "eat_burger_plyr");

 

 

It says the problem is that it has "no overloads" and takes 2 arguments.

 

Not sure what to do.

 

EDIT: Nevermind, looks like animations require a third thingy in parenthesis for animation speed now. I added 1.0F and now it's fine.

Edited by CaptainDingo
Link to comment
Share on other sites

CaptainDingo

Got a new issue though. Looks like all my drawing rectangles don't show up anymore.

 

confused.gif *Beating my head*

Link to comment
Share on other sites

Got a new issue though. Looks like all my drawing rectangles don't show up anymore.

 

confused.gif *Beating my head*

The graphics Class has changed in many parts. At default all drawing is done in Pixels now. If you use ScreenUnits as coordinates, you have to set the "Scaling" property of the Graphics object to ScreenUnits.

Link to comment
Share on other sites

So instead of using 0.2f and 0.5f etc. I have to specifiy it in pixesl? ie. 200, 500?

Link to comment
Share on other sites

So instead of using 0.2f and 0.5f etc. I have to specifiy it in pixesl? ie. 200, 500?

You CAN if you want to. Pixels are the default setting. But the Graphics object given to you by the PerFrameDrawing event has a "Scaling" property, which can be changed to ScreenUnits to get the 0.0f - 1.0f coordinate system back. You have to set the property inside PerFrameDrawing right before you start drawing your stuff.

Link to comment
Share on other sites

Ah I'll end up doing that, otherwise specifiying things is pixels will play havock with different resolutions. Cheers.

Link to comment
Share on other sites

After I installed .net scripthook 0.88, my game was crash when load savegame.

I looked into scripthookdotnet.log say:

 

 

2009-07-27 17:37:37 - Initializing ScriptHookDotNet v0.88 BETA (GTA IV version 1.0.3.0)2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()2009-07-27 17:38:41 - Direct3D device created!2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()

 

 

I did something wrong? Please help me!

Link to comment
Share on other sites

After I installed .net scripthook 0.88, my game was crash when load savegame.

I looked into scripthookdotnet.log say:

 

 

2009-07-27 17:37:37 - Initializing ScriptHookDotNet v0.88 BETA (GTA IV version 1.0.3.0)2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()2009-07-27 17:38:41 - Direct3D device created!2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()

 

 

I did something wrong? Please help me!

I have the same problem, And I also have the same entry in the scripthookdetnet.log file too.

Link to comment
Share on other sites

After I installed .net scripthook 0.88, my game was crash when load savegame.

I looked into scripthookdotnet.log say:

 

 

2009-07-27 17:37:37 - Initializing ScriptHookDotNet v0.88 BETA (GTA IV version 1.0.3.0)2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()2009-07-27 17:38:41 - Direct3D device created!2009-07-27 17:38:41 - Error during Direct3D rendering:                     System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        at GTA.NetHook.Draw()                        at GTA.Direct3D.OnRender()

 

 

I did something wrong? Please help me!

I have the same problem, And I also have the same entry in the scripthookdetnet.log file too.

I have the same problem.

 

 

2009-07-27 01:47:46 - Initializing ScriptHookDotNet v0.88 BETA (GTA IV version 1.0.4.0)2009-07-27 01:48:38 - Error during Direct3D rendering:                     System.MissingMethodException: Nie odnaleziono metody: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        w GTA.NetHook.Draw()                        w GTA.Direct3D.OnRender()2009-07-27 01:48:38 - Direct3D device created!2009-07-27 01:48:38 - Error during Direct3D rendering:                     System.MissingMethodException: Nie odnaleziono metody: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        w GTA.NetHook.Draw()                        w GTA.Direct3D.OnRender()2009-07-27 01:48:38 - SEARCHING FOR SCRIPTS...2009-07-27 01:48:38 - DONE! No DotNet script found!2009-07-27 01:48:38 - Unhandled Exception: System.MissingMethodException: Nie odnaleziono metody: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'.                        w GTA.NetHook.Tick()                        w StartupThreadC.RunTick(StartupThreadC* )

 

Link to comment
Share on other sites

Make sure your DirectX is updated.

 

Hazard, the DrawRectangle works fine and displays in the correct position with e.Graphics.Scaling = FontScaling.ScreenUnits. However any text doesn't it all appears in the top right hand corner.

Link to comment
Share on other sites

 

System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'

 

Thanks for the info. It seems like Microsoft added some new functions in a .Net Servicepack that were not available previeously. sad.gif

I will change the code now to use functions that were available in the .Net Framework 2.0 already.

In the meantime, to solve this problem install the .Net Framework 3.5 ServicePack1.

Edited by HazardX
Link to comment
Share on other sites

Sorry for the double post, but this is important:

 

VERY IMPORTANT BUGFIX RELEASE:

 

GTAIV .Net Script Hook v0.89 BETA

 

Changes in Version 0.89 BETA:

- Using the same DirectX version as GTA4 now. No need to update it anymore. (thanks to bean_xp for the hint)

- Fixed a problem with errors complaining about the missing method WaitHandle.WaitOne(Int32)

- Fixed a major bug that resulted in a new object being generated every time you retrieve a ped, vehicle or object, even when you retrieved the same thing earlier. This broke MANY things!

Link to comment
Share on other sites

Awesome job man, respect. cookie.gif

Can't wait to see more mods, like Tuning mod biggrin.gif

Link to comment
Share on other sites

CaptainDingo

Why is the ScriptHook.dll from that archive much older than the one from the archives you uploaded before?

Link to comment
Share on other sites

Why is the ScriptHook.dll from that archive much older than the one from the archives you uploaded before?

Looking at the filesize its the latest Scripthook.dll. The version shows 0.2.6 because Aru forgot to update the version number...

Link to comment
Share on other sites

Why is the ScriptHook.dll from that archive much older than the one from the archives you uploaded before?

Intosia is right. It is the latest release from aru's hook. The filedate was just messed up while packing the v0.88 archive. I fixed that before packing v0.89.

Link to comment
Share on other sites

Im messing around with the GetPeds and stuff (from memory).

 

Maybe you can add a overload so you get only the object in a certain radius.

 

For example: World.GetAllPeds(Player.Character.Position, 30.0f);

 

catspider.gif

 

Link to comment
Share on other sites

Im messing around with the GetPeds and stuff (from memory).

 

Maybe you can add a overload so you get only the object in a certain radius.

 

For example: World.GetAllPeds(Player.Character.Position, 30.0f);

 

catspider.gif

There is one already:

 

World.GetPeds(Player.Character.Position, 30.0f);

 

 

It is the same as GetAllPeds just with position and radius as additional parameters. Maybe it would have been better to make them all overloads of "GetPeds"... oh well...

Link to comment
Share on other sites

Im messing around with the GetPeds and stuff (from memory).

 

Maybe you can add a overload so you get only the object in a certain radius.

 

For example: World.GetAllPeds(Player.Character.Position, 30.0f);

 

catspider.gif

There is one already:

 

World.GetPeds(Player.Character.Position, 30.0f);

 

 

It is the same as GetAllPeds just with position and radius as additional parameters. Maybe it would have been better to make them all overloads of "GetPeds"... oh well...

Damn you're right, totaly missed it! (Thought it was wierd you didnt inplemented it... tounge.gif )

 

Edit: awesome stuff on the memory part! Adds great flexibility to my mod working with peds.

Link to comment
Share on other sites

Ty again Hazard inlove.gifsmile.gif

Say, theres abit discussion in here on errors and things, what can we use to test it ?

 

Right now I dont have any updated .net scripts to test w/ the new hook, I tried to use your grabscript Hazard to test it but it doesnt seem to be working so I wondered if you just hadnt updated that or ..

 

The only other things I have are sjaaks trainer and vehicle selector and ofcourse they arent .net ..

Link to comment
Share on other sites

Ty again Hazard inlove.gifsmile.gif

Say, theres abit discussion in here on errors and things, what can we use to test it ?

 

Right now I dont have any updated .net scripts to test w/ the new hook, I tried to use your grabscript Hazard to test it but it doesnt seem to be working so I wondered if you just hadnt updated that or ..

 

The only other things I have are sjaaks trainer and vehicle selector and ofcourse they arent .net ..

Works fine for me smile.gif Just give a week, i think all the old .NET scripts will get updated biggrin.gif

Link to comment
Share on other sites

awesome stuff on the memory part! Adds great flexibility to my mod working with peds.

Thanks. smile.gif

 

Just keep in mind that those functions may also return player and missionpeds/vehicles.

They are also likely to have alot of overhead, thus it would be best not to call those functions every frame. Otherwise it might have a noticeable performance impact. But i haven't done any in-depth performance tests, thus i do not not exactly how much time (in milliseconds) those functions require to process in average.

 

@Costar: The current version of the GrabScript should run fine. Make sure that the ScriptHook.dll is located in your main GTAIV folder, even if you have the ScriptHookDotNet.asi in the "plugins" subfolder. If it still does not work, please look for a "ScriptHookDotNet.log" file and post it's contents here.

Link to comment
Share on other sites

It was in there, but my Friend did update his trainer, and these are the logs I have.. I dlded your .89 and ran this test

 

aru's script log

 

 

[iNFO] GTA IV Script Hook 0.3.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x2b0000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.4[iNFO] Script Hook - Shutdown[WARN] [scriptHookWatchThread] Thread instance is being deleted while still hooked

 

 

Then your log

 

 

2009-07-27 15:43:57 - STARTING SCRIPTS...2009-07-27 15:43:57 -  ...successfully started script 'Trainer.ColorChanger'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.Backup'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.Invincibility'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.ScreenDraw'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.InGameMenu'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.WeaponSelector'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.ConsoleController'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.PoliceController'!2009-07-27 15:43:57 -  ...successfully started script 'Trainer.TimeChanger'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.KeyController'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.TaxiSpawner'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.WeatherController'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.Speedometer'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.Explode'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.PedSpawner'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.CarSpawner'!2009-07-27 15:43:58 -  ...successfully started script 'Trainer.Regenerator'!2009-07-27 15:43:58 - The script 'GrabScript.GrabScript' was created for the older .Net ScriptHook version 0.88! It may not run as expected!2009-07-27 15:43:58 -  ...successfully started script 'GrabScript.GrabScript'!2009-07-27 15:45:36 - Direct3D device lost!2009-07-27 15:45:47 - Direct3D device created!

 

 

Sorry for the long post, the only things I had in-game as of this test was the vehicle selector and my Friends trainer, I think he has a few things to fix but I saw that D3D device lost in the console menu when I presst the tilde key .. I have no idea what any of that means. The issue was, I was trying to raise my wanted to level to activate a wanted level cap function, but b4 I reached it, my game just froze .. I also am aware of the message there about grab script but it wasnt working for me (in .88 dint get a chance to try b4 freezing this time), I tried changing the key from B to Backspace, still dint work..

 

Update I was able to get your grabscript to work fine when reloading my game w/ .89 !

Note: I tried reinstalling the .88 and the grabscript still wouldnt work and neither would my Friends trainer but they both work w/ .89, I will see what else happens.

Edited by Costar
Link to comment
Share on other sites

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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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