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 / [Dark Physics] Character controller re-positioning help

Author
Message
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 22nd Jan 2010 12:58
Ok, I've got this small city map setup with pavements and sloped roads. I decided to use Dark Physics for the collision because it was so simple to implement and worked great because the player was able to step over pavements and walk up the slopes. Anyway, I then decided to drop in a vehicle so the player could enter it and it would run a gosub for vehicle control and it worked fine after some tweaking. Now, when I came round to adding the code for allowing the player to exit the vehicle I ran into a problem. The character controller could not be re-positioned at the location of the vehicle. "Position Object" command didn't work which meant that the player always went back to their last location before they entered the vehicle. I had a look around the forum and it this seemed to be a common problem (Please if The Game Creators are reading this then add "Phy Position Character controller" in a future update) So I then tried the following...

When setting up the character controller I put its position down as variables (plx#, ply#, plyz) in the hope that I could later reposition it by means of "plyx#=object position x(car)". But no, it didn't work and the character always went back to their last position.

I found a thread where someone suggested using the "phy delete character controller" command to delete the character controller then recreate it again when it was needed but I kept getting error messages saying the character controller already existed. Doesn't the "phy delete character controller" command work?

Then I thought about scrapping the character controller command altogether and instead making a dynamic body or something (because it seems these can be re-positioned). But, I don't really know what to do. Here I have a character controller that has perfect collision with my level but I'm now forced to seek an alternative. If anyone could help that would be great because this problem just won't go away.

Oh, and on a side note. The vehicle is too sensitive, just walking into it sends it bouncing all over the place and driving into the kerb has the same effect. I set the mass to about 3000 but still no joy. Is there a way to keep all 4 wheels firmly on the ground?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Jan 2010 13:37
you sound like you have got a fair bit going well done, now to move a character controller to a new position just use the same command that you would to reposition a physx object.

this one

phy set rigid body position ID, x#, y#, z#

using the object number you used to make the character controller.

Quote: "Oh, and on a side note. The vehicle is too sensitive, just walking into it sends it bouncing all over the place and driving into the kerb has the same effect. I set the mass to about 3000 but still no joy. Is there a way to keep all 4 wheels firmly on the ground? "

try

phy set rigid body linear damping ID, value#

Dark Physics makes any hot drink go cold.
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 22nd Jan 2010 20:38
Hi HowDo, thanks for replying. I tried out phy set rigid body position but it just returns an error message "rigid body with specified ID doesn't exist". I also tried out phy set rigid body linear damping but the vehicle has no collision and doesn't move at all. I'm really starting to lose faith in Dark Physics and I'm considering scrapping it altogether and using something else. (oh and lol, your signature is exactly what I feel at the moment)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Jan 2010 21:18
when you made your character controller you gave it a number that the number you should use in phy set rigid body position.

and on the other one use a low number like 0.5 and make sure the id is the number object of your car.

as for my signature many a times I start to type, how do, then I stop and think is there another way to say that?

Dark Physics makes any hot drink go cold.
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 23rd Jan 2010 19:44
HowDo, I used the exact same number but it just says rigid body doesn't exist when I compile the code.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Jan 2010 20:03
at a guess you would only get that if the position code was called before you made the object, however I don't think you would be doing that.

Dark Physics makes any hot drink go cold.
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 24th Jan 2010 13:14
Thanks for helping HowDo but I've now scrapped Dark Physics for collision in favour of Sparky's Collision DLL. Dark Physics causes too many headaches.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jan 2010 13:41
Ok,

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-11-24 14:52:35
Your offset time is: 2024-11-24 14:52:35