Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,397 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Player stucks in evety object! #365853
03/29/11 18:15
03/29/11 18:15
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline 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: Mahdi] #365886
03/29/11 22:02
03/29/11 22:02
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Show us code you use, we wouldn't be able to help you other way...


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
This is the code used for player's movement:
Code:
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 Offline
Senior Expert
3run  Offline
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:
Code:
+ (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.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
Mahdi  Offline 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: Mahdi] #365942
03/30/11 14:45
03/30/11 14:45
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
What is key_x for? Any way, here you go (LITE-C as I promissed):
Code:
VECTOR dist; // this must be out of the loop

my.pan += 10 * (key_cur - key_cul) * time_step; // turn my pan (my here is PLAYER)

if(!key_x) // if key_x isn't pressed
{
	if(key_v) // if running
	{
		dist.x = 20 * (key_cuu - 0.4 * key_cud) * time_step; // 20 running speed 0.4 reduces backwards speed
	}
	else
	{
		dist.x = 10 * (key_cuu - 0.8 * key_cud) * time_step; // 10 running speed 0.8 reduces backwards speed
	}
}
move_friction = 0.1; // this is movement friction, play with it
c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE); // don't use "+" here, better "|"




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
Mahdi  Offline 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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Does my code fix the problem?
I would simple animate player like this (without blending):
Code:
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
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
Mahdi  Offline 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!
Re: Player stucks in evety object! [Re: Mahdi] #366180
04/01/11 20:11
04/01/11 20:11
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You are welcome, feel free to register at my website and ask for help.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1