|
6 registered members (TipmyPip, M_D, AndrewAMD, NeoDumont, alx, 1 invisible),
8,822
guests, and 8
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: i made enemy but he not have a gravity
[Re: IDontLikeSoccer]
#304658
01/09/10 18:48
01/09/10 18:48
|
Joined: Jun 2009
Posts: 38
hungryhobo
Newbie
|
Newbie
Joined: Jun 2009
Posts: 38
|
using the physics engine
phent_settype(me, PH_RIGID, PH_SPHERE); //what kind of entity? phent_setmass(me, 5, PH_SPHERE); phent_setfriction(me, 100); phent_setdamping(me, 40,40); phent_setelasticity(me, 10, 10); //set elasticity
put this in the action for your entity. it sets all the physics stuff and of course you can play with the values.
then in your main function put
"ph_setgravity(vector(0,0,-380));"
should be good.
|
|
|
Re: i made enemy but he not have a gravity
[Re: hungryhobo]
#304665
01/09/10 20:01
01/09/10 20:01
|
Joined: Nov 2009
Posts: 43 Turkiye
Machera
Newbie
|
Newbie
Joined: Nov 2009
Posts: 43
Turkiye
|
owww, as far as i know, we cant use physics for characters (like human enemy). in your character action just write c_move expression. like c_move(me,movement_vector,vector(0,0,-10*time_step),USE_BOX);
edit: this was c-script topic. i dont know c-script version
Last edited by Machera; 01/09/10 20:10.
|
|
|
Re: i made enemy but he not have a gravity
[Re: Machera]
#304743
01/10/10 16:16
01/10/10 16:16
|
Joined: Aug 2004
Posts: 87
IDontLikeSoccer
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2004
Posts: 87
|
Thanks guys. I add some code in my enemy but i have problem my enemy fall down verry fast: vec_set (temp, my.x); temp.z -= 10000; trace_mode = ignore_me + ignore_passable + use_box; walk_speed.z = -trace (my.x, temp) * time; // i add *time for slowly falling ent_move(walk_speed, nullvector); How fix this? Thx
|
|
|
|