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 / Make camera follow object view with mouse

Author
Message
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 24th Dec 2008 03:53
hello guys

Please i need some help in making the camera follow where the object is seeing.

Its a 3rd person shooter game. i have put the camera to follow a LIMB that is placed behind the object(the 3rd person).

I control the object movement with keyboard but all rotation is with the mouse. Now when i move the mouse, both object and camera rotates, but the problem the camera rotates on its own pivot. I need it to rotate on object's pivot.

Here is the BIG CODE




Please urgent help
thanks a lot in advance

No man seperates what we created
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 24th Dec 2008 08:40
Replace the corresponding part of your code with this, that should work:


Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 24th Dec 2008 13:37
mmmm no it didn't work thx by the way
help plz

No man seperates what we created
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 24th Dec 2008 14:53
well i fixed it, i should rotate the object before the camera thats all. But now i have 2 other problems

1-when the player look down : i am not able to move the mouse anymore, it locks on the down view.

2-the player is flickering a lot

Here is the code. Please try it and move ur mouse down to c what am talking about.



Help please
Thank you

No man seperates what we created
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 25th Dec 2008 00:22
hey there again everybody, i fixed the first problem(the one of the mouse thing)... the problem was that i should not call the "MOUSEMOVEY()" on each loop, so i have to put it in a variable ( in case anyone care to know ).

Now please somebody help with the second problem wich is the flickering object each time i move the mouse.

I will be trying to fix it also... so if i fix it i will let u know.

No man seperates what we created
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 25th Dec 2008 08:45 Edited at: 25th Dec 2008 08:48
I apologize if that last post didn't work out for you.

Here try this:



It may not be immediately apparent, but I moved the position object code to after the mousemovement code, that stopped the flicker, as for the angle-blocking code, I just rewrote it. I also changed the FPS# to FPS to display the frame-rate correctly. There were a few other changes, I can't remember. Anyway I hope this helps.

EDIT: I posted the wrong version of the code.

Pillarofire.
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 25th Dec 2008 15:42
Before i comment , i wana thank you a lot Pillarofire for your help and time :
>The flickering is gone.
>The fastSYNC gave me a blue screen. i can only see the text of the game . i dunno why. i tried the SYNC in place and it worked fine.
>The mouse is moving and locking fine.
>I used to see the enemy and amo text when i turn in the oposite way of them. now i only see them when the objects are in screen wich is good.

But i have few problems:

1- When i jump, a text must show up in the bottom of the screen showing "jumping". When i reload also a "reloading" must show up. None is showing

2- When i move to the wall and keep pushing forward then object go under the wall and fall into infinity.

3- When i make the first jump, the object isn't getting back to the ground, he is getting back to some distance from the ground.

I will surely try to work on these problems... but it will be also great if u offer some help.

Thanks in advance

No man seperates what we created
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 25th Dec 2008 16:42
hey again ... just wana inform you that i fixed the jumping problems. i will put the final code after all those problems are solved so if anyone cares, you can use it for your own 3rd person game making.

No man seperates what we created
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 29th Dec 2008 01:47
hello all... i fixed a lot of problems, made more explanations, added some textures, some sounds. Here's the code:



But there is still more problems to fix like:
> The camera collision with wall, actually there is already a collision for that but moves the player instead of stoping the camera.
> The gun shots decrements really fast, and didn't add sound to it yet
> The player doesn't have a collision with enemy yet
> There is still no background, no sky, no borders for the ground.

I also have a lot of more things in mind i want to add in future. Plz try the game, and if u r having any problem or suggestions to add let me know about it.

I attached all the project with all media needed.

I will be thankfull for any help

No man seperates what we created

Attachments

Login to view attachments
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 29th Dec 2008 04:44
Sorry this is all I have time for at the moment. Gotta go back to work. Try this out:


Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 30th Dec 2008 02:56
Thx Pillarofire. It worked just fine . Now the player is shooting more realisticly. And am able to add sound to it now.

No man seperates what we created
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 6th Jan 2009 03:40
hey all... well i did a lot of changes in the game. I made actually sort of DUNGEON (i dont know if that is the right name).
Added some sounds to the game. Now everything look almost fine. I have some little probs i have to fix...

But my BIG PROBLEM now is the camera collision detection with walls. I want the camera to stop moving, or do something smart, when it hits the wall(u know like real 3rd person shooter games). I tried many codes and stuff.
But things are getting worst with me:
>Sometimes it go through the wall.
>Sometimes it just lock and dont move until i move the player.
>It do collision with some walls and others no (thats the funniest thing!the walls are one object!!!)

I attached all the media needed along with the code. Please try the game and you will see the funny problems.

I need help please... I think the problem is between line 191 and line 222.

Thanks in advance









No man seperates what we created

Attachments

Login to view attachments
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 8th Jan 2009 14:23
Wow, its nice to see your progress, well done. I have worked a little on the camera code.

Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 10th Jan 2009 02:50
Pillarofire that was awsome dude... my simple game is finished now.
thanks to u and a other users help.

i will post the game soon... i added caracter, sounds, lights, ....

c u soon

No man seperates what we created
Carl CLD
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Watch your back!
Posted: 10th Jan 2009 03:39 Edited at: 10th Jan 2009 03:42
Hi Glab,

I'm impressed by all the progress you did in this thread, with the nice help of Pillarofire.

I would suggest you for your next games, as I would suggest to everyone, to use Sparky's DLL. It's a plugin for DBPro that make the collisions very easy. It saves me a lot of time and make it more fun. I attached the file to this post. You have to put 'SC_collision.dll' in the compiler\plugins-user folder and 'SC_Collision.ini' in the editor\keywords folder of your DBPro folder. There some help files included, but if you have questions, just send me an email or a private message.

Good Luck in your projects!

You should read the messages instead of the signatures...

Attachments

Login to view attachments
Glab
15
Years of Service
User Offline
Joined: 9th Dec 2008
Location:
Posted: 11th Jan 2009 05:21
Thanks a lot Carl CLD

For sure i am gonna give it a try. And since i heard so much about it, i feel am gonna like it and use it in the future.

But u know as we all start our first game, we just wana try to do smart code ourselves even if it gonna take us decades hehe cause we will be happy with what we are able to do u know, plus it will give us more experience with the program langage and capacities.

Thanks again for the files and for offering ur help

No man seperates what we created

Login to post a reply

Server time is: 2024-11-24 14:53:51
Your offset time is: 2024-11-24 14:53:51