Okay, youl'll get your christmas present one day early. If you feel traditional don't open the archive until christmas eve.
NEW VERSION:GTAIV .Net Script Hook v220.127.116.11 BETA
Changes in v18.104.22.168 BETA:
- Fixed Blip.Delete always causing an exception.
- Added Vehicle.LightsOn property to determine whether the front lights are turned on. (by LMS)
- Changed Vehicle.FixTire to also restore the correct tire model. (by LMS)
- Some more NonExistingObjectException checks.
[EDIT] On the topic of NonExistingObjectExceptions: Injecting code into a game is always a nasty and sometimes very instable thing to do. GTA4 has proven to be especially bitchy in several ways. There has always been many problems with objects dying off inexpectedly, be it due to the lack of checks in the script code or due to some sneaky actions of the game itself. This led to some very strange behavior and confusing sporadic error messages. The new NonExistingObject checks make sure that every object being used in your code is checked for it's existence once
when it is first accessed each frame
. This way the hook can determine situations that would have previously caused a serious mess-up and throw a NonExistingObjectException instead.
You should always make regular use of Exists() to check for object existence. But if you can't seem to get smooth results without NonExistingObjectExceptions being thrown occasionally then you should wrap up logical blocks of your code into try blocks that catch only NonExistingObjectExceptions. If any object inside the block dies off inexpectedly the try block will catch it and the script can continue to run after the block.
Edited by HazardX, 23 December 2010 - 04:00 PM.