Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Third Person Engine.

Author
Message
Lycan
15
Years of Service
User Offline
Joined: 25th Jul 2010
Location:
Posted: 24th Apr 2011 20:31
I all! I'm new on Dark Basic Pr, and I want create a Third Person Engine, who would walk with maps FPS Creator. But I do not know how, I do not know the character set, or position the camera. I tried modifying the example First Person Shooter. Someone help me if you could you it fades? Thank you!

GreenDixy
17
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 24th Apr 2011 21:57
third person is a bit more tricky then first you will need to load a model "custom or not" setup animations when walking also for the weapons you will need to learn how to use limbs for the camera you can set it to the objects postition then adjust the values to be more behind the model

======================================

GreenDixy Productions http://GreenDixy.Com
Lycan
15
Years of Service
User Offline
Joined: 25th Jul 2010
Location:
Posted: 25th Apr 2011 12:16
Thank you! I try various things, but I can not type, the position of the camera, put a character, and if that is followed by the camera. Thank you!

Lycan
15
Years of Service
User Offline
Joined: 25th Jul 2010
Location:
Posted: 25th Apr 2011 13:45
I found the base code, it works very well, I changed some stuff. But I can not do 2 things: replace the sphere by a character animated (who just FPSC), and replace the sets (flat area) by a map FPSC. Can anyone help me please? Thank you!

Quote: "Sync On
Sync Rate 30

Rem make matrix
Make matrix 1,10000,10000,20,20

Rem texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1

Rem Make player pawn
Load image "barry.bmp",2
Make object sphere 10,25
Texture object 10,2
position object 10,100,0,100

rem Randomize the matrix
randomize matrix 1,125

Rem Main loop
Do
set cursor 0,0
print screen fps()

Rem Store Object angle
AngleY# = object angle Y(10)

Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 10,10
Endif
Endif

If Leftkey()=1 then Yrotate object 10,Wrapvalue(AngleY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(AngleY#+5)
X# = Object position x(10)
Z# = Object position z(10)
Y# = Get Ground Height(1,X#,Z#)
Position object 10,X#,Y#+12.5,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,100)
CameraX# = Newxvalue(X#,AngleY#-180,100)
CameraY# = Get Ground Height(1,CameraX#,CameraZ#)
Position camera CameraX#,CameraY#+50,CameraZ#
Point camera X#,Y#+25,Z#

Rem Refresh Screen
Sync
Loop
"


Login to post a reply

Server time is: 2026-07-18 06:41:29
Your offset time is: 2026-07-18 06:41:29