|
stuck player
#315387
03/15/10 05:10
03/15/10 05:10
|
Joined: Sep 2003
Posts: 733 Whitefish, Montana
JazzDude
OP
User
|
OP
User
Joined: Sep 2003
Posts: 733
Whitefish, Montana
|
There's something wrong with this section of my player code. The player gets stuck in the stand animation and won't respond to the mouse_right until he hits a certain pan position--not always the same one. I've tried every collision trick in the manual and a few from AUM and the forum but can't solve the problem.
player = my;
c_setminmax(me);
vec_set(my.min_x,vector(-15,-15,-50));
vec_set(my.max_x,vector(15,15,50));
my.z = 60;
while (1)
{
player.pan -= 5 * mouse_force.x * time_step;
if(key_pressed(281)) //mouse right
{
ent_animate(my, "walk", walk_percentage, ANM_CYCLE);
walk_percentage += 7 * time_step;
walk_percentage %= 100;
if (walk_percentage < 10)
{
sounded_once = 1;
}
if ((walk_percentage > 50) && (sounded_once == 1))
{
sounded_once = 2;
ent_playsound(my, step2_wav, 70);
}
if ((walk_percentage > 95) && (sounded_once == 2))
{
sounded_once = 3;
ent_playsound(my, step2_wav, 70);
}
c_move (my, temp.x, nullvector, IGNORE_PASSABLE | GLIDE );
temp.x = movement_speed * (mouse_right)*0.6 * time_step;
}
else
{
ent_animate(my, "stand", stand_percentage, ANM_CYCLE);
stand_percentage += 5 * time_step;
}
wait(1);
}
That isn't all the action, of course, but the rest of it --camera, gravity--seems to be working okay.
|
|
|
Re: stuck player
[Re: JazzDude]
#315406
03/15/10 10:40
03/15/10 10:40
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
Expert
|
Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
Hey Rod, is the wait(1); in the right place? shouldnt it look like this?
ent_animate(my, "stand", stand_percentage, ANM_CYCLE); stand_percentage += 5 * time_step; wait(1);
then the bracket? i am no pro, just wondering. and arent you missing the skill number?
Last edited by Blink; 03/15/10 10:43.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: stuck player
[Re: JazzDude]
#315504
03/16/10 07:57
03/16/10 07:57
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
you could beter use c_rotate instead of using player.pan
this way it can get stuck in lvl geomtry
"empty"
|
|
|
Re: stuck player
[Re: JazzDude]
#315625
03/17/10 17:49
03/17/10 17:49
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
Expert
|
Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
Rod, did you every figure this out?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: stuck player
[Re: JazzDude]
#315670
03/18/10 01:03
03/18/10 01:03
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
Expert
|
Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
well, i guess its better to be lucky then. i can't wait to see what you have up your sleeve for your next great adventure. i admire your dedication, and great works. you inspire me, Rod!
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: stuck player
[Re: JazzDude]
#315774
03/18/10 23:14
03/18/10 23:14
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
Expert
|
Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
|