2 registered members (dr_panther, 7th_zorro),
1,203
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Jumpy movement
#276923
07/07/09 06:34
07/07/09 06:34
|
Joined: Jul 2005
Posts: 1,002 Trier, Deutschland
Nowherebrain
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
|
My player seems to be moving around a bit(slight popping in z)...I cannot figure it out...I assumed it was a shared variable changing values like temp, but I cannot find it...does anyone see anything wrong here...this is the whole code..I just typed it for testing purposes with my camera code.
var run_speed = 550;
action guss()
{
var anim_cycle;
var ground_dist;
VECTOR ground_00;
player = my;
c_updatehull(my,11);
wait(1);
set(my,SHADOW);
my.material = mat_alphatest;
while(1)
{
player_exists = 1;//global
c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|USE_BOX);
vec_set(player.x,vector(player.x,player.y,(hit.z + 24)));
if(key_w == 1)
{
c_move(my,vector(run_speed*time_step/16,0,0),nullvector,IGNORE_PASSABLE|IGNORE_SPRITES|GLIDE);
ent_animate(my,"run",anim_cycle,ANM_CYCLE);
anim_cycle += 10 * time_step;
anim_cycle %= 100;
}
if(key_any == 0)
{
ent_animate(my,"stand",anim_cycle,ANM_CYCLE);
anim_cycle += 8 * time_step;
anim_cycle %= 100;
}
my.pan -= mouse_force.x + mouse_force.x;
wait(1);
}
}
|
|
|
Re: Jumpy movement
[Re: Nowherebrain]
#276971
07/07/09 09:51
07/07/09 09:51
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
It may be that your down-trace is intermittantly failing. Try this. c_trace(vector(my.x,my.y,my.z+50),vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|USE_BOX);
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Jumpy movement
[Re: Nowherebrain]
#276985
07/07/09 10:12
07/07/09 10:12
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Why do you WANT to do it twice a frame though? (the 'why' is important to determine a 'how')
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Jumpy movement
[Re: EvilSOB]
#277023
07/07/09 12:22
07/07/09 12:22
|
Joined: Jul 2005
Posts: 1,002 Trier, Deutschland
Nowherebrain
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
|
I have no idea, I'm just curious I guess....I can always learn more...I am not the best coder...lol it is still doing it BTW....??? player is on terrain....I can't see anything affecting this...it is a fairly empty level....the terrain, player, and camera....???
Last edited by Nowherebrain; 07/07/09 12:24.
|
|
|
Re: Jumpy movement
[Re: Nowherebrain]
#277028
07/07/09 12:45
07/07/09 12:45
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Try dropping the trace back to this (as a test) and see if it helps. (no use_box) c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES);
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|