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 with 3D Attacking.

Author
Message
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 15th Jun 2005 08:57
I have a 3D SWAT guy from darkmatter that I have loaded and appended a moving file to. I also have it so the camera follows behind him when he moves. So I have him in standing, and moving. Now I want to have him attack (shoot his gun). I have the attack file that makes him shoot.

What I want is, there is a gun aiming cursor in place of the mouse cursor, and in the middle of the screen. When you hit the left mouse button, I want it so that my swat guy shoots at the cursor, and if it hits an enemy object, that enemy object dies, then dissapears.

Where should I put 'append object "ATTACK FILE.x",1,100, and how I should code all this...

Please help me. And if its too much for you to do all this, please tell me where to start.

Enjoy Life while your still alive.
Enjoy a recees anytime!
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Jun 2005 09:45 Edited at: 15th Jun 2005 09:47
GreenFox,

The append object "ATTACK FILE.x",1,100 should be placed somewhere before the gameplay. Might as well place it close to where you load your object. Also, I would save all the animation data as a complete set of frames into one file. To clarify, the walking, idle and shooting animation should be one .x file. The walking animation, for example, might be frames 1 through 80, idle might be 81 through 120, etc. This is just a suggestion.

About the cursor, it seems as if you are needing the cursor to move around the screen in two dimensions, and when the gun is shot, the bullet needs to go in the correct direction, in accordance to what point on the 3D surface, that the cursor is 'covering up'. You will need to learn "vector math". I don't know the method well, however, use "vector math" as the search term in these forums or on google.com. There are several good e-papers out there that teach this method. I have read some, but have not fully pursued to learn vector math.


+NanoBrain+
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 15th Jun 2005 11:38
May I ask how to have the idle, walk, attack, and pobably die in the same x file?

Should I copy paste each below the first?

And how to I have the frames different, if they're all loaded in the same X file?

Enjoy Life while your still alive.
Enjoy a recees anytime!
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Jun 2005 12:15 Edited at: 15th Jun 2005 12:16
GreenFox,

In your modeller, you should use one keyframe set. A keyframe set is a single line of frames. Let's say that all of the model's animations together equal to about 300 frames. If you use one keyframe set, then the first animation should be the first frame to the amount of frames needed for that animation, and so on. Below, on the time line, each number represents a keyframe in the keyframe set.



Characters are for examples:
* = idle animation, which would, in this case, be looped from frame 1 to frame 15, and back to frame 1, and then all over again.
% = walking animation, which would, in this case, be looped from frame 16 to frame 24, and back to frame 16, and then all over again.
# = shooting animation, which would, in this case, be played from frame 25 to whatever ending frame.
So, using a single keyframe set, all your animations are in one file, and can be exported as one animation.

To "extract", so to say,the idle animation(frames 1 to 15) and loop just those frames, you would use the loop object command. Its syntax being LOOP OBJECT Object Number,Start Frame,End Frame
So, you see that a specific length, from within any start and end point of an animation file, can be looped over and over. To not, there is also the play object command, with the syntax of PLAY OBJECT Object Number,Start Frame,End Frame, which you would probably use for the gun animation, knowing that it is most likely not to be looped over and over.


+NanoBrain+
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 16th Jun 2005 02:15
I see what you mean NanoBrain.

Thanks alot for your help,

~GreenFox

Enjoy Life while your still alive.
Enjoy a recees anytime!

Login to post a reply

Server time is: 2024-09-23 21:21:36
Your offset time is: 2024-09-23 21:21:36