ERROR! :(

Blitz3D Forums/Blitz3D Beginners Area/ERROR! :(

Blitz3dCoder(Posted 2007) [#1]
Can somebody kindly explain what all of the error messages that come up mean.

Like:
Duplicate Variable name
;Graphics
Graphics3D 800,600
SetBuffer BackBuffer()
;Light
Global light=CreateLight()
RotateEntity light, 90,0,0

;Camera Pivot
camera_pivot=CreatePivot()
EntityRadius camera_pivot,1.4
EntityType camera_pivot, PLAYER

;Collision Group
Global SCENERY=1
Global PLAYER=2

;Camera
Global camera=CreateCamera(camera_pivot)
CameraRange camera,1,1000
CameraFogMode camera,1
CameraFogRange camera, 60,200
PositionEntity camera_pivot,0,10,120

;Sky
Global sky=CreateSphere(16,camera_pivot)
FlipMesh sky
ScaleEntity sky,100,100,100
PositionEntity sky,0,50,0
sky_tex=LoadTexture("sky.bmp")
EntityTexture sky,sky_tex

;TERRAIN
Global terrain=LoadTerrain("height2.jpg")
TerrainDetail terrain,2500,True
ScaleEntity terrain,-1000,0,-530
ter_tex=LoadTexture("mossyground.bmp")
EntityTexture terrain,ter_tex
EntityRadius terrain,0.2
EntityType terrain,SCENERY


;Main Loop 
While Not KeyHit(1)
If KeyDown(200)MoveEntity camera_pivot,0,0,0.05
If KeyDown(208)MoveEntity camera_pivot,0,0,-0.05
If KeyDown(203)TurnEntity camera_pivot,0,2,0
If KeyDown(205)TurnEntity camera_pivot,0,-2,0

UpdateWorld 
RenderWorld
Flip

Wend 

End 


Memory Access Violation
; Game
; ---------------------




AppTitle "Game"
Graphics3D 1024,768,32,2
SetBuffer BackBuffer()




;Types
Player=1
Obstacle=2
Ground=3


;------------------------------------------
cam1=CreateCamera()
PositionEntity cam1,18,6,-148
EntityType cam1, Player

lite1=CreateLight(1)
 


player=CreateCone()
PositionEntity player,12,5,-114








;Creating the sky--------------------------
sky = CreateSphere(60)
FlipMesh sky
ScaleEntity sky,700,700,700
PositionEntity sky, 0,70,0
sky_tex = LoadTexture ( "sky.bmp" )
EntityTexture sky,sky_tex
;-----------------------------------------



;Making water
water_tex=LoadTexture( "water1.jpg" )
ScaleTexture water_tex,6,6
water=CreatePlane()
EntityTexture water,water_tex
PositionEntity water,0,3,0
EntityAlpha water,.5
ScaleEntity water,5,100,5



;loading the terrain
terrain=LoadTerrain ( "HMAP.jpg" )
ScaleEntity terrain,5,100,5
PositionEntity terrain,-758,-21.7,-500
tex=LoadTexture( "GRASS2.jpg" )
EntityTexture terrain,tex 
EntityType terrain,Ground
EntityRadius terrain, 0.2










While Not KeyDown( 1 )
;small quick speed boosts q

If KeyHit( 57 )=True Then TranslateEntity cam1,0,9,0
;jump space
If KeyHit( 16 )=True Then MoveEntity cam1,0,0,9
;warp to big Building f1








; Controls

If KeyDown( 203 )=True Then TurnEntity cam1,0,1,0
If KeyDown( 205 )=True Then TurnEntity cam1,0,-1,0
If KeyDown( 200 )=True Then MoveEntity cam1,0,0,.08
If KeyDown( 208 )=True Then MoveEntity cam1,0,0,-.08
;strafe left x
If KeyDown( 44 )=True Then MoveEntity cam1,-.5,0,0
;strafe
If KeyDown( 45 )=True Then MoveEntity cam1,.5,0,0



TranslateEntity cam1, 0,-0.2,0




Collisions Player,Obstacle,2,2
Collisions Obstacle,Player,2,2
Collisions Ground,Player,2,3
Collisions Player,Ground,2,3





UpdateWorld




RenderWorld
Text 30,30,"Your Location: x= "+EntityX(cam1)+" y= "+EntityY(cam1)+" z= "+EntityZ(cam1) 



Flip
Wend
End   


If anybody nows them all, or a place where I could find them all out, it would be nice.


stayne(Posted 2007) [#2]
You have a stray .decls file lurking in your userlibs folder maybe?


jhocking(Posted 2007) [#3]
What lines exactly are those error messages on?


H&K(Posted 2007) [#4]
EntityType camera_pivot, PLAYER

;Collision Group
Global SCENERY=1
Global PLAYER=2


(This may be totaly wrong)
The first line creates a variable Player, probably making it an INT =0 (Because Player has not been instanced yet)
Then The Global Player bit, is trying to create a new variable with the name player

Oh, and please say which line gives the error next time


stayne(Posted 2007) [#5]
You're right H&K. Collision group needs to be above EntityType camera_pivot, PLAYER

In the second bit of code you're setting collisions for the entity Obstacle...which doesn't exist.


Blitz3dCoder(Posted 2007) [#6]
You have a stray .decls file lurking in your userlibs folder maybe?


I have no clue about this userlib thing, what is it?


GfK(Posted 2007) [#7]
If you don't even know what Userlibs are, we can safely assume that isn't what's wrong.

You need to tell us which line the errors are on. Also, the "Memory Access Violation" would probably be shown as "<something> does not exist" if you run your program with Debug enabled. That'll pretty much instantly tell you what the problem is.

At the moment I suspect you got a file/pathname wrong.


Blitz3dCoder(Posted 2007) [#8]
You need to tell us which line the errors are on.

In the second bit of code, I ran it in debug mode, and it said just like stayne, that Obastacle did not exist, so used entity type to make the cone I have up there, of the obstacle type. It still did not work.

Another thing. This problem did not happen until I put the cone in there. When I take out the player,obstacle code, it wants me to take out player,ground.

I am sorry for being so helpless...


GfK(Posted 2007) [#9]
You're using 'Player' as an entity type, and 'player' as a mesh handle for the cone - that's probably got something to do with it.

Blitz3D does not have case-sensitive variable names, therefore 'Player' and 'player' are the same.

Also, you don't need those 'Collisions' calls in your main loop. Call them once, before the main loop.


Blitz3dCoder(Posted 2007) [#10]
GfK-
That was it Amazing, how simple the answers are, to some of the most seemingly difficult problems!

Thank you for your time and help everybody. :)

Does anybody know every error message? (for future)