IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (146) « First ... 140 141 [142] 143 144 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [BETA] GTAIV .Net ScriptHook

 V1.6.1.1 Released 1.0.6.0 / EFLC Support
 
motorsport71  
Posted: Saturday, Feb 18 2012, 05:29
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



@MulleDK19
Thanks man, i appreciate it smile.gif
PM
  Top
 

 
Bloodhowl21  
Posted: Saturday, Feb 18 2012, 11:46
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Feb 18, 2012

XXXXX



Hi there! I have a question regarding ScriptHook , ASIloader , Xliveless etc. Do they all require an original copy of GTA 4? I'm new here and I'm sorry if this will offend you , but why is it only for the retail version? Thanks.
PM
  Top
 

 
AngryAmoeba  
Posted: Saturday, Feb 18 2012, 20:02
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



@Bloodhowl21
I don't know if it's against the rules to tell you this, but everything you mentioned works with illegal copies of the game.

This post has been edited by AngryAmoeba on Saturday, Feb 18 2012, 20:04
PM
  Top
 

 
daimyo21  
Posted: Thursday, Feb 23 2012, 07:20
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 16, 2011

XXXXX



So I just made my first script through a tutorial, I have looked at other peoples script to understand C# more yet I been having a universal problem.

I have the 0.4.0 Developer SDK and am thinking that this is the problem.

CODE
using GTA.base;


puts a red line under base even though I have included the scripthookdotnet in the references...
everytime I use base.Blah.Blah.Blah it says unidentified error: 'base' is not a keyword

when I type using GTA. (it brings up all the options and base is @base, which doesnt work).



Any thoughts? Is there a later developer kit?

Much help would be greatly appreciated.


EDIT: Just referenced the latest one (not 0.4.0)

The one from this thread in "For Developers" folder and GTA.base is still showing up as error

This post has been edited by daimyo21 on Thursday, Feb 23 2012, 08:05
PM
  Top
 

 
AngryAmoeba  
Posted: Thursday, Feb 23 2012, 19:42
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



Sorry for my ignorance, but what is GTA.base? What do you need it for?
PM
  Top
 

 
Threepwood  
Posted: Thursday, Mar 29 2012, 12:43
Quote Post


Calm like a bomb.
Group Icon
Group: Members
Joined: Jul 13, 2008

XXXXX



Since cutscenes support it, the game might support it as well: Do we have removing car parts covered (hood, bumper, etc) in C# or C++ yet? Or is there a native?
PM
  Top
 

 
motorsport71  
Posted: Sunday, Apr 1 2012, 06:07
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



Hey all, i have questions about "gta.nonexistingobjectexception: Invalid call to an object that doesn't exist anymore", specifically during during "gta.ped.get.position".

My mods run most frequently either
CODE
world.getpeds()
or
CODE
world.getallpeds()

Now i've discovered that if you try to used them in conjunction throughout a same script it will flag the error, generally quickly, so it's best to stay with just one or the other. Then it can last a long while.

Now for the question...

So for the Mod i have out right now it is set to run on a 225 ms interval. I always use
CODE
If exists(ped) then
to try to stop any errors, but they still creep up.

Technically on each interval isn't SHDN looking for a pedestrian that it seen last interval? So if the pedestrian was a mission ped, the tick happened, that ped was deleted within the script, and the next tick it looks for them again, does / can that cause the error?

If the game "skipped", or a background operation such as an antivirus update kicks on, can that cause it?

Can SHDN be getting "Clogged up", or too much information causing it to get "Bottlenecked"?

Since my mod is "world.getpeds()" so frequently, is there a way to "ignore" the error, write past past it, so that the error doesn't pop up and the entire mod doesn't stop because it looses track of maybe one wayward pedestrian off in the distance for one tick?
PM
  Top
 

 
Prof_Farnsworth  
Posted: Monday, Apr 2 2012, 03:17
Quote Post


Ambient Modder
Group Icon
Group: Members
Joined: Feb 25, 2011

XXXXX



QUOTE (motorsport71 @ Sunday, Apr 1 2012, 06:07)
Hey all, i have questions about "gta.nonexistingobjectexception:  Invalid call to an object that doesn't exist anymore", specifically during during "gta.ped.get.position".

My mods run most frequently either
CODE
world.getpeds()
or
CODE
world.getallpeds()

Now i've discovered that if you try to used them in conjunction throughout a same script it will flag the error, generally quickly, so it's best to stay with just one or the other.  Then it can last a long while. 

Now for the question...

So for the Mod i have out right now it is set to run on a 225 ms interval.  I always use
CODE
If exists(ped) then
to try to stop any errors, but they still creep up.

Technically on each interval isn't SHDN looking for a pedestrian that it seen last interval?  So if the pedestrian was a mission ped, the tick happened, that ped was deleted within the script, and the next tick it looks for them again, does / can that cause the error?

If the game "skipped", or a background operation such as an antivirus update kicks on, can that cause it?

Can SHDN be getting "Clogged up", or too much information causing it to get "Bottlenecked"? 

Since my mod is "world.getpeds()" so frequently, is there a way to "ignore" the error, write past past it, so that the error doesn't pop up and the entire mod doesn't stop because it looses track of maybe one wayward pedestrian off in the distance for one tick?

Best thing I can recommend is to make sure you have "Exists" checks on everything you are using. Even if you use "And" or "Or" in your statements, have a check in each of the conditions. Also, when done with a ped or vehicle, I recommend using "ped/vehicle.NoLongerNeeded();" so the game does not keep track of it longer than it needs to, and can erase it if need be.

In my Fire Dept. mod, that error was the bane of my existence due to the randomness of exploding vehicles, traffic, etc. I literally have checks everywhere to make sure something exists.
PM
  Top
 

 
AngryAmoeba  
Posted: Tuesday, Apr 3 2012, 01:27
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



This is bad practice, but here's what I do to ignore the NonExistingObjectException errors from GetPeds(). I usually use C#, so forgive me if this VB.NET code isn't quite right...
CODE
' Declare pedArray as an empty array, in case GetPeds() fails.
Dim pedArray() = New Ped() { }

' Use a try-catch to handle the exception without crashing.
Try
   pedArray = GTA.World.GetPeds(centerPosition, range)
Catch ex As NonExistingObjectException
   Dim errorMsg As String = ex.Message
   ' You can do something with this error message, like print it to the console
   ' or write it to a file. For public releases, I just leave it like this, so
   ' that it's ignored.
End Try

' If GetPeds() failed, then pedArray remains empty and this loop will do nothing.
For Each p As Ped In pedArray
   If Not Exists(p)
       Continue
   ' Do stuff for each ped
Next

Note: This technique works in C#, but VB might crash at the for-each loop when pedArray is empty. If so, just declare pedArray with "Dim pedArray() As Ped" instead, and then after the try-catch, make sure pedArray "Is Not Nothing".

@Prof_Farnsworth
In my mods, I make sure peds/vehicles exist just once per function. I don't think the game actually continues to do stuff while your script is executing, because if you do a long, intensive calculation, the game "freezes" each time your script executes, causing stuttering/lag. To me, this indicates that the game can't continue to process other stuff until your script is done — then game stuff executes, then your script executes again, then game stuff executes again, etc. etc. If I'm wrong, someone please tell me!

P.S. The above is assuming you haven't used Wait(). If your script waits, then a ped might not exist anymore after it's done waiting.

This post has been edited by AngryAmoeba on Tuesday, Apr 3 2012, 02:11
PM
  Top
 

 
Prof_Farnsworth  
Posted: Tuesday, Apr 3 2012, 02:28
Quote Post


Ambient Modder
Group Icon
Group: Members
Joined: Feb 25, 2011

XXXXX



QUOTE (AngryAmoeba @ Tuesday, Apr 3 2012, 01:27)
This is bad practice, but here's what I do to ignore the NonExistingObjectException errors from GetPeds(). I usually use C#, so forgive me if this VB.NET code isn't quite right...
CODE
' Declare pedArray as an empty array, in case GetPeds() fails.
Dim pedArray() = New Ped() { }

' Use a try-catch to handle the exception without crashing.
Try
   pedArray = GTA.World.GetPeds(centerPosition, range)
Catch ex As NonExistingObjectException
   Dim errorMsg As String = ex.Message
   ' You can do something with this error message, like print it to the console
   ' or write it to a file. For public releases, I just leave it like this, so
   ' that it's ignored.
End Try

' If GetPeds() failed, then pedArray remains empty and this loop will do nothing.
For Each p As Ped In pedArray
   If Not Exists(p)
       Continue
   ' Do stuff for each ped
Next

Note: This technique works in C#, but VB might crash at the for-each loop when pedArray is empty. If so, just declare pedArray with "Dim pedArray() As Ped" instead, and then after the try-catch, make sure pedArray "Is Not Nothing".

@Prof_Farnsworth
In my mods, I make sure peds/vehicles exist just once per function. I don't think the game actually continues to do stuff while your script is executing, because if you do a long, intensive calculation, the game "freezes" each time your script executes, causing stuttering/lag. To me, this indicates that the game can't continue to process other stuff until your script is done — then game stuff executes, then your script executes again, then game stuff executes again, etc. etc. If I'm wrong, someone please tell me!

P.S. The above is assuming you haven't used Wait(). If your script waits, then a ped might not exist anymore after it's done waiting.

@Angry - I was getting errors inside "if" statements that already checked if the ped existed, then used them. However, I also use a fair amount of "Wait's" in my code.
PM
  Top
 

 
motorsport71  
Posted: Tuesday, Apr 3 2012, 14:01
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



@AngryAmoeba
I appreciate that. I recently found and example that is using "Is Not Nothing" during each call in the pedarray() so now it's looking a lot like this:
CODE
Dim peds as ped() = world.getpeds(player.character.position, 100.0)
for each ped as ped in peds
if exists(ped) andalso ped Is Not Nothing then
     **ped assignments / values
end if
next


I would just previously use "If exists(ped)", but adding the "Is Not Nothing" seems to have made it much more stable as suggested so you are definately correct there. Very stable.

I will also keep the write around technique in mind if i cannot get the secondary part of my script, the more resource intensive one, to remain stable. Thanks again.

@Prof_Farnsworth
I also went through the entire script and added the checks as you suggested, but i used the above mentioned "Is Not Nothing" in vehiclearray() as well. As you suggested, it helps a ton.

Thanks Guys!
PM
  Top
 

 
TechnoKuchen  
Posted: Tuesday, Apr 3 2012, 21:40
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 9, 2011

pl.gif

XXXXX



omg
Please Help me
ScriptHookDoTnet.asi
NEVER Works -.- The game just doesn't turns on , nothing shows up
Game nevers starts
Win 7 /game Patch 7 tryed several Scripthook.dll's
Never works
And if i remove the ScripthookdotNET.asi, the game works fine cry.gif
Someone has a idea why ? suicidal.gif

This post has been edited by TechnoKuchen on Wednesday, Apr 4 2012, 09:28
PMXbox Live
  Top
 

 
AngryAmoeba  
Posted: Wednesday, Apr 4 2012, 00:39
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



QUOTE (motorsport71 @ Tuesday, Apr 3 2012, 08:01)
@AngryAmoeba
I appreciate that.  I recently found and example that is using "Is Not Nothing" during each call in the pedarray() so now it's looking a lot like this:
CODE
Dim peds as ped() = world.getpeds(player.character.position, 100.0)
for each ped as ped in peds
if exists(ped) andalso ped Is Not Nothing then
     **ped assignments / values
end if
next


I would just previously use "If exists(ped)", but adding the "Is Not Nothing" seems to have made it much more stable as suggested so you are definately correct there.  Very stable.

Actually, Exists() already includes the "Is Not Nothing" check, so you don't need to do it again after using Exists().

Edit: Exists() is equivalent to "object IsNot null AndAlso object.Exists()". I just did some reading on VB.NET, and it turns out 'null' is not the same as 'Nothing', so what I said might be wrong. I guess my best advice, really, is just to use C# instead. It's less confusing! tounge.gif

For me, the NonExistingObjectException is not a problem in the for-each loop, but in the "pedArray = World.GetPeds(center, range)" statement. That's why I recommended putting it inside a try-catch.

This post has been edited by AngryAmoeba on Wednesday, Apr 4 2012, 01:12
PM
  Top
 

 
mccahon  
Posted: Sunday, Apr 8 2012, 22:13
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Apr 7, 2012

XXXXX



Alright why can I install this into GTA on one PC and it loads scripts fine, but on my brothers PC only asi loader works and ignores this asi script, therefore no .net scripts are loaded. Same GTA version and everything. Seriously help please.
PM
  Top
 

 
motorsport71  
Posted: Monday, Apr 9 2012, 02:18
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



@mccahon
troubleshooting: .net scripthook
Do you have ScriptHookDotNet and ScriptHook from this file: They go into your main directory.

http://dl.hazardx.com/83

Do you have c++ 2000 redistributable installed? Get it here:

http://www.microsoft.com/downloads/details...23-37bf0912db84

Do you have .net framework 4 installed? Get it here:

http://www.microsoft.com/downloads/details...9f-b21f31ab88b7

Then did you make a folder named "scripts" and place the .net and / or .ini files in it you intend to use when you're done?

Those are all common questions / links / answers i get / give with my .net mods.
This is straight from the first page of this forum, some information anyway.
PM
  Top
 

 
Threepwood  
Posted: Monday, Apr 9 2012, 09:02
Quote Post


Calm like a bomb.
Group Icon
Group: Members
Joined: Jul 13, 2008

XXXXX



Anyone ever tried
CODE

                       GTA.Native.Function.Call("SUPPRESS_CAR_MODEL", mCar);

? Any hints on that?
PM
  Top
 

 
thaCURSEDpie  
Posted: Monday, Apr 9 2012, 14:22
Quote Post


GTA:IV scripter
Group Icon
Group: Members
Joined: Jul 1, 2007

XXXXX



QUOTE (Threepwood @ Monday, Apr 9 2012, 09:02)
Anyone ever tried
CODE

                       GTA.Native.Function.Call("SUPPRESS_CAR_MODEL", mCar);

? Any hints on that?

Nope. Why don't you try it yourself? smile.gif
PM
  Top
 

 
Threepwood  
Posted: Monday, Apr 9 2012, 14:48
Quote Post


Calm like a bomb.
Group Icon
Group: Members
Joined: Jul 13, 2008

XXXXX



I did, and it works pretty well. But since the GTA Wiki lists it pretty empty, I had hopes someone else yet uses it, because there could be additional options or flags.
So far, this stub works, while mCar is just the vehicle hash as int32. Nice addition/alternative to an IDE flag for not having the actual driven car in traffic. Like romans taxi.
PM
  Top
 

 
motorsport71  
Posted: Tuesday, Apr 10 2012, 04:56
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



When using
CODE
World.CreatePed()

and using
CODE
Ped.BecomeMissionCharacter()

to keep up a large group of mission peds, say approximately 35, and I have the script constantly replace "dead" or "nolongerneeded" peds:

Why is it that after around 100+ mission peds have been replaced they begin to spawn like a "statue" or "solid", with no brain and completely invulnerable?

Also, what can be done to prevent that? I need the pedestrian to remain a mission character to get the tasks and actions necessary, so if i nolonger want to use a ped is it better to at the desired distance "delete" the ped or go with "nolongerneeded" if it's a mission ped? Does one over the other leave a "memory leak" i believe it may be referred to?

@AngryAmoeba
I've been running the "if exists(x) andalso x isnot nothing" and though it looks confusing as you mentioned, it works quite well biggrin.gif I know it would be smart of me to look into c#, but i'm not a coder and v.b. "looked" easier to understand as i looked over the two when i decided to try to code my first .net script.
PM
  Top
 

 
CoSm1c gAm3r  
Posted: Friday, Apr 13 2012, 05:19
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Mar 27, 2012

pl.gif

XXXXX



When "ScriptHookDotNet.asi" is in main folder then game wont run. If I delete it then game runs but only one script is running. It is SpeedometerIVv03a.

Edit:
Somehow I managed to run game with "ScriptHookDotNet.asi" in main folder. But still scripts didnt work. But then I added file "XliveProtectDisabler.asi" and I think that this helped because scripts in SCRIPTS folder worked when I run game. So problem solved.

This post has been edited by CoSm1c gAm3r on Friday, Apr 13 2012, 19:10
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (146) « First ... 140 141 [142] 143 144 ... Last »

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG