Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
2 registered members (Akow, SBGuy), 1,423 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Terrain Follow #210977
06/14/08 09:10
06/14/08 09:10
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Hi im trying to let me units follow the terrain.
It work's right now but it works ugly frown

They are sort of jumping arround when they follow the terrain up or down >.<

How to fix this ?

Here is my code of it:

Code:
	while(me!=NULL) 
	{
		//trace floor
		vec_set(trace_from,my.x);
		vec_set(trace_to,my.x);
		trace_to.z -= 500;
		ground_dist = c_trace(trace_from,trace_to,ignore_me|ignore_passents|ignore_passable|ignore_sprites|use_box);
		
		if(ground_dist != 0)
		{
			my.z -= ground_dist;
	   }
 



-The Dragon's Eye is alway's watching you!-
Re: Terrain Follow [Re: SurudoiRyu] #210990
06/14/08 10:45
06/14/08 10:45
Joined: May 2006
Posts: 90
England
TigerTao Offline
Junior Member
TigerTao  Offline
Junior Member

Joined: May 2006
Posts: 90
England
I remember someone saying its best to call a floor trace twice, once before c_move and then once again after c_move

Not sure why but does seem to work. Perhaps it is something to do with changing a z position directly does not perform collision detection as it does when using c_move or ent_move.

Call trace to move enemy up on terrain if result is not 0

Move player forwards into terrain (c_move)

Call trace again to move enemy up on terrain after moving forward.




Last edited by TigerTao; 06/14/08 10:48.
Re: Terrain Follow [Re: TigerTao] #211034
06/14/08 15:06
06/14/08 15:06
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
thnx, it helped for the movement problem but now sometimes it moves on a certain area very slow or not at all :S kinda weird but ill try to fix this problem smile


-The Dragon's Eye is alway's watching you!-
Re: Terrain Follow [Re: SurudoiRyu] #211046
06/14/08 16:20
06/14/08 16:20
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
The online manual has got a ground walking example recently, click on the "Manual" link and then scroll down and click on "c_move".


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