Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Alternative to c_content? [Re: Xarthor] #285620
08/19/09 10:41
08/19/09 10:41
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
ENABLE_PUSH, and using an event?

that's how i check if my entity is inside something (a trigger in this case).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Alternative to c_content? [Re: Helghast] #285624
08/19/09 11:13
08/19/09 11:13
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline OP
Expert
Puppeteer  Offline OP
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Okay my basic problem is this which appears in some cases:
Demo:
http://romania.g0dsoft.com/upload/bug.rar (29KB)

Code:
Code:
var temp_vec[3],temp_vecb[3];
	vec_set(temp_vec,vector(-98,0,0));
	vec_set(temp_vecb,vector(-108,0,0));
	while(c_trace(temp_vecb,temp_vec,IGNORE_MODELS)==0)
	{
		vec_set(temp_vecb,temp_vec);
		temp_vec[0]+=10;
		ent_create("cube.mdl",temp_vec,NULL);
		wait(-0.1);
	}



But i already found a workaround. Instead of using c_content to check wether the target pos. is a block or not i can check trace_hit.
This solves a part of my problem (even though i have to do some ugly coding now)
So the basic problem was:

If i have a c_trace that accidentally exacly touches a wall the result is 0
And if start a new trace without checking tracehit the trace goes right through walls (This is i think a bug since the result is ==0)

Whats still left is:
I have a function that should find an empty space position in a certain area.
I planned to get the position by checking with c_content until i find a CONTENT_EMPTY position. But since c_content shouldnt be used anymore i need an alternative.

EDIT: This is what i use atm instead of c_content:
Code:
function _c_content(VECTOR* check_vec,trace_mode)
{
	var temp_vec[3],val=1,dist,distb;
	vec_set(temp_vec,check_vec);
	temp_vec[0]-=val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	temp_vec[0]=check_vec.x+val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	temp_vec[0]=check_vec.x;
	temp_vec[1]=check_vec.y-val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	temp_vec[1]=check_vec.y+val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	temp_vec[1]=check_vec.y;
	temp_vec[2]=check_vec.z-val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	temp_vec[2]=check_vec.z+val;
	if(c_trace(temp_vec,check_vec,trace_mode)!=0)
	return(1);
	return(0);
}


val shouldnt be smaller than 1 because then the function makes "mistakes"...

Last edited by Puppeteer; 08/19/09 13:19.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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