Turbine1991 Posted November 24, 2012 Share Posted November 24, 2012 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 Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 25, 2012 Share Posted November 25, 2012 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 Quote Link to comment Share on other sites More sharing options...
Turbine1991 Posted November 25, 2012 Author Share Posted November 25, 2012 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? Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 25, 2012 Share Posted November 25, 2012 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. Quote Link to comment Share on other sites More sharing options...
Turbine1991 Posted November 25, 2012 Author Share Posted November 25, 2012 Well is your bitmap located in SCAR's screen path (SCAR's Screenshot folder)? *Bows head in shame* You're right, I got mixed up between ScriptPath and ScreenPath, never actually noticed it was screen. Now I know this error can occur when a file does not exist. Thanks. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 25, 2012 Share Posted November 25, 2012 No problem. I didn't think that this was the problem because usually when someone zips a folder they give you all the files. But I guess it was in your case. Weird it gives an access violation though. Should really have a custom error for it maybe? Idk. Glad its fixed Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 25, 2012 Share Posted November 25, 2012 But maybe try changing : LongInt to Integer? LongInt = Integer Quote Link to comment Share on other sites More sharing options...