Quantcast

Jump to content

» «
Photo

[BETA] GTAIV .Net ScriptHook

2,938 replies to this topic
Remos
  • Remos

    Player Hater

  • Members
  • Joined: 22 Jan 2009

#61

Posted 24 January 2009 - 03:29 AM

QUOTE (HazardX @ Jan 23 2009, 15:30)
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.

Cool, thanks for the reply.
I wish R* would someday make a game that we could actually mod without huge amounts of reverse engineering.

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#62

Posted 24 January 2009 - 04:41 AM

QUOTE (loczek47 @ Jan 19 2009, 08:07)
QUOTE (HazardX @ Jan 19 2009, 14:02)
QUOTE (loczek47 @ Jan 19 2009, 13:21)
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.

I have to second this. I also have these random crashes after reloading the scripts. I usually just exit the game anyway to avoid the crashing.

amisnaru
  • amisnaru

    Non-flying Finn

  • Members
  • Joined: 05 Oct 2007

#63

Posted 25 January 2009 - 10:47 AM

Please tell me you're working on a 1.0.2.0 version inlove.gif

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#64

Posted 25 January 2009 - 10:55 AM

QUOTE (amisnaru @ Jan 25 2009, 11:47)
Please tell me you're working on a 1.0.2.0 version inlove.gif

Yes, i am. smile.gif Still got some problems to solve, but it will be ready soon.

SlingShotUK
  • SlingShotUK

    GTA Collector and fan since 2001

  • Members
  • Joined: 20 Nov 2008

#65

Posted 25 January 2009 - 01:24 PM

QUOTE (HazardX @ Jan 25 2009, 10:55)
QUOTE (amisnaru @ Jan 25 2009, 11:47)
Please tell me you're working on a 1.0.2.0 version  inlove.gif

Yes, i am. smile.gif Still got some problems to solve, but it will be ready soon.

Thank god for people like you HazardX (includig Aru, Alexander et al)..

Great that your on scene and continually providing us with these brilliant releases.

The .NET hook is the most exciting release I've seen. I haven't modded my game yet, but intend to give play with your hook once I've played the game a bit more and released some more movies. I was going to try and learn the C++ hook but when you released this I must admit it looked a lot more up my street. I'm a web programmer with over 10 years experience so should be able to pick up the syntax of .NET pretty quickly I hope.

I was just thinking it could be quite cool if you had your own forum for this hook - a place where people could share their code and ask questions on various fecets of the system. I'm going to have lots of simple .NET related questions which would probably just clog up this thread, whereas on a special forum it would be a lot easier to ask them.

Keep up the awesome work.. This is such an exciting project.. The task developments are incredible...

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#66

Posted 25 January 2009 - 07:45 PM Edited by HazardX, 25 January 2009 - 08:08 PM.

NEW VERSION:

GTAIV .Net Script Hook v0.80 BETA

Changes in Version 0.80 BETA:
- added support for game version 1.0.2.0 (thanks to aru)
- fixed several crashing problems in the constructor of scripts
- Improved performance alot (especially when accessing many objects)
- You can now call Wait() inside Startup() of your script
- It will now reject to load scripts in ranked Multiplayer. thanks to C06alt for the great idea!
- Added basic Object and Animation support
- Added a script example that uses an external configuration file. thanks to CoMPMStR for the idea!
- Added a script example that'll make you smoke a spliff. wink.gif thanks to iriedreadlock23 for the infos!
- Added a script example that syncs ingame time with realtime
- Improved existing examples
- some minor renames again
- Added more functions, tasks and a bit of everything


Animation example:
CODE
     Player.Character.Animation.Play(anims, "create_spliff", animflags)
     Wait(1600)

     spliff = World.CreateObject(&HD130ADEF, Player.Character.Position)
     spliff.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.14F, 0.03F, 0.04F), New Vector3(2.21F, -0.12F, 0.0F))

     Player.Character.Animation.WaitUntilFinished(anims, "create_spliff")



@SlingShotUK : Thanks, i really appreciate that! I'm pretty sure that you won't have much problems with .Net. It is really easy to learn and it is actually pretty hard to do something wrong. smile.gif
BTW: I absolutely LOVE your "You can't escape the law" video! Definately one of the best GTA4 videos ever!

WeNoN
  • WeNoN

    Player Hater

  • Members
  • Joined: 18 Jan 2009

#67

Posted 25 January 2009 - 08:33 PM

HELP!! error "R6030 - CRT not initialized"

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#68

Posted 25 January 2009 - 08:38 PM

QUOTE (WeNoN @ Jan 25 2009, 21:33)
HELP!! error "R6030 - CRT not initialized"

This is a bug in the new AsiLoader (based on dsound.dll). confused.gif i guess Alexander has to update the AsiLaoder again. The AsiLaoder in XliveLess works great, though.

KewlAzMe
  • KewlAzMe

    Player Hater

  • Members
  • Joined: 01 Jul 2005

#69

Posted 25 January 2009 - 08:49 PM

nvm... you just addressed it

WeNoN
  • WeNoN

    Player Hater

  • Members
  • Joined: 18 Jan 2009

#70

Posted 25 January 2009 - 08:50 PM

QUOTE (HazardX @ Jan 25 2009, 20:38)
QUOTE (WeNoN @ Jan 25 2009, 21:33)
HELP!! error "R6030 - CRT not initialized"

This is a bug in the new AsiLoader (based on dsound.dll). confused.gif i guess Alexander has to update the AsiLaoder again. The AsiLaoder in XliveLess works great, though.


But with XliveLess I can't connect with WindowsLive

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#71

Posted 25 January 2009 - 08:52 PM

QUOTE (WeNoN @ Jan 25 2009, 21:50)
But with XliveLess I can't connect with WindowsLive

Thats true. I'll try to find a workaround...

SlingShotUK
  • SlingShotUK

    GTA Collector and fan since 2001

  • Members
  • Joined: 20 Nov 2008

#72

Posted 25 January 2009 - 10:57 PM

QUOTE (HazardX @ Jan 25 2009, 19:45)
NEW VERSION:

GTAIV .Net Script Hook v0.80 BETA

Changes in Version 0.80 BETA:
- added support for game version 1.0.2.0 (thanks to aru)
- fixed several crashing problems in the constructor of scripts
- Improved performance alot (especially when accessing many objects)
- You can now call Wait() inside Startup() of your script
- It will now reject to load scripts in ranked Multiplayer. thanks to C06alt for the great idea!
- Added basic Object and Animation support
- Added a script example that uses an external configuration file. thanks to CoMPMStR for the idea!
- Added a script example that'll make you smoke a spliff. wink.gif thanks to iriedreadlock23 for the infos!
- Added a script example that syncs ingame time with realtime
- Improved existing examples
- some minor renames again
- Added more functions, tasks and a bit of everything


Animation example:
CODE
     Player.Character.Animation.Play(anims, "create_spliff", animflags)
     Wait(1600)

     spliff = World.CreateObject(&HD130ADEF, Player.Character.Position)
     spliff.AttachToPed(Player.Character, Bone.RightHand, New Vector3(0.14F, 0.03F, 0.04F), New Vector3(2.21F, -0.12F, 0.0F))

     Player.Character.Animation.WaitUntilFinished(anims, "create_spliff")



@SlingShotUK : Thanks, i really appreciate that! I'm pretty sure that you won't have much problems with .Net. It is really easy to learn and it is actually pretty hard to do something wrong. smile.gif
BTW: I absolutely LOVE your "You can't escape the law" video! Definately one of the best GTA4 videos ever!

Fantastic release HazardX.. I really want to check out the smoking example - that could be another great thing to use when making movies.

Love the examples you have added to this release - just what I need to get a handle on how this all works.

Just to check, you are essentially building an object orientated API to the game which makes use of all the natives without us having to call them directly. But, you have added support so that we can call any natives we want - even the ones you haven't built into objects so far? So using your hook I can experiment totally with all the natives the game has to offer?
I really like how you've built this.. Using easy to understand functions and objects makes total sense.. Nice way to model how the game works so it's easier and less error prone for us to create our mods.

Hey thanks for the comment on my movie - that totally made my night!! Really appreciate you taking the time to watch.

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#73

Posted 25 January 2009 - 11:36 PM

Just want to let you know, when I use Ped.IgnoreMinorShockingEvents = True it says there's an error with my script. If I take it out, everything works fine.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#74

Posted 25 January 2009 - 11:41 PM Edited by HazardX, 26 January 2009 - 12:58 AM.

QUOTE (CoMPMStR @ Jan 26 2009, 00:36)
Just want to let you know, when I use Ped.IgnoreMinorShockingEvents = True it says there's an error with my script. If I take it out, everything works fine.

Thanks, i'll look into it. Many included functions are untested, because it is almost impossible to test them all myself. Thus it may happen that some of them do not work as expected or may lead to an error.

@SlingShotUK: Yes, this is correct. The .Net philosophy is to have a pure object oriented and typesafe programming environment. all functions are exposed by easy to understand and intutivly named objects. every function should be usable as soon as you are able to call it (ie. by retieving an object) without the need to think about any other preconditions on your side. the framework takes care of all required steps for you. if a function that is exposed by an object can not be called at this state (and thus breaks this rule) it has to throw an exception, which clearly points out why this operation is not possible at the moment. Visual Studio, in addition, informs you about errors that are sure to cause an exception right as you type the code. It also provides live information of what methods an object contains, as soon as you try to access the contained methods of an object. Thus you don't need to learn the language or the class structure, since the environment itself will tell you what you can do and how you have to do it. as said, it is very hard to make errors in dotnet. smile.gif
you are also correct about the ability to call the native script functions. I've implemented a way to call all native functions directly (even those unimplemented by me). It automatically converts all of the included object classes and all standard value types into the format required by the game. you basically just need to call the native with the correct parameters and the framework will do the rest for you. You just need to privide the correct parameters, as the framework has no way to figure them out by itself.

KewlAzMe
  • KewlAzMe

    Player Hater

  • Members
  • Joined: 01 Jul 2005

#75

Posted 26 January 2009 - 12:59 AM

Well i had the crashing problem with the dsound.dll loader. Now using the xliveless version, which doesn't crash. But the bodyguard script still not working.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#76

Posted 26 January 2009 - 01:09 AM

QUOTE (KewlAzMe @ Jan 26 2009, 01:59)
Well i had the crashing problem with the dsound.dll loader. Now using the xliveless version, which doesn't crash. But the bodyguard script still not working.

The script is in the "scripts" subfolder? strange. Is a "ScriptHookDotNet.log" file in the same folder as the "ScriptHookDotNet.asi"? If yes, what does it contain?

SlingShotUK
  • SlingShotUK

    GTA Collector and fan since 2001

  • Members
  • Joined: 20 Nov 2008

#77

Posted 26 January 2009 - 11:43 AM

QUOTE (HazardX @ Jan 25 2009, 23:41)
@SlingShotUK: Yes, this is correct. The .Net philosophy is to have a pure object oriented and typesafe programming environment. all functions are exposed by easy to understand and intutivly named objects. every function should be usable as soon as you are able to call it (ie. by retieving an object) without the need to think about any other preconditions on your side. the framework takes care of all required steps for you. if a function that is exposed by an object can not be called at this state (and thus breaks this rule) it has to throw an exception, which clearly points out why this operation is not possible at the moment. Visual Studio, in addition, informs you about errors that are sure to cause an exception right as you type the code. It also provides live information of what methods an object contains, as soon as you try to access the contained methods of an object. Thus you don't need to learn the language or the class structure, since the environment itself will tell you what you can do and how you have to do it. as said, it is very hard to make errors in dotnet. smile.gif
you are also correct about the ability to call the native script functions. I've implemented a way to call all native functions directly (even those unimplemented by me). It automatically converts all of the included object classes and all standard value types into the format required by the game. you basically just need to call the native with the correct parameters and the framework will do the rest for you. You just need to privide the correct parameters, as the framework has no way to figure them out by itself.

Excellent - thanks for the explanation HazardX. I installed Visual Studio Express C# last night and it seems quite straight forward - I do like the code completion functionality.
The way you have built it looks well thought out and user friendly, although the main problem is obviously learning how it all fits together and the correct way to call functions, setting up data structures etc.. But that's the fun I suppose.. wink.gif

I just looked at the spliff smoking example and just about get it. I assume that some of those calls were found by looking at mission scripts? The AttachToPed method which passes in some vectors would be pretty hard to find through experimentation I'd think. Am I right in thinking that timer.Start() will call the Tick() method after the time specified in the 'Interval' variable setup in the Startup() method? If you didn't have a Tick() method in your class I assume the default Tick() method would be called in your code? I'm assuming that is what the 'override' keywod does - takes over from any top level methods via inheritence?
Once tick() is called you then have to start the timer again or it will end?

Do you think there is any chance you could get a forum setup for this excellent mod?

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#78

Posted 26 January 2009 - 12:02 PM Edited by HazardX, 26 January 2009 - 12:12 PM.

QUOTE (SlingShotUK @ Jan 26 2009, 12:43)
I just looked at the spliff smoking example and just about get it. I assume that some of those calls were found by looking at mission scripts? The AttachToPed method which passes in some vectors would be pretty hard to find through experimentation I'd think. Am I right in thinking that timer.Start() will call the Tick() method after the time specified in the 'Interval' variable setup in the Startup() method? If you didn't have a Tick() method in your class I assume the default Tick() method would be called in your code? I'm assuming that is what the 'override' keywod does - takes over from any top level methods via inheritence?
Once tick() is called you then have to start the timer again or it will end?


Yes, i spent quite some time looking through decompiled scripts of the game. I guess the developers had some external or ingame tool that allows them to position two object in relation to each other, to get the desired offset and rotation values without "trail and error".

The scripts are indeed derived from a class called "Script". My tool looks for those classes and starts new instances of them. Then it will call methods of the script like Startup() or Tick(). The "override" is required to make sure that your code gets executed when my tool calls the method of the base class.
The Tick() method will always be called in the given interval. This is done by my tool and does not involve the "timer" seen in this example.
The timer is not part of the default script class. On the line "GTA.Timer timer = new GTA.Timer();" i define a new variable of class "GTA.Timer". This timer is a very simple class and provides only the Start and ElapsedTime methods. ElapsedTime always returns the elapsed time since Start was called the last time. It is helpful if you want to measure a timespan that differs from the script interval.

QUOTE (SlingShotUK @ Jan 26 2009, 12:43)
Do you think there is any chance you could get a forum setup for this excellent mod?


Yes, i could. At the moment the amount of questions and discussion doen't seem to require an own forum. Don't fear to clutter this thread. Just ask your questions and post your code examples if you wish to, as this is was the thread is made for.

hristi
  • hristi

    Square Civilian

  • Members
  • Joined: 03 Jan 2009

#79

Posted 26 January 2009 - 01:05 PM

It gives me the R6030 error. I hope you will fix it soon. colgate.gif

SlingShotUK
  • SlingShotUK

    GTA Collector and fan since 2001

  • Members
  • Joined: 20 Nov 2008

#80

Posted 26 January 2009 - 01:06 PM

QUOTE (HazardX @ Jan 26 2009, 12:02)
Yes, i spent quite some time looking through decompiled scripts of the game. I guess the developers had some external or ingame tool that allows them to position two object in relation to each other, to get the desired offset and rotation values without "trail and error".

The scripts are indeed derived from a class called "Script". My tool looks for those classes and starts new instances of them. Then it will call methods of the script like Startup() or Tick(). The "override" is required to make sure that your code gets executed when my tool calls the method of the base class.
The Tick() method will always be called in the given interval. This is done by my tool and does not involve the "timer" seen in this example.
The timer is not part of the default script class. On the line "GTA.Timer timer = new GTA.Timer();" i define a new variable of class "GTA.Timer". This timer is a very simple class and provides only the Start and ElapsedTime methods. ElapsedTime always returns the elapsed time since Start was called the last time. It is helpful if you want to measure a timespan that differs from the script interval.

QUOTE (SlingShotUK @ Jan 26 2009, 12:43)
Do you think there is any chance you could get a forum setup for this excellent mod?


Yes, i could. At the moment the amount of questions and discussion doen't seem to require an own forum. Don't fear to clutter this thread. Just ask your questions and post your code examples if you wish to, as this is was the thread is made for.

Aha I see. Thanks for explaining Tick(). When I first looked at your code I wasn't sure how this was invoked but assumed it was probably a base mechanism. Sorry for lots of questions - which I'm bound to have more of in future. smile.gif I just find that I'm one of those developers who has to know what is going on under the surface to be able to get confident in the environment I'm working in.

It's incredibly exciting though.. The potential of what this opens up is immence.. The only thing I feel at the moment is that there doesn't seem to be a central resource that clearly documents how to do everything that has been discovered so far. I know there are wiki's showing functions and potential params but it would be great to be able to look up the elements we know 100% about to get quick information on how to make them work programmatically. I'm sure things will become clearer for me when I actually start playing though. wink.gif

One thing I was going to ask is whether it would be possible to develop some kind of development console for the game. A way to be able to issue commands directly while playing just for experimentation purposes. I.E You declare a ped, then call ped.die() while in game so you can see what happens? I imagine this is probably very very hard to achieve though.
When experiementing, do you have a test script that you keep editing and then restarting to game to get it to reload?

Any advice on the best way to test the scripts would be greatly appreciated.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#81

Posted 26 January 2009 - 01:24 PM

QUOTE (SlingShotUK @ Jan 26 2009, 14:06)
One thing I was going to ask is whether it would be possible to develop some kind of development console for the game. A way to be able to issue commands directly while playing just for experimentation purposes. I.E You declare a ped, then call ped.die() while in game so you can see what happens? I imagine this is probably very very hard to achieve though.
When experiementing, do you have a test script that you keep editing and then restarting to game to get it to reload?

Any advice on the best way to test the scripts would be greatly appreciated.

I would love to include a console. I already had some thoughts about it, but i'm not yet sure how to best parse the input. Another problem is that i'm not able to block the input of scripts not written in .Net. they might execute stuff while writing to the console.

Testing the scripts requires indeed to restart the game. confused.gif The problem is that .Net code once loaded to memory has to remain there. Thus loading all scripts to memory again on every ingame load would clutter the game memory. But i don't want to waste one hotkey just for reloading. And reloading is just possible for plain scripts (*.vb or *.cs) in the "scripts" folder, not for compiled DLLs. I'll think about it, to have something ready for the next version.

To get the game to start faster, i use a mod that remvoes the legal screens and additionally start the game with the following parameters, to shorten loading times ALOT:
CODE
LaunchGTAIV.exe -windowed -height 600 -width 800 -renderquality 0 -shadowdensity 0 -texturequality 0 -novblank

SlingShotUK
  • SlingShotUK

    GTA Collector and fan since 2001

  • Members
  • Joined: 20 Nov 2008

#82

Posted 26 January 2009 - 01:45 PM

QUOTE (HazardX @ Jan 26 2009, 13:24)
QUOTE (SlingShotUK @ Jan 26 2009, 14:06)
One thing I was going to ask is whether it would be possible to develop some kind of development console for the game. A way to be able to issue commands directly while playing just for experimentation purposes. I.E You declare a ped, then call ped.die() while in game so you can see what happens? I imagine this is probably very very hard to achieve though.
When experiementing, do you have a test script that you keep editing and then restarting to game to get it to reload?

Any advice on the best way to test the scripts would be greatly appreciated.

I would love to include a console. I already had some thoughts about it, but i'm not yet sure how to best parse the input. Another problem is that i'm not able to block the input of scripts not written in .Net. they might execute stuff while writing to the console.

Testing the scripts requires indeed to restart the game. confused.gif The problem is that .Net code once loaded to memory has to remain there. Thus loading all scripts to memory again on every ingame load would clutter the game memory. But i don't want to waste one hotkey just for reloading. And reloading is just possible for plain scripts (*.vb or *.cs) in the "scripts" folder, not for compiled DLLs. I'll think about it, to have something ready for the next version.

To get the game to start faster, i use a mod that remvoes the legal screens and additionally start the game with the following parameters, to shorten loading times ALOT:
CODE
LaunchGTAIV.exe -windowed -height 600 -width 800 -renderquality 0 -shadowdensity 0 -texturequality 0 -novblank

Aha, that's a clever idea!

So when you first developed this it must have been a very long process to test things out wasn't it?
I know when I'm developing complex web applications that you can 100% guarantee that almost every change made to a script will result in an error.. heh. Although it's just a simple CTRL-R to see the effect of the change - not a total reload of the browser. smile.gif

I imagine the built in validation in VS takes care of a lot of the obvious errors in coding.. But still.. It's got to be a frustrating process at times.. I suppose throwing in text outputs must help debugging.. E.G: text.output("Before call to ped die function").. type of thing..


hristi
  • hristi

    Square Civilian

  • Members
  • Joined: 03 Jan 2009

#83

Posted 27 January 2009 - 01:31 PM

Please help! It's doesn't work for me..
I use the newest XLiveLess.
here's what my ScriptHookDotNet.log says file:

2009-01-27 21:27:07 - Initializing ScriptHookDotNet v0.73 BETA

2009-01-27 21:27:07 - SEARCHING FOR SCRIPTS...
2009-01-27 21:27:07 - Unable to load Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\_PUT .NET SCRIPTS HERE': System.BadImageFormatException: Could not load file or assembly 'file:///E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\_PUT .NET SCRIPTS HERE' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\_PUT .NET SCRIPTS HERE'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at GTA.ScriptManager.LoadAssembly(String filename)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

2009-01-27 21:27:07 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Handheld Teleport Device Script By CoMPMStR.net.dll' ...
2009-01-27 21:27:07 - ...found script 'HandheldTeleportDeviceScript.CoMPMStR0'!
2009-01-27 21:27:07 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Mega SuperJump Script By CoMPMStR.net.dll' ...
2009-01-27 21:27:07 - ...found script 'MegaSuperJumpScript.CoMPMStR0'!
2009-01-27 21:27:07 - DONE! 2 valid scripts found!

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#84

Posted 27 January 2009 - 01:35 PM

QUOTE (hristi @ Jan 27 2009, 14:31)
here's what my ScriptHookDotNet.log says file:

2009-01-27 21:27:07 - Initializing ScriptHookDotNet v0.73 BETA

You are using the old version 0.73, please download the new one.

Otaconmgs
  • Otaconmgs

    Player Hater

  • Members
  • Joined: 27 Jan 2009

#85

Posted 27 January 2009 - 01:36 PM

The .net scripthook has never worked for me. I keep getting a runtime error like this:



Runtime Error!

Program: C:...

R6030
-CRT not initialized



I have .net framework 3.5 SP1
and I code C++ with MS-Visual Studio 2008

I don't believe i'm missing anything, so why is it doing this? I have searched google for the error and other people have gotten it for other reasons. Has anyone else had this error?

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#86

Posted 27 January 2009 - 01:45 PM

QUOTE (Otaconmgs @ Jan 27 2009, 14:36)
The .net scripthook has never worked for me. I keep getting a runtime error like this:


R6030
-CRT not initialized

This is a problem with the new AsiLoader from Alexander. It refuses to load DLLs required by the .Net ScriptHook. The AsiLoader of XliveLess works correct.

hristi
  • hristi

    Square Civilian

  • Members
  • Joined: 03 Jan 2009

#87

Posted 27 January 2009 - 02:22 PM

QUOTE (HazardX @ Jan 27 2009, 13:35)
QUOTE (hristi @ Jan 27 2009, 14:31)
here's what my ScriptHookDotNet.log says file:

2009-01-27 21:27:07 - Initializing ScriptHookDotNet v0.73 BETA

You are using the old version 0.73, please download the new one.

I downloaded the new one but it's still not working..
here's what the log says in the gta4 root folder


2009-01-27 22:19:34 - Initializing ScriptHookDotNet v0.80 BETA

2009-01-27 22:19:34 - SEARCHING FOR SCRIPTS...
2009-01-27 22:19:34 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Handheld Teleport Device Script By CoMPMStR.net.dll' ...
2009-01-27 22:19:34 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Mega SuperJump Script By CoMPMStR.net.dll' ...
2009-01-27 22:19:34 - DONE! No DotNet script found!

2009-01-27 22:20:26 - STARTING SCRIPTS...

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#88

Posted 27 January 2009 - 02:29 PM Edited by HazardX, 27 January 2009 - 09:22 PM.

Don't miss the release of YAASIL - Yet Another ASI Loader ! It will run the .Net Scripthook without the R6030 problem. XliveLess does it correctly too.


QUOTE (hristi @ Jan 27 2009, 15:22)
I downloaded the new one but it's still not working..
here's what the log says in the gta4 root folder


2009-01-27 22:19:34 - Initializing ScriptHookDotNet v0.80 BETA

2009-01-27 22:19:34 - SEARCHING FOR SCRIPTS...
2009-01-27 22:19:34 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Handheld Teleport Device Script By CoMPMStR.net.dll' ...
2009-01-27 22:19:34 - Loading Assembly 'E:\Program Files\Rockstar Games\Grand Theft Auto IV\scripts\Mega SuperJump Script By CoMPMStR.net.dll' ...
2009-01-27 22:19:34 - DONE! No DotNet script found!

2009-01-27 22:20:26 - STARTING SCRIPTS...

It is loading those DLLs but has found no valid scripts. I guess those two DLLs were made for the old version. There are new versions of those scripts available, i guess. Get those new versions of "Mega SuperJump" and "Handheld Teleport Device" and it will work.

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#89

Posted 29 January 2009 - 06:21 AM

QUOTE (HazardX @ Jan 27 2009, 08:29)
There are new versions of those scripts available, i guess.

lol.gif Hehe.. you guess? You know I've already updated those scripts for the new scripthook.


I found some bugs though and I just want to make sure you know about them (or can set me straight).

Setting any value to Player.Group.SeperationRange causes bodyguards to stay idle. When they spawn they just stand in one spot and don't move.

Using Ped.WalkAwayAndDespawn causes script errors. When called it says there's an error with the script. This is what it says in the log file:
CODE
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
                        at GTA.Ped.WalkAwayAndDespawn()


Ped.Drunk doesn't cause peds to wobble as if they're drunk when set to true.

Setting Ped.FireDamageMultiplier to 0 doesn't make peds receive no damage from fire.

Vehicle.isOnFire doesn't set a vehicle on fire if set to true.

----------------------------
I was wondering if you could add the NoLongerNeeded sub to the model class, since there is a different NO_LONGER_NEEDED natived used for models. This way we can call Object.Model.NoLongerNeeded after we're done spawning the ped or vehicle, then call Object.NoLongerNeeded after we're completely done with the object.

I was also wondering if you could add a CurrentRoom property to the Vehicle class. I tried spawning a vehicle once when in the subway and it was invisible, but it was still there. And also, when setting Object.CurrentRoom to Player.Character.CurrentRoom the object still spawns invisibile inside, but outside it spawns visible.

brightemo
  • brightemo

    Player Hater

  • Members
  • Joined: 03 Jan 2009

#90

Posted 29 January 2009 - 02:15 PM

CODE

               using (StreamWriter writer = new StreamWriter(File.OpenWrite("C:\\gta.txt")))
               {
                   foreach (BlipType blipType in Enum.GetValues(typeof(BlipType)))
                   {
                       Blip[] blips = Blip.GetAllBlipsOfType(blipType);
                       foreach (Blip blip in blips)
                       {
                           writer.WriteLine(String.Format("Name: {0}", blip.Name));
                           writer.WriteLine(String.Format("Position: {0},{1},{2}", blip.Position.X, blip.Position.Y, blip.Position.Z));
                           writer.WriteLine(String.Format("Street: {0}", World.GetStreetName(blip.Position)));
                           writer.WriteLine(String.Format("Type: {0}", blipType));
                           writer.WriteLine(String.Format("Icon: {0}", blip.Icon));
                           writer.WriteLine(String.Format("Colour: {0}", blip.Color));
                           writer.WriteLine(String.Format("Display: {0}", blip.Display));
                           writer.WriteLine(String.Format("Show Only When Near: {0}", blip.ShowOnlyWhenNear));
                           writer.WriteLine();
                       }
                   }
               }


Name: Player
Position: 0,0,0
Type: Pickup
Icon: Misc_Player
Colour: White
Display: 1
Show Only When Near: False

Name: North
Position: 0,0,0
Type: Unknown
Icon: Misc_North
Colour: White
Display: 1
Show Only When Near: False

Name: Waypoint
Position: 0,0,0
Type: Pickup2
Icon: Misc_Waypoint
Colour: White
Display: 1
Show Only When Near: False

The positions for these are all 0,0,0 and it seems to only get blips for the Player icon, the North icon and your way point destination icon (which is what I am after, but need the position).

Is there any work around / fixes planned?

Thanks




4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users