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 / Player is Under my map?(Sparky's)

Author
Message
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 1st Sep 2010 15:49 Edited at: 2nd Sep 2010 16:27
Hi "Again!" peeps at TGC

EDIT!: I got help with this problem, thanks to the person(s) below this post(s) - I got a new problem, wich is posted below


Okay. I made a very simple WSAD + Mouse look test game with the help of some snippets. (Needed something fast for this).

This is for testing some player animations and collision.

I just got one problem (atm.)
When i compile, my player (Object 2) stays under the ground, moves and collides. But it still wont walk on the ground.

I have attached a compiled exe, the test animation and the map.
And here is my code. Feel free to take a look at it


--------------------------------------
NewBie - Coding? Damn..

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Sep 2010 17:54
The model itself is messed up. I have edited the model so it works. I have named it Anim02 (file is attached). Also, the radius typically is 1/2 of the Y size of the object. I have made a few minor edits to your code so it works.



LB

So many games to code.......so little time.

Attachments

Login to view attachments
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 1st Sep 2010 18:21
Thanks pal.
It actually made sense

I will keep this is mind, when finishing and exporting my current character.

Well. If your up for a little extra challenge, then :

This code is obviously for the walk animation


But when I add this code underneath it(For "reverse" walking/walking backwards):



None of the animations work.
And I have made sure to have the right anim.. At frame 41-80

--------------------------------------
NewBie - Coding? Damn..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Sep 2010 18:52 Edited at: 1st Sep 2010 18:54
I guess I should have elaborated more. The only way to reposition the model itself is to import it into a 3D modeling program and edit it. However, with the modeling software that I use, .x file animations cannot be imported. Therefore, I had to re-rig and re-animate the model from scratch. I only put one walking animation in, and the frames are 1 - 21. I added reverse walking animations, but it looks the same either way. If you want the model, I can upload it also.

EDIT: One other thing I noticed is that your Animation subroutine does not have a RETURN.

So many games to code.......so little time.
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 1st Sep 2010 19:06
This was only a test model, as I'm atm finishing my real model in 3Ds Max.
And I have found the right place for my model to be in order to be at the ground place.

Lol. Missing return :S
Nice spotted.

I have a new very quick model (Like the other one) with a couple of extra animations added. I will try it out in a minute.

Thanks for the respons.

--------------------------------------
NewBie - Coding? Damn..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Sep 2010 19:33 Edited at: 1st Sep 2010 19:34
I do not own 3DS Max unfortunately. I grabbed a pic of how the model needs to be lined up (at least in my modeling program).

So many games to code.......so little time.

Attachments

Login to view attachments
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Sep 2010 19:48
Actually, you could leave the model's center point where it is and just add an offset to the Y position that Sparky's gives you for the collision point.

SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 1st Sep 2010 20:00
Just tried... And failed..

Can anyone tell me whats wrong with this code:


My model.x contains to deffirent animations at frame 1-40 and 41-80.

With the second code added, I can still play the first animation, but when S is pressed, only the first frame (41) is played :/


And btw. Bones are too oldskool for me. I have another idea in mind

--------------------------------------
NewBie - Coding? Damn..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Sep 2010 21:15 Edited at: 1st Sep 2010 21:16
Your code immediately stops the animation if keystate(17) <> 1 or keystate(31) <> 1. Instead of looping the object, why not PLAY the object?

Before you play it, simply check to see if it is already playing. If it is:
1. check to see if the frame is within what you intend to play
A. If it is, ignore playing it again, as it is already playing that animation
B. If it isn't, stop the object and play it using the correct animation
If it isn't already playing an animation:
1. play the frames you want.

Hope this makes sense.

EDIT:
Quote: "And btw. Bones are too oldskool for me. I have another idea in mind "


Bones are oldskool?

So many games to code.......so little time.
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 1st Sep 2010 22:21
LBFN
Thanks. But you gotta help me out a little on that

I changed to Play object.

If I understand the code right, the animation would stop when W isn't being pressed anymore.
That would allow the other animation to be played?




Well. Not oldskool. I just have another thing in mind, wich takes Way more programming .

--------------------------------------
NewBie - Coding? Damn..
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 2nd Sep 2010 15:39
Just changed to
.
That didn't work either :/

--------------------------------------
NewBie - Coding? Damn..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Sep 2010 17:13
Here, try this:



You can either change the frames to fit with your model or download the attached one to use as is.

So many games to code.......so little time.

Attachments

Login to view attachments
SpaDeKo
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location:
Posted: 2nd Sep 2010 17:28
Hell yeah.
Thanks dude.

Can't believe I couldn't find the object frame command.
I have been looking for a similar command for some time now

--------------------------------------
NewBie - Coding? Damn..

Login to post a reply

Server time is: 2024-09-28 22:32:07
Your offset time is: 2024-09-28 22:32:07