"Memory access violation"?

Blitz3D Forums/Blitz3D Beginners Area/"Memory access violation"?

Hybird(Posted 2004) [#1]
I'm not sure if it's a problem with my computer, but I get this error popping up all the time when I want to open up programs specifically made by Blitz 3D. Any suggestions how I can fix this?

Thanks! :)


N(Posted 2004) [#2]
A MAV ('memory access violation') is usually caused when the programmer who wrote the program made a mistake.

Try this, for instance, without debug mode on:

Graphics3D 320,240,32,2
EntityTexture NotAnEntity,0,0,0



Ice9(Posted 2004) [#3]
If you are running the program from the checkout folder of a zip file then it is running the program in the shortcut folder. Right click on the blitz executable shortcut and click the find target button and run the executable directly ... not from the shortcut. The executable can't
find a file it's trying to load like an image, sound or loadable mesh file.


jhocking(Posted 2004) [#4]
A Memory Access Violation occurs when the program attempts to use something which does not actually exist. In Noel's example, the code attempts to call the EntityTexture command on an area of memory which is not actually an entity, causing a MAV (actually, I don't know if the MAV will happen because of another error due to the incorrect syntax used for the command.) Calling commands on entities which don't exist is the most common cause of MAVs, but other common sources of MAVs include referring to images and sounds which don't exist.


thehawk2323(Posted 2013) [#5]
I get the same error but I dont see what the problem is.

----------------------------------------
Graphics3D 640,480
SetBuffer BackBuffer()

camera=CreateCamera()

light=CreateLight()
RotateEntity light,90,0,0


gun=LoadMD2( "heh.md2" )


tex=LoadTexture( "aa.bmp" )


EntityTexture gun,tex


PositionEntity gun,0,-45,100
RotateEntity gun,0,180,0

While Not KeyDown( 1 )
UpdateWorld
RenderWorld
Flip
Wend

End
--------------------------------------


RemiD(Posted 2013) [#6]
Try to add this line of code each time you load an external file :
gun = LoadMD2("heh.md2" )
If(gun = 0)
 RuntimeError("gun file has not been loaded")
Endif


or this code : http://www.blitzbasic.com/codearcs/codearcs.php?code=2975