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.

Dark Physics & Dark A.I. & Dark Dynamix / Character Controller - Jumping?

Author
Message
FireRaven
18
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 8th Jan 2008 15:47
I'm currently working on a game, and in my player management function I want the player to be able to jump using the ctrl key.

The current function (might seem a bit messy) looks as follows:


I've experimented with different methods, but I can't manage to make the player object jump at all.

If you need the object loading and creation code, here it is:


Also note that the global integer variable 'player' is set to 9.

Any help on this?

Thanks in advance!

Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 8th Jan 2008 17:44
Jumping With Dark Physics Is A Pain In The Ass. What I'd Sujest Is Using Sparky's Dll Aswel As Dark Physics, Use Dark Physics For Most Of Your Physics But Use Sparky's To Jump With. Thats What I Do, Hope That Helps.

Yours Tv.

FireRaven
18
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 8th Jan 2008 18:09
Hmm... sounds interesting. Could you show me an example of the DLL usage, and maybe a reference to where to find it? Using DLLs really haven't been my speciality
thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 13th Jan 2008 23:04
an easy way to integrate jumping would be to create a global Gravity variable, and a Height one.

-on every frame, use Sparky to calculate the Height of the character controller.

-then, when the Height is equal to 0, set Gravity to 0 too.

-when height is greater than 0 increase Gravity by a chosen value (the higher the value the faster your character will fall)

-when Gravity is lower than 0 then increase it (again, the higher the faster, though these variables can be changed so that he might rise quickly and fall slowly, or vice versa).

-before finally applying gravity movement to the character, check to see that if Gravity is greater than Height, then set Gravity to Height (to avoid him falling through the floor).

-finally, orient the character controller downwards and move it using the Gravity variable.

-when you press the jump button, and height is low enough for your liking, set Gravity to a negative value (the lower the value, the higher the character will jump). Voila!!!

hope this helps. I could provide code, but it is always best to figure it out and write it for yourself
FireRaven
18
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 13th Jan 2008 23:08
Sounds interesting. However, what I need to know is:

1. Where exactly will I find this DLL? I'm not very familiar with third party libraries.
2. Could you show me an example of loading DLL functions into DBP?

Thanks in advance!
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Jan 2008 17:05
i dont use sparkys dll or character controllers. What i do is a get my character model and make it a rigid body dynamic capsule, then i add forces to it to make it move, jump, duck, etc.
FireRaven
18
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 14th Jan 2008 17:46
I'll have a look at that, kaedroho. Thanks.

Login to post a reply

Server time is: 2024-05-20 01:31:00
Your offset time is: 2024-05-20 01:31:00