Quantcast

Jump to content

» «
Photo

[BETA] GTAIV .Net ScriptHook

2,939 replies to this topic
empirestate
  • empirestate

    Player Hater

  • Members
  • Joined: 30 Aug 2013

#2911

Posted 30 August 2013 - 05:58 PM

I have a difficulty installing this bus driver mod. I have win 7, x64 and GTA IV version 1.0.7.0. I have put latest .net Scripthook Version 1.7.1.6 into GTA IV main directory, and I also put bus driver mod in scripts folder. I followed the requirements to have - Microsoft .Net Framework 4 and Microsoft Visual C++ 2010 Redistributable Package (x86) installed on my pc. Also I put Yassil asi loader (dsound.dll) in the main GTA IV directory. But when pressing PageUp button the mod doesnt start. I have also tried to to laund the game as administrator, set compatability to windows Xp, service pack 3. Still mod wont load. Maybe someone has an idea, what might be the problem? smile.gif

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#2912

Posted 30 August 2013 - 07:29 PM

QUOTE (Cyron43 @ Sunday, Apr 14 2013, 18:30)
Hi there,
I'm currently writing a mod in C#.
Everything works fine but now that I like to add something that is triggered by a specific phone number I'm stuck.
I have read in your initial post that the PhoneNumberDialed event don't work on Windows 7 machines (any clue why not?).
So I tried the BindPhoneNumber method but that won't work either.
Two questions about it:
1. What convention do I have to use for the phone number string? Is it like "XYZ 555 0100"?
Do I have to use whitespaces in-between? Is the 555 sequence in the middle a must?
I guess I can use letters or numbers for the first sequence, right?
Can I use any 3-digit number from 000 to 999 for the first sequence?
Can I use any 4-digit number from 0000 to 9999 for the last sequence?

2. What else do I have to do besides using this method?
Currently all I have done for the phone handling is this piece of code (the ImmediateShutDown method is fully functional):
CODE
BindPhoneNumber("LSX5550100", ImmediateShutDown);

BTW a new PhoneDialDelegate instance is redundant so I skipped it.

Oh and I like to add: the phone numbers of the fuel mod don't work either in my game. Maybe that helps.

EDIT: I peeked into the .Net scripthook via ILSpy and found the Helper.CleanPhoneNumber method. So that clarifies my questions about the whitespaces and the letters but the other questions remain.
Anyway I wonder why nothing happens when I dial that number in the game.

Phone dial events still do not work on Windows 7! - quoting hazardx.

Have you noticed .NET Scripthook is open source ?! You don't need ILSpy, just Visual Studio.

Nothing happens because the allocation zone for the dialed number isn't the same as the one scripthook watches for.

Jeansowaty
  • Jeansowaty

    Notorious fan of underground electronic music and Molly Schultz

  • Members
  • Joined: 31 Mar 2013
  • Poland

#2913

Posted 07 January 2014 - 06:24 PM

12363w8.jpg

Why do I have this damn error when starting GTA4? And this doesn't work.


65536
  • 65536

    Snitch

  • Members
  • Joined: 07 Sep 2012
  • Bulgaria

#2914

Posted 12 February 2014 - 05:00 PM Edited by 65536, 12 February 2014 - 05:02 PM.

12363w8.jpg

Why do I have this damn error when starting GTA4? And this doesn't work.

I also have a ScriptHook and it have an annoying bug - it makes my GTA IV 1.0.7.0 to crash sometimes while loading... I checked all versions I've found compatible with last patch and I found all have and uses a same buggy ScriptHook.dll file:

 

Size: 328 KB (336 384 bytes)

Modified: 28 ‎May ‎2010, ‏‎17:52:44

 

There is even an another version of ScriptHook compatible with GTA IV 1.0.7.0 uses a ScriptHook.dll DIFFERENT than the one noted above?!? Because I'm tired from those crashes while my GTA IV loads... I'm only using Simple Native Trainer 6.3 and playing Criminal Russia RAGE map total conversion... If I remove that buggy ScriptHook.dll, the trainer won't work at all... What to do??? Can someone tell me for a version that does NOT have that bug...


Jeansowaty
  • Jeansowaty

    Notorious fan of underground electronic music and Molly Schultz

  • Members
  • Joined: 31 Mar 2013
  • Poland

#2915

Posted 13 February 2014 - 11:43 AM

I managed to fix these crashes by installing the More Safehouses mod by SkorPro :) Now my IV works fine with no glitches at all!


cp1dell
  • cp1dell

    Ghetto Star

  • Members
  • Joined: 04 Jul 2008

#2916

Posted 21 February 2014 - 11:05 PM

Has anyone figured out a way to fix the indoor rain bug with the Scripthook's .asi? I really want to do another playthrough of GTA IV+EFLC with some script to really change the gameplay, but the indoor rain bug is just so screwy.


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2917

Posted 21 February 2014 - 11:41 PM

Has anyone figured out a way to fix the indoor rain bug with the Scripthook's .asi? I really want to do another playthrough of GTA IV+EFLC with some script to really change the gameplay, but the indoor rain bug is just so screwy.

i havent noticed the indoor rainbug since i updated to 1.0.7... are u on 1.0.4?


cp1dell
  • cp1dell

    Ghetto Star

  • Members
  • Joined: 04 Jul 2008

#2918

Posted 22 February 2014 - 04:49 AM

Nope, 1.0.7.0. Maybe I have a weird version. It is in fact this one, right?


123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#2919

Posted 02 March 2014 - 05:05 AM

Is there anyway make the alpha factor work on the pictures that modders add to game? I mean make those picture fade slowly and disappear.
like this

e.Graphics.DrawSprite(Picture, CENterX, CENterY, 158.0f, 158.0f, 0.0f, Color.FromArgb(AlpHal, Color.Transparent));

if (AlpHal<0) AlpHal = 255;

AlpHal--;

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2920

Posted 02 March 2014 - 06:28 AM

 

Is there anyway make the alpha factor work on the pictures that modders add to game? I mean make those picture fade slowly and disappear.
like this

e.Graphics.DrawSprite(Picture, CENterX, CENterY, 158.0f, 158.0f, 0.0f, Color.FromArgb(AlpHal, Color.Transparent));

if (AlpHal<0) AlpHal = 255;

AlpHal--;

 

best to use multiple images with different levels of opacity and chosse the appropriate texture to draw, u need to load more textures is the trade


123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#2921

Posted 03 March 2014 - 07:51 AM

 

 

Is there anyway make the alpha factor work on the pictures that modders add to game? I mean make those picture fade slowly and disappear.
like this

e.Graphics.DrawSprite(Picture, CENterX, CENterY, 158.0f, 158.0f, 0.0f, Color.FromArgb(AlpHal, Color.Transparent));

if (AlpHal<0) AlpHal = 255;

AlpHal--;

 

best to use multiple images with different levels of opacity and chosse the appropriate texture to draw, u need to load more textures is the trade

 

I have already thought of that but I don't want the computer load too much. We need more space for other mods.


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#2922

Posted 03 March 2014 - 08:54 AM

 

 

 

Is there anyway make the alpha factor work on the pictures that modders add to game? I mean make those picture fade slowly and disappear.
like this

e.Graphics.DrawSprite(Picture, CENterX, CENterY, 158.0f, 158.0f, 0.0f, Color.FromArgb(AlpHal, Color.Transparent));

if (AlpHal<0) AlpHal = 255;

AlpHal--;

 

best to use multiple images with different levels of opacity and chosse the appropriate texture to draw, u need to load more textures is the trade

 

I have already thought of that but I don't want the computer load too much. We need more space for other mods.

 

As you have already found, it is not possible with the current Scripthook. Maybe a future version will support it, but for now you'll have to resort to fancy tricks or multiple textures.


onlyTMJ
  • onlyTMJ

    Player Hater

  • Members
  • Joined: 22 Apr 2014
  • United-Kingdom

#2923

Posted 22 April 2014 - 03:40 PM

How can you spawn a vehicle facing a certain direction??

 

Vehicle bv3 = World.CreateVehicle("POLICE", bl3);
                bv1.Rotation = west;
                bv1.FreezePosition = true;
                
ive done this, with west being a vector 3 with the last variable being 270 degrees
 
But the cars dont change in any ordered manner

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2924

Posted 22 April 2014 - 04:31 PM Edited by LordOfTheBongs, 22 April 2014 - 04:34 PM.

 

How can you spawn a vehicle facing a certain direction??

 

Vehicle bv3 = World.CreateVehicle("POLICE", bl3);
                bv1.Rotation = west;
                bv1.FreezePosition = true;
                
ive done this, with west being a vector 3 with the last variable being 270 degrees
 
But the cars dont change in any ordered manner

 

it is easier to set the car's heading...

float west = 270f; bv1.Heading = west;

And what do u mean when u say "But the cars dont change in any ordered manner" ... what are u trying to say?


gtagamer9
  • gtagamer9

    Crackhead

  • Members
  • Joined: 09 Aug 2013

#2925

Posted 30 April 2014 - 07:18 AM

Hi everyone , im new here but i want to ask if someone can fix this . I have a crash with the watch dogs mod from wojtanis .
 
Here is my scripthookdotnet.log

2014-04-30 09:05:50 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)
2014-04-30 09:06:51 - Direct3D device created!

2014-04-30 09:06:51 - SEARCHING FOR SCRIPTS...
2014-04-30 09:06:51 - Loading scripts in Assembly 'scripts\IceBaby.net.dll' ...
2014-04-30 09:06:51 - ...found script 'IceBaby.IceBaby_Rinepim'!
2014-04-30 09:06:51 - Loading scripts in Assembly 'scripts\VCopMusic.net.dll' ...
2014-04-30 09:06:51 - ...found script 'Ambiance'!
2014-04-30 09:06:51 - Loading scripts in Assembly 'scripts\Watch_Dogs.net.dll' ...
2014-04-30 09:06:51 - ...found script 'Watch_Dogs.Watch_Dogs_Rinepim'!
2014-04-30 09:06:51 - Loading dynamic scriptfile 'scripts\Aidenmove.cs' ...
2014-04-30 09:06:52 - ...found script 'AidenMove.CopGun'!
2014-04-30 09:06:52 - DONE! 4 valid scripts found!

2014-04-30 09:06:52 - STARTING SCRIPTS...
2014-04-30 09:06:52 - INFO: Phone number checks are not available!
2014-04-30 09:06:52 - ...successfully started script 'AidenMove.CopGun'!
2014-04-30 09:06:52 - ...successfully started script 'Ambiance'!
2014-04-30 09:06:52 - ...successfully started script 'IceBaby.IceBaby_Rinepim'!
2014-04-30 09:06:53 - ...successfully started script 'Watch_Dogs.Watch_Dogs_Rinepim'!
2014-04-30 09:07:29 - Error during NetHook.Tick:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Scripting.NativeContext2.Invoke(SByte* name, NativeContext2* cxt)
at GTA.Native.Function.BaseCall(String Name, Parameter[] Arguments)
at GTA.Native.Function.Call(String Name, Parameter[] Arguments)
at GTA.Native.Template.Invoke()
at GTA.ScriptDomain.RemoteEvent(RemoteEventArgs ev)
at GTA.ScriptDomain.ProcessRemoteEvents()
at GTA.ScriptDomain.Tick()
at GTA.NetHook.Tick()

 

Sorry for bad english


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#2926

Posted 30 April 2014 - 07:56 AM Edited by pedro2555, 30 April 2014 - 08:12 AM.

You have 4 scripts loading, are you sure it happens because of watch dogs? Have you tried to isolate watch dogs?


gtagamer9
  • gtagamer9

    Crackhead

  • Members
  • Joined: 09 Aug 2013

#2927

Posted 30 April 2014 - 08:20 AM

Yes i know its watch dogs mod because some other people with patch 1.0.7.0 say in the YT comments that it crashes.
 
When i remove the watch dogs script it does not crashes. [ It crashes ingame when i press H ]
 
mod :

 

Sorry for bad english .


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2928

Posted 30 April 2014 - 02:35 PM

u should pm the author, he is on here randomly and currently active... it looks like some native he is using is being used in a way that it wasnt meant for. He could be using the wrong parameters or maybe he is using something he didnt check for existence. Only he could help or u put his dll in a reflector and paste the code on pastebin


gtagamer9
  • gtagamer9

    Crackhead

  • Members
  • Joined: 09 Aug 2013

#2929

Posted 30 April 2014 - 05:14 PM

Can u please explain how to do , i dont know much about scripts .

 

I downloaded .net reflector and i dont understand.

 

sorry for bad english :/


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2930

Posted 30 April 2014 - 06:17 PM

Can u please explain how to do , i dont know much about scripts .

 

I downloaded .net reflector and i dont understand.

 

sorry for bad english :/

i use ILSpy since it is free... but .net reflector works too, i just have never used

 

so this program can take dll files that have compiled .net code and it recreates the code in c# or vb, so u need to add 2 dlls to this program...

 

1. scripthookdotnet.asi

2. gta .net script

 

Then u should be able to look at the code in the gta script in c#, that code needs to be edited possibly. You really should just PM the author, he will respond, i see him posting here all the time. But just do what I said. If you are lost just ask.


Jeansowaty
  • Jeansowaty

    Notorious fan of underground electronic music and Molly Schultz

  • Members
  • Joined: 31 Mar 2013
  • Poland

#2931

Posted 21 May 2014 - 01:59 PM Edited by Jeansowaty, 21 May 2014 - 05:29 PM.

Okay. Scripthook is the least stable mod on the black market. I removed it, GTA4 works - no script mods.

Added back - crash.


Trigger_85
  • Trigger_85

    Player Hater

  • Members
  • Joined: 06 Sep 2009

#2932

Posted 23 May 2014 - 05:14 AM

Hi there

I have problem. I've been useing Traffic Load mod which work with asi. I think it is the best traffic mod, but it keep on crashing my game after a while of play, so it is unplayable. So I switched to Traffic Flow which works with .NET Scripthook. It works much better. It keep on crashing when I spawn too many cars for my own but it is stable enough when the mod keep spawning random cars normally. It is good enough  for me. Problem is, even I have latest patch installed I'm having rain bug all the time. So far I tried reinstalling the game and installing patch manually (not from Games for Windows self update) but the bug still occur. Anyone can help me with rain bug?


NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Most Knowledgeable [Technology] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Contribution Award [Modding]

#2933

Posted 23 May 2014 - 09:33 AM

Okay. Scripthook is the least stable mod on the black market. I removed it, GTA4 works - no script mods.

Added back - crash.

what do you expect from /clr code


Jeansowaty
  • Jeansowaty

    Notorious fan of underground electronic music and Molly Schultz

  • Members
  • Joined: 31 Mar 2013
  • Poland

#2934

Posted 24 May 2014 - 01:49 PM

Nevermind, I repaired the game. Turns out the Trainer.ini garbled itself somehow o_O


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#2935

Posted 31 May 2014 - 04:42 PM

Man can I get the source in c# ?


LetsPlayOrDy
  • LetsPlayOrDy

    Too fast for ya

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2936

Posted 11 June 2014 - 05:25 PM

Man can I get the source in c# ?

 

The source is in C++, there isn't any changing that.


GTAHitman47
  • GTAHitman47

    Player Hater

  • New Members
  • Joined: 20 Jul 2014
  • United-States

#2937

Posted 20 July 2014 - 09:53 PM

i installed every thing on my gta iv v1.0.7.0 but the script mods not working but asi mods are working perfect

any help please


LetsPlayOrDy
  • LetsPlayOrDy

    Too fast for ya

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2938

Posted 20 July 2014 - 11:18 PM

i installed every thing on my gta iv v1.0.7.0 but the script mods not working but asi mods are working perfect
any help please

Did you copy the .NET mods to the scripts folder?
  • GTAHitman47 likes this

GTAHitman47
  • GTAHitman47

    Player Hater

  • New Members
  • Joined: 20 Jul 2014
  • United-States

#2939

Posted 02 August 2014 - 10:50 AM

ok thanks for ur help script mods worked after re-installing my windows 


Cyron43
  • Cyron43

    Player Hater

  • Members
  • Joined: 14 Apr 2013

#2940

Posted 02 November 2014 - 05:00 PM Edited by Cyron43, 07 November 2014 - 12:04 AM.

It's great to see this forum is still active. :)
So here is another problem: I try to let my Player.Character walk to a waypoint but Task.Goto seems to not work.

Player.Character.BlockPermanentEvents = true;
Player.Character.Task.ClearAll();
Game.LoadAllPathNodes = true;
Player.Character.Task.GoTo(Game.GetWaypoint().Position);

This code does nothing, unfortunately. Luis just stands there while

Player.Character.Task.WanderAround();

works as expected (I use that when there is no waypoint given).
I have also tried a native function call
 

      private void MyGoto(Vector3 waypoint, byte moveType)
      {
         Function.Call("TASK_GO_STRAIGHT_TO_COORD", new Parameter[]
                                                                {
                                                                   Player.Character,
                                                                   waypoint.X,
                                                                   waypoint.Y,
                                                                   waypoint.Z,
                                                                   moveType,
                                                                   -1
                                                                });
      }

but that doesn't help it.
I'd appreciate help with this.
 
EDIT for update
I found a native function which makes Luis walk at least. Alas he just walks in a straight line. No path routing or stop at a red traffic light. :cry:

         Function.Call("TASK_CHAR_SLIDE_TO_COORD", new Parameter[]
                                                   {
                                                      ped,
                                                      waypoint.X,
                                                      waypoint.Y,
                                                      waypoint.Z,
                                                      0,
                                                      1
                                                   });




7 user(s) are reading this topic

0 members, 7 guests, 0 anonymous users