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 / Movement around a point

Author
Message
Shaneapp
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 20th Jul 2004 10:19
Hi, im havin a bit of trouble with the movement of my character:

When i press right or left i want my character to move around the camera and to face in the direction in which it is moving.

Here is my code, incase you need it:


Im not quite shure you`ll understand what i mean but its difficult to describe. If anyone can help it would be much appreciated.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 20th Jul 2004 12:20
So you want him to move in a circle around the camera, right?

Your camera code is a little strange, what angle are you going for? Third person? Isometric?

I didn't get to try your code, but this is what I saw:

If you press up, he walks backwards, away from the camera.
If you press down, he walks backwards, but toward the camera.

If you have a man walking around, you probably don't want to use the point object command, because that will point him in 3 dimensions, causing his feet to be removed from the ground. What you should do is this:

point object 1,cx#,y#,cz#

That will turn him towards the camera, but won't lift him from the ground.

If you want him to walk in a circle around the camera at the distance that he is away from the camera at the moment that you press the left or right key, I can help you. I just want to make sure that is correct before I write up the code.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Shaneapp
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 20th Jul 2004 20:09
Yes i want him to circle around the camera.

My code will most likely be messy/wrong as i am only a newbe so corrections to my code may be needed. I intend to go for the 3rd person view.

I am attempting to mimic the camera views/character movement of the popular n64 game, zelda.

Yes i want the character to circle the camera at the distance he is away at the moment.

Also on zelda, if you press up and right together, the character moves neither left or right, it goes diagonaly (Making the character move around in a bigger circle). The same goes for other keys. You dont have to do this if you dont want but it would be heap loads of help.

I know this is asking for a lot, if theirs anything that i can do for you then just ask.

Thanx a lot
Shaneapp
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 24th Jul 2004 07:21
Sorry for the double post but its been about 3 days. I understand that its a lot to ask or that you may be busy but i dont want this post to be forgot about, as im very eager to learn the DB programing language.

Thanx again.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 24th Jul 2004 10:14
Sorry for not responding sooner, but here is your revised code. It is a standard 3rd person camera, I hope it is sufficient. You can adjust the camera's distance from the character with the values in the position camera command.

I also added some code to keep the game running the same speed on all computers with any frame rate. Just make sure that whenever something moves, multiply how far it moves by the variable speed#.



Is all this okay?

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Shaneapp
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 24th Jul 2004 12:11
I think thats close.

When you press left or right the character should actualy begin to move in a circle around the camera (Of course, the camera moves with it) At the moment it just rotates on the spot. Also, in this case, should see the view of the character from the side to create the effect of him running round in a circle.

Your help is very much appreciated
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 26th Jul 2004 11:24 Edited at: 26th Jul 2004 11:26
Okay, what I did before was make the guy turn and the camera go around him. Here is some revised code that should do what you wanted, albeit a little clumsily...



It may be a little confusing, but I just wanted to get it to you, it took me a while to get it working. I hope it is what you wanted, just let me know if it needs some tweaking

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Shaneapp
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 27th Jul 2004 07:42
Thats an exelent peice of code, thanx alot. I think i should be able to work on it from their, im still a beginner though my aim is to learn.

It will take a few more tweaks to get it like the real zelda style, but with a bit of work i think ill be able to do that.

Again, Thanx

Login to post a reply

Server time is: 2024-11-27 02:20:45
Your offset time is: 2024-11-27 02:20:45