0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Player stucks in evety object!
#365853
03/29/11 18:15
03/29/11 18:15
|
Joined: Aug 2007
Posts: 74
Mahdi
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2007
Posts: 74
|
hi there,
I am using a7 and have problem.
Player can pass through every object.
I checked the BBox and Polygon of objects.
Now the player sometime sticks to the object and someother times pass through it.
I found out that objects with a Rectangular shape does not have this problem. And object with round sides has this problem.
Is there anyway to avoid this?
I don't care!
|
|
|
Re: Player stucks in evety object!
[Re: 3run]
#365908
03/30/11 05:33
03/30/11 05:33
|
Joined: Aug 2007
Posts: 74
Mahdi
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2007
Posts: 74
|
This is the code used for player's movement:
player.pan += (key_cul-key_cur)*8 *time;
if (key_x !=on)
{
move_vec[0] = (key_cuu - key_cud)*25 * time + (key_v * 10) * key_cuu * time;
c_move(my, vector(move_vec.x,move_vec.y,0), nullvector, IGNORE_PASSABLE + GLIDE);}
Is anything wrong?
I don't care!
|
|
|
Re: Player stucks in evety object!
[Re: Mahdi]
#365935
03/30/11 14:04
03/30/11 14:04
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
First, why are you still using C-SCRIPT? Start with LITE-C! Second what are you trying to do by this:
+ (key_v * 10) * key_cuu * time_step;
Explain a bit more your movement code, cause it looks strange for me... Tell me what are you trying to do, and I'll help you to realize it with LITE-C.
|
|
|
Re: Player stucks in evety object!
[Re: 3run]
#365939
03/30/11 14:40
03/30/11 14:40
|
Joined: Aug 2007
Posts: 74
Mahdi
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2007
Posts: 74
|
That piece of code would make the player run.
I am just trying to make a demo game to see if I am skilled enough.
And I want to make this demo game like Resident Evil 3.
In Re3 when you want to run, you use the navigation keys + V key.
And I achived this effect by adding that pice of code.
I don't care!
|
|
|
Re: Player stucks in evety object!
[Re: 3run]
#365978
03/31/11 07:05
03/31/11 07:05
|
Joined: Aug 2007
Posts: 74
Mahdi
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2007
Posts: 74
|
ok thanks for the code.
what change you would make if you want to add ent_animate to your code? (for example running or walking).
I think the problem comes from here. If you explain how would you animate your charecter, that helps me a lot.
I don't care!
|
|
|
Re: Player stucks in evety object!
[Re: Mahdi]
#366003
03/31/11 15:16
03/31/11 15:16
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Does my code fix the problem? I would simple animate player like this (without blending):
if(key_force.x != 0 || key_force.y != 0) // if pressed any cursor keys...
{
if(key_v) // and if running
{
my.skill99 += 10 * time_step; // 10 is running speed
ent_animate(my,"run",my.skill99,ANM_CYCLE); // animate MY (player here) with "RUN" animation
}
else
{
my.skill99 += 10 * time_step; // 10 is walking speed
ent_animate(my,"walk",my.skill99,ANM_CYCLE); // animate MY (player here) with "WALK" animation
}
}
else // if cursor keys aren't pressed
{
my.skill99 += 4 * time_step; // 4 is standing speed
ent_animate(my,"stand",my.skill99,ANM_CYCLE); // animate MY (player here) with "STAND" animation
// some models use "idle" instead of "stand" be careful
}
|
|
|
Re: Player stucks in evety object!
[Re: 3run]
#366146
04/01/11 17:41
04/01/11 17:41
|
Joined: Aug 2007
Posts: 74
Mahdi
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2007
Posts: 74
|
Thanks, the problem is solved now.
The problem was from the player's model not the codes (pivot point).
Thanks for everything.
I don't care!
|
|
|
|