Jump to content
Turbine1991

Trouble with find bitmap "Access violation at address ..."

Recommended Posts

I've come back to using SCAR after some while, but I'm having trouble with the latest stable release 3.37. I'll post a simplified "working" example below which will replicate this issue.

 

The error I am getting is:

"Access violation at address 00E40C82 in module 'scar.exe'. Read of address 00000000"

 

program PS2;

//
var
 x, y: LongInt;
 Enemy: TSCARBitmap;
begin
 Enemy := TSCARBitmap.Create('');
 Enemy.LoadFromBmp(ScreenPath + 'enemy1.bmp');
 FindBitmap(x, y, Enemy, 0, 0, 200, 200);
 Enemy.Free();
end.

 

The test project links, they are identical:

test.zip

https://dl.dropbox.com/u/46445390/test.zip

 

Is there something wrong with this code?

 

(Ignore the below attachment, it's looking in a sub folder)

test.zip

Link to comment
Share on other sites

Huh, your code is fine. But maybe try changing : LongInt to Integer? Also try getting rid of () in Enemy.Free

 

Other than that I have no idea. Try reinstalling SCAR Divi. And/or deleting the AppData folder for SCAR Divi. Which for windows 7 is located in...C:\Users\Your Username\Appdata .. then maybe Roaming folder or one of the others

Link to comment
Share on other sites

I changed x & y to LongInt after seeing the arguments take that kind, but I'll put it back.

 

It's a brand spanking new installation, I've also tried an older version from the SVN to see if it's anything to do with the new bitmap class.

 

Just tried those changes and the portable version, same issue.

 

Are there any dependencies that SCAR now uses?

Link to comment
Share on other sites

Well is your bitmap located in SCAR's screen path (SCAR's Screenshot folder)?

 

Try right clicking the file and seeing if it is blocked or has the right access privileges, and what not.

 

 

If you want to load a bitmap that is in the same folder as your script...use the ScriptPath constant SCAR has.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...