|
Re: trying to make an enemy entity fall to the ground move z sectio
[Re: Thehawk]
#252217
02/17/09 07:18
02/17/09 07:18
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Look OK to me, youve sucessfully worked out the distance to ground, but you havent actually moved him yet? Whats the c_move command look like?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: trying to make an enemy entity fall to the ground move z se
[Re: George]
#252245
02/17/09 11:13
02/17/09 11:13
|
Joined: Feb 2009
Posts: 84 Deutschland/Niedersachsen
GorNaKosh
Junior Member
|
Junior Member
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
|
yeah, a while loop should be helpfull xD you want to check the floor under the entity, so you have to set the temp vector to the position of the entity first before you can subtract a value from the z-coordinate. action dummy
{
var distance_traced;
var movement_speed;
var targetPos[3];
while(1) {
vec_set(targetPos,my.x); // set the target positio for the trace to the my-position
targetPos.z -= 4000; // going 4k quads downwards
distance_to_ground = c_trace (my.x, targetPos, ignore_me | use_box);
movement_speed.z = - (distance_to_ground - 10); // 17 = experimental value
movement_speed.z = max (-35 * time, movement_speed.z); // 35 = falling speed
// here you have to move the entity: for example with c_move
wait(1);
}
} consider that if the var distance_to_ground is 0 the trace didn't found anything and the entity have to fall although take a look: c_move()Why do you use WDL-scripts???
Last edited by GorNaKosh; 02/17/09 11:13.
|
|
|
Re: trying to make an enemy entity fall to the ground move z se
[Re: GorNaKosh]
#252291
02/17/09 15:03
02/17/09 15:03
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
Why do you use WDL-scripts??? because not everyone can afford to upgrade to A7
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|