Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (SBGuy, Quad), 768 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Terrains and Movement #378468
07/23/11 21:57
07/23/11 21:57
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I have a terrain and am using c_move to move my character but it goes right through the terrain. My question is... Am I doing it wrong or does c_move not interact with terrains?

Can anyone point me in the right direction?

Another question: after creating a terrain... Is there any way to modify its position? I tried to direclty change it's x and y coordinate values but it dosnt seem to work. On creation I can place it where I want but afterwards I cant seem to "re-locate" it. Is this some kind of restraint of how terrains work?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Terrains and Movement [Re: Carlos3DGS] #378470
07/23/11 22:11
07/23/11 22:11
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
1: Please post ur code, so we can say u what u are doing wrong(c_move interact with terrains).
2: Did you tried the DYNAMIC flag????
xxxxxxx


Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: Terrains and Movement [Re: xxxxxxx] #378480
07/24/11 06:47
07/24/11 06:47
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
"c_move" interact with everything, to interact with terrains you simply need to do this:
Code:
dist.x = 10 * (key_w - key_s) * time_step;
dist.y = 10 * (key_a - key_d) * time_step;
dist.z = 10 * (key_q - key_e) * time_step;
c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE);

So you can move player with WSAD in X and Y coordinates, plus with QE in Z.
Take a look at your "c_move", may be you are using "IGNORE_WORLD" in it.
Or may be "IGNORE_FLAG2" and you terrain has FLAG2 set on... I can't see any other reasons.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Terrains and Movement [Re: 3run] #378500
07/24/11 12:22
07/24/11 12:22
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I know how to use c_move, but thankyou for taking the time to reply in case I didnt.

Just in case I post my movement code, mabe I am missing some mistake and someone else can help find it:

Code:
c_move(Boat,vector((key_cuu-key_cud)*20*time_step,0,0),nullvector,IGNORE_PASSABLE);
c_rotate(Boat,vector((key_cul-key_cur)*2*time_step,0,0),IGNORE_PASSABLE);


My terrain does not have the passable set so that should not be the problem. Just to make sure i removed the IGNORE_PASSABLE mode from the movement and I still have that problem... I just go right through the terrains


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Terrains and Movement [Re: xxxxxxx] #378501
07/24/11 12:38
07/24/11 12:38
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I found the problem.
I modify my terrains at runtime with functions like these:
Code:
ENTITY* CurrSand;
	int VecTotal = ent_status(Sand[2][2],0);//terrain total vectors
	var VecDist;//store distance to terrain center
	
	int tx; int ty; int i;
	
	
	for (i=VecTotal; i>0; i--)
	{
		for(tx=0;tx<5;tx++)
		{
			for(ty=0;ty<5;ty++)
			{
				CurrSand=Sand[tx][ty];
				CONTACT* c1 = ent_getvertex(CurrSand,NULL,i);
				
				if(CurrSand.skill1==1)
				{
					VecDist=vec_dist(vector(((i-1)%33),(integer((i-1)/33)),0),vector(16,16,0));
					
					if(VecDist<=10)
					{
						c1.v.y= (-1*((2*(VecDist))*(2*(VecDist))))+50;
					}
					else
					{
						c1.v.y= -360;
					}
				}
				else
				{
					c1.v.y = -360;
				}
				ent_setvertex(CurrSand,c1,i);
			}
		}
	}


I added a few lines of code after I modify the terrains to update the hull and it fixed the problem:
Code:
for(tx=0;tx<5;tx++)
	{
		for(ty=0;ty<5;ty++)
		{
			c_updatehull(Sand[tx][ty],1);
		}
	}




"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Terrains and Movement [Re: 3run] #378552
07/24/11 17:31
07/24/11 17:31
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Another question regarding movement and collision.
I want my player to glide around objects but never glide upwards (over hills). Is there any way to limit the glide along the z axis?

EDIT:
nevermind... I found it "disable_z_glide = 1;"

New Question;
My terrains have no feeling of depth, mainly because they have no shadow. I tried setting the SHADOW flag but it dosnt do anything. I think this is probably because I modify my terrains during runtime... Is there any way to get them to cast shadows on themselves again like pre-made terrains have?

Last edited by Carlos3DGS; 07/24/11 20:32.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Terrains and Movement [Re: Carlos3DGS] #378583
07/24/11 20:48
07/24/11 20:48
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
ent_fixnormals is one step. dropping shadows would need a shader, I don't think stencil shadows on terrain look good. static lighting is not available for modified meshes.

Re: Terrains and Movement [Re: Joey] #378587
07/24/11 21:46
07/24/11 21:46
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
ent_fixnormals fixed the problem. Thankyou very much!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1

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