2 registered members (AndrewAMD, ozgur),
1,392
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Player Physics
#223185
08/22/08 15:55
08/22/08 15:55
|
Joined: Dec 2006
Posts: 17
hallsofvallhalla
OP
Newbie
|
OP
Newbie
Joined: Dec 2006
Posts: 17
|
Thought I would make my own thread for this because I seem to be making a obvious mistake. I cant find an answer anywhere so others must not be making this mistake
I have a player I added physics to. I used the same method as was posted in another thread:
action myplayer() {
myplayer = me;
ph_setgravity (vector(0, 0, -386)); phent_settype (myplayer, PH_RIGID, PH_BOX); phent_setmass (myplayer, 3, PH_BOX); phent_setfriction (myplayer, 80); phent_setdamping (myplayer, 40, 40);
while (1) { if(key_w) {
myplayer_speed.x = 5 ; myplayer_speed.y = 0 ; myplayer_speed.z = 0; phent_addvelcentral (myplayer, myplayer_speed); } wait(1); }
The problem is my player falls over. Then he just tumbles around. Is this in my model? Is there a setting I am missing? How do I keep him standing upright?
Any help is most appreciated.
Last edited by hallsofvallhalla; 08/22/08 15:56.
|
|
|
Re: Player Physics
[Re: Omicron_NEGA]
#223192
08/22/08 16:17
08/22/08 16:17
|
Joined: Aug 2008
Posts: 63 =Strogg=3rd_com_cent.
Omicron_NEGA
Warez kiddie?
|
Warez kiddie?
Joined: Aug 2008
Posts: 63
=Strogg=3rd_com_cent.
|
action myplayer() {
myplayer = me; myplayer.fat = on; myplayer.narrow = on; c_setminmax(myplayer);
phent_settype (myplayer, PH_RIGID, PH_BOX); phent_enable( myplayer, 1 ); ph_setgravity (vector(0, 0, -386)); phent_setmass (myplayer, 3, PH_BOX); phent_setfriction (myplayer, 80); phent_setdamping (myplayer, 40, 40);
while (1) { if(key_w) {
myplayer_speed.x = 5 ; myplayer_speed.y = 0 ; myplayer_speed.z = 0; phent_addvelcentral (myplayer, myplayer_speed); } wait(1); }
P4 3.6GHz x2 8GB RAM DDR2 GeForce8800GTS
|
|
|
Re: Player Physics
[Re: hallsofvallhalla]
#223216
08/22/08 17:37
08/22/08 17:37
|
Joined: Aug 2008
Posts: 63 =Strogg=3rd_com_cent.
Omicron_NEGA
Warez kiddie?
|
Warez kiddie?
Joined: Aug 2008
Posts: 63
=Strogg=3rd_com_cent.
|
nope and i have no idea for this..
btw,what is ur terrain look like?
edit:try delete "phent_setdamping (myplayer, 40, 40);" and what is ur Gamestudio Version/Edition?
Last edited by Omicron_NEGA; 08/22/08 17:41.
P4 3.6GHz x2 8GB RAM DDR2 GeForce8800GTS
|
|
|
Re: Player Physics
[Re: fastlane69]
#223223
08/22/08 18:08
08/22/08 18:08
|
Joined: Dec 2006
Posts: 17
hallsofvallhalla
OP
Newbie
|
OP
Newbie
Joined: Dec 2006
Posts: 17
|
its got to be something i am doing wrong or just lack of thought put behind the idea that people will use tall humanoid models in the physics system. I put a huge cylinder base on my model and he still flips around and tips over. Maybe I wont use physics. Seems to be too much trouble. i would of assumed there would have been a special physics setting for player models. Well back to the drawing board. Thanks for the help.
|
|
|
Re: Player Physics
[Re: hallsofvallhalla]
#223225
08/22/08 18:16
08/22/08 18:16
|
Joined: Mar 2003
Posts: 5,377 USofA
fastlane69
Senior Expert
|
Senior Expert
Joined: Mar 2003
Posts: 5,377
USofA
|
people will use tall humanoid models in the physics system. AFAIK, nobody does for the reasons you've encountered. However, if you read my post, you'll note that IMO your code is right for the physics engine is just doing what it's supposed to do: Physics! Oh, and there are ways of doing it as I've stated above... you have to work with physics, not against it.
|
|
|
Re: Player Physics
[Re: fastlane69]
#223227
08/22/08 18:38
08/22/08 18:38
|
Joined: Dec 2006
Posts: 17
hallsofvallhalla
OP
Newbie
|
OP
Newbie
Joined: Dec 2006
Posts: 17
|
i understand that, but this is just one character, I can only imagine how bad it will get when i start adding lots of movable models. I am developing a isometric Sci-Fi RPG so Physics are not that important. Just a nice additive. The 3dgs physics are nice and I am not complaining. Just wish the had a scripting command like phent_sethumanoid (myplayer); to tell the engine its a biped and to set the gravity properly. Guess we cant have our cake and eat it too edit: whats the best method to simulate gravity without the use of physics? To keep the player on the terrain and to fall? Just a constant -z?
Last edited by hallsofvallhalla; 08/22/08 18:46.
|
|
|
|