In my newest creation which is in its primitive stages. Im working on the gravity which is set to...
TranslateEntity pnt,0,-1,0
And pnt is a pivot. Which is a parent to the camera and the charecter mesh. So in my past games, when the pivot moves, the camera follows. Third-person/First. This is a third-person so the camera is translated back 150 and up 100. So, the wierdest thing happens when I execute. The pivot goes up, and the camera goes nowhere. And the EntityY(pnt) cammand printed to screen decreases. So, numericaly its going down. But graphicaly its going up (Solved by attaching a sphere as a child) and the child camera is still going nowhere based on the terrain background.
Any ideas on what I'm doing wrong???
-------------------------------------------------------
Graphics3D 640,480,32,2
AppTitle "RPG"
SetBuffer BackBuffer()
SeedRnd MilliSecs()
Const plr=1,msh=3,scn=2
Collisions plr,scn,2,1
Collisions plr,msh,1,1
Global pnt=CreatePivot()
Global light=CreateLight()
Global cam=CreateCamera(pnt)
Global mark=CreateSphere(8,pnt)
ScaleEntity mark,10,10,10
EntityColor mark,255,0,0
PositionEntity pnt,0,-100,0
EntityType pnt,plr
EntityRadius pnt,10
CameraRange cam,1,100000
PositionEntity cam,0,100,-150
Global stand=LoadAnimMesh("GFX\stand.b3d")
RotateEntity stand,0,180,0
EntityType stand,msh
HideEntity stand
Global walk=LoadAnimMesh("GFX\walk.b3d")
RotateEntity walk,0,180,0
EntityType walk,msh
HideEntity walk
Global hit=LoadAnimMesh("GFX\hit.b3d")
RotateEntity hit,0,180,0
EntityType walk,msh
HideEntity hit
Global land=LoadTerrain("GFX\land.jpg")
ScaleEntity land,1000,100000,1000
PositionEntity land,-100,-10000,-100
Global land_tex=LoadTexture("GFX\landtex.jpg")
ScaleTexture land_tex,1024,1024
Global land_trail=LoadTexture("GFX\trail.jpg",4)
ScaleTexture land_trail,1024,1024
TextureBlend land_trail,3
EntityTexture land,land_tex,0,1
EntityTexture land,land_trail,0,2
EntityType land,scn
Global guy=stand
Global walking,hiting
While Not KeyHit(1)
If KeyDown(200)
If walking=False
HideEntity guy
guy=walk
ShowEntity walk
Animate guy,1,1,0,10
EndIf
walking=True
Else If hiting=False And walking=True
Animate guy,0,1,0,10
HideEntity guy
guy=stand
ShowEntity guy
walking=False
EndIf
TranslateEntity pnt,0,1,0
PositionEntity guy,EntityX(pnt),EntityY(pnt),EntityZ(pnt)
PositionEntity cam,EntityX(pnt),EntityY(pnt)+100,EntityZ(pnt)-150
RenderWorld
UpdateWorld
Text 10,10,CountCollisions(pnt)
Text 10,20,EntityX(pnt)+","+EntityY(pnt)+","+EntityZ(pnt)
Flip
Wend
End
TranslateEntity pnt,0,-1,0
And pnt is a pivot. Which is a parent to the camera and the charecter mesh. So in my past games, when the pivot moves, the camera follows. Third-person/First. This is a third-person so the camera is translated back 150 and up 100. So, the wierdest thing happens when I execute. The pivot goes up, and the camera goes nowhere. And the EntityY(pnt) cammand printed to screen decreases. So, numericaly its going down. But graphicaly its going up (Solved by attaching a sphere as a child) and the child camera is still going nowhere based on the terrain background.
Any ideas on what I'm doing wrong???
-------------------------------------------------------
Graphics3D 640,480,32,2
AppTitle "RPG"
SetBuffer BackBuffer()
SeedRnd MilliSecs()
Const plr=1,msh=3,scn=2
Collisions plr,scn,2,1
Collisions plr,msh,1,1
Global pnt=CreatePivot()
Global light=CreateLight()
Global cam=CreateCamera(pnt)
Global mark=CreateSphere(8,pnt)
ScaleEntity mark,10,10,10
EntityColor mark,255,0,0
PositionEntity pnt,0,-100,0
EntityType pnt,plr
EntityRadius pnt,10
CameraRange cam,1,100000
PositionEntity cam,0,100,-150
Global stand=LoadAnimMesh("GFX\stand.b3d")
RotateEntity stand,0,180,0
EntityType stand,msh
HideEntity stand
Global walk=LoadAnimMesh("GFX\walk.b3d")
RotateEntity walk,0,180,0
EntityType walk,msh
HideEntity walk
Global hit=LoadAnimMesh("GFX\hit.b3d")
RotateEntity hit,0,180,0
EntityType walk,msh
HideEntity hit
Global land=LoadTerrain("GFX\land.jpg")
ScaleEntity land,1000,100000,1000
PositionEntity land,-100,-10000,-100
Global land_tex=LoadTexture("GFX\landtex.jpg")
ScaleTexture land_tex,1024,1024
Global land_trail=LoadTexture("GFX\trail.jpg",4)
ScaleTexture land_trail,1024,1024
TextureBlend land_trail,3
EntityTexture land,land_tex,0,1
EntityTexture land,land_trail,0,2
EntityType land,scn
Global guy=stand
Global walking,hiting
While Not KeyHit(1)
If KeyDown(200)
If walking=False
HideEntity guy
guy=walk
ShowEntity walk
Animate guy,1,1,0,10
EndIf
walking=True
Else If hiting=False And walking=True
Animate guy,0,1,0,10
HideEntity guy
guy=stand
ShowEntity guy
walking=False
EndIf
TranslateEntity pnt,0,1,0
PositionEntity guy,EntityX(pnt),EntityY(pnt),EntityZ(pnt)
PositionEntity cam,EntityX(pnt),EntityY(pnt)+100,EntityZ(pnt)-150
RenderWorld
UpdateWorld
Text 10,10,CountCollisions(pnt)
Text 10,20,EntityX(pnt)+","+EntityY(pnt)+","+EntityZ(pnt)
Flip
Wend
End