Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: RedBlob on Thu 02/04/2009 03:57:03

Title: Vista error (file related): Null pointer referenced
Post by: RedBlob on Thu 02/04/2009 03:57:03
Hi,

VISTA issue:

When trying to create a new data file while playing the game, the user gets the following error: Null pointer referenced

It seems to me that this version of AGS is unable to create a new file in the default directory.

Since my system is XP, I can't verify the solution as yet, but I was thinking of creating the data file upfont (ie, when the user install the game the file is already there) and then just updating the file. Hopefully that will work.

Another user just said that it crashes Vista and he had to downgrade to XP before he could play it...

Current:
AGS Editor .NET (Build 3.1.1.67)
v3.1.1, December 2008

Or is the only other option to upgrade to 3.1.2?

Any workarounds welcome.

Regards.
Title: Re: Vista error (file related): Null pointer referenced
Post by: GarageGothic on Thu 02/04/2009 04:04:50
You can use the "$SAVEGAMEDIR$" tag to direct the file functions to the savegame directory. If you've set up your game to use a subfolder of My Documents for savegames (which you should to ensure Vista compatibility), you should be able to read/write to any files there without Vista account control blocking you.
Title: Re: Vista error (file related): Null pointer referenced
Post by: RedBlob on Thu 02/04/2009 04:41:36
Thank you.
I will try that.
Regards.
Title: Re: Vista error (file related): Null pointer referenced
Post by: Pumaman on Thu 02/04/2009 17:58:56
Assuming you're using an installer to distribute your game, then Vista locks down the Program Files directory so you can't write to it.

The solution is to use the $SAVEGAMEDIR$ as GarageGothic suggests, though a workaround for people with the problem is for them to right-click the game EXE and choose "Run as Administrator".