1 registered members (AndrewAMD),
1,018
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
model sticks and I'm stuck
#418198
02/22/13 03:46
02/22/13 03:46
|
Joined: Sep 2003
Posts: 733 Whitefish, Montana
JazzDude
OP
User
|
OP
User
Joined: Sep 2003
Posts: 733
Whitefish, Montana
|
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:
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.
|
|
|
Re: model sticks and I'm stuck
[Re: JazzDude]
#418246
02/22/13 15:13
02/22/13 15:13
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
ent_move(my.force_x,my.force_y);
Are these really the right parameters?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: model sticks and I'm stuck
[Re: JazzDude]
#418254
02/22/13 16:39
02/22/13 16:39
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
As far as I remember ent_move expected and absolute and a relative speed vector?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: model sticks and I'm stuck
[Re: JazzDude]
#418260
02/22/13 17:43
02/22/13 17:43
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
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...
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|