Jumpy movement

Posted By: Nowherebrain

Jumpy movement - 07/07/09 06:34

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.
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);
	}
}


Posted By: Nowherebrain

Re: Jumpy movement - 07/07/09 06:35

This is very simple, but I am having so much trouble.
Posted By: EvilSOB

Re: Jumpy movement - 07/07/09 09:51

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);

Posted By: Nowherebrain

Re: Jumpy movement - 07/07/09 10:08


the center of the model is already set a bit higher..
thus the offset of 24 for hit.z.
I will try any way though...

"down-trace is intermittantly failing", is a better way of describing it.

on a side note how could I possibly do this 2 times per frame?
Posted By: EvilSOB

Re: Jumpy movement - 07/07/09 10:12

Why do you WANT to do it twice a frame though?
(the 'why' is important to determine a 'how')
Posted By: Nowherebrain

Re: Jumpy movement - 07/07/09 12:22

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....???
Posted By: EvilSOB

Re: Jumpy movement - 07/07/09 12:45

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);
Posted By: Nowherebrain

Re: Jumpy movement - 07/07/09 13:13

I tried this before and once again just now and it alleviates it just a bit, not completely..I do appreciate the help..this is such an odd one, but common...something so simple I cannot figure it out..I may just write something new..it'll only take about 30-40 seconds anyway...lol..I should have just done that from the get go.
Posted By: Nowherebrain

Re: Jumpy movement - 07/07/09 13:25

time_smooth solved the problem???
I went to ask a dev question and in the process solved this issue.....I guess...strange.
© 2024 lite-C Forums