model sticks and I'm stuck

Posted By: JazzDude

model sticks and I'm stuck - 02/22/13 03:46

I need to keep the player from sticking to other entities. I can't use passable. I've tried for hours with vglide, move_friction, enable_entity and a dozen other things but getting nowhere. Here is the part of the player code where I would like to include it:

Code:
while(1)
{
if(my.mode == mode_move)  //move to location target
{
my.force_x = my.speed  * time_step;
vec_diff(temp,my.target_x,my.x);
vec_to_angle(my.ang_pan,temp);
temp_ang.pan = ang(my.ang_pan - my.pan);
if(temp_ang.pan > 0) { my.pan += min(my.agility * time_step,abs(temp_ang.pan));	}
if(temp_ang.pan < 0) { my.pan -= min(my.agility * time_step,abs(temp_ang.pan));	}
ent_animate(my, "walk", my.anim_index, ANM_CYCLE);
ent_move(my.force_x,my.force_y);
my.anim_index += 7 * time_step;
}
...
wait();
}



A6 Commercial.
Please don't refer me to the manual. Nothing I've found there has helped. Thanks.
Posted By: JazzDude

Re: model sticks and I'm stuck - 02/22/13 04:00

Here's one attempt that didn't work.

Code:
if (event_type == event_entity)
{
vec_set (temp.x, normal.x);
vec_normalize (temp.x, 0.05);
if (temp.z<0) { temp.z = 0; } //don't move through the ground
vec_add(my.x,temp.x); //move -0.05 quants away from you entity
}


	}
}

Posted By: Uhrwerk

Re: model sticks and I'm stuck - 02/22/13 15:13

Code:
ent_move(my.force_x,my.force_y);


Are these really the right parameters?
Posted By: Loopix

Re: model sticks and I'm stuck - 02/22/13 15:56

Hi Rod, maybe try to use c_rotate for rotating the entity?
Well...I don't really remember as I haven't touched 3dgs for years crazy
Posted By: JazzDude

Re: model sticks and I'm stuck - 02/22/13 16:35

Okay...got me looking further and this works:

move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
result = ent_move (my.force_x,my.force_y);

I was over-thinking it.
Thanks for stimulating my gearbox.
Posted By: Uhrwerk

Re: model sticks and I'm stuck - 02/22/13 16:39

As far as I remember ent_move expected and absolute and a relative speed vector?
Posted By: JazzDude

Re: model sticks and I'm stuck - 02/22/13 17:41

Yes. Force_x and Force_y are defined skills.
Posted By: Uhrwerk

Re: model sticks and I'm stuck - 02/22/13 17:43

That is very counter-intuitive. You'd normally expect Force_x and Force_y to be components of the same vector, i.e. skills immediately following each other like skill1 and skill2. I'd have these skills named abs_force and rel_force.

But nevermind, as long as you know what they are...
Posted By: JazzDude

Re: model sticks and I'm stuck - 02/22/13 17:46

Thanks. I'll try it your way. Sounds better.
© 2024 lite-C Forums