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.

Newcomers DBPro Corner / help me with this code

Author
Message
kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 4th Apr 2004 03:05


i was able to get the up key and downkey stuff in(it was mosueclick unitl i changed it) how do i add if you click the right key you sidestep to the right and if you hit left you side step to the left?(i know its if leftkey()=1)
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Apr 2004 03:10 Edited at: 4th Apr 2004 03:13
DBP has a TURN CAMERA LEFT command, you can always try turn left 90, move a bit, and turn right 90. However, it is better to learn the math and position the camera that way.
--
TAZ

kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 4th Apr 2004 03:12 Edited at: 4th Apr 2004 03:14
so its?
if leftkey()=1 then TURN CAMERA LEFT 90
if rightkey()=1 then turn camera right 90





edit: i tried it and it didnt work
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Apr 2004 03:15 Edited at: 4th Apr 2004 03:16
if leftkey()=1 then TURN CAMERA LEFT 90: move camera 10: turn camera right 90

if rightkey()=1 the turn camera right 90: move camera 10: turn camera left 90

10 is just a number I pulled out of thin air, if that works for you, adjust the step size or change it to a time based value

kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 4th Apr 2004 03:19 Edited at: 4th Apr 2004 03:21
thank you very much zircher it worked i was trying to get it to do that for a week


soon i'll post the code after i change it a bit (its the huge dungeon tutorial altered my way)
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Apr 2004 03:20
glad to help

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 4th Apr 2004 03:32
turn-move-turn back to strafe?
or am I missing the original question? he did say "sidestep" right?



Home of the VB.NET Class Builder Utility - Demo available now!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Apr 2004 06:17
I'm assuming that side step and strafe movement are the same in this case. Since the sync happens at the end of the loop, you don't see the turning, just the update of the relative position.
--
TAZ

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 4th Apr 2004 09:36
newxvalue, newzvalue, and newyvalue are always very useful handles the x=x(+or * can't remember)r*cos(theta) stuff.

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 5th Apr 2004 22:49
Quote: "thank you very much zircher it worked i was trying to get it to do that for a week
"
just in case you did not see that but thanx anyways
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Apr 2004 23:08 Edited at: 5th Apr 2004 23:09
but why the 3 movements? just strafe.

strafe left is always -90 to the angle the camera is facing
strafe right is always +90


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 5th Apr 2004 23:28
Agreed.



Should do the job, probably a bit more efficient.

Its not a bug, its a feature!
kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 5th Apr 2004 23:55
for some reason that does not work

i used to be kidsa the random one i guess im not as random anymore.

any language used by me will be dbpro(saves me a lot of typing)
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 6th Apr 2004 00:12
I'm not sure, but that might be muddled up by the move camera and the turn camera commands

Its not a bug, its a feature!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th Apr 2004 01:08 Edited at: 6th Apr 2004 01:10
Kentaree, it looks like you have half the code there. What happens when the player is turned at an angle? Don't you need the Z values as well? Since this is the new comer forum, you might want to spell out how to apply cx#/cz# to an object as well.

CattleRustler, "strafe" does not ring a bell as a command. There is move object left/right. But, I thought those did not exist in DBC. The turn/move/turn logic is just basic turtle graphics.
--
TAZ

[edit for typos]

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Apr 2004 04:39 Edited at: 6th Apr 2004 04:40
I didn't mean "strafe" as a command per se, i meant write code that actually strafes

here is some strafing code from an fps test I was working on. Have fun stripping out what you need (Kidsa)





Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 6th Apr 2004 22:47
its like xmas thnx cattle rustler(did not try yet)

i used to be kidsa the random one i guess im not as random anymore.

any language used by me will be dbpro(saves me a lot of typing)
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 6th Apr 2004 23:13
Dont trust the built-in new*value commands, here's the real deal

Math:


Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Apr 2004 00:32 Edited at: 7th Apr 2004 00:33
actually my foot is in my mouth as the code example I gave you above actually does the three steps too.

Silly me.

It still works well and is a good example of mouselook + strafe etc.
not all strafing needs this 3-move setup but the one above happens to use it. good luck.


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!

Login to post a reply

Server time is: 2024-11-26 12:28:56
Your offset time is: 2024-11-26 12:28:56