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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood), 1,268 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_trace #319421
04/14/10 20:47
04/14/10 20:47
Joined: May 2006
Posts: 148
Latvia
MTD Offline OP
Member
MTD  Offline OP
Member

Joined: May 2006
Posts: 148
Latvia
Hi everyone,

Have a little problem with c_trace, hope that someone can help me.

First-
When I build a house on map, a check is made that no other house is in the way. (The check is made by c_trace: point-to-point)

The Scenario-
I build a house somewhere in the map and everything is OK, i start to build another house near the first build house and the second build house somehow traces the first house (even when it shouldn't trace it)
http://www.youtube.com/watch?v=oTXszAGLkuA

The Other Scenario-
When the first building is build and I build the second more away everything works OK.

Why is this happening?

Re: c_trace [Re: MTD] #319428
04/14/10 20:58
04/14/10 20:58
Joined: May 2006
Posts: 148
Latvia
MTD Offline OP
Member
MTD  Offline OP
Member

Joined: May 2006
Posts: 148
Latvia
Here is the code that traces the house ground

Click to reveal..

Code:
if(mouse_left==1)
{
	a=1;//start at the first vertex of the house
	nevar_celt=0;//Can i build a house here
	while(a<=5)//check if can build
	{
		b=a+1;//secodn traced vertex
		if(a>=5){b=1;}//Trace the first node, so that a square is traced
		vec_for_vertex(node_pos,building_name,a);
		vec_for_vertex(node_pos2,building_name,b);
		if(c_trace(node_pos,node_pos2,IGNORE_ME|IGNORE_PASSABLE)>=1||c_trace(node_pos2,node_pos,IGNORE_ME|IGNORE_PASSABLE)>=1)
		{
			nevar_celt=1;//can't build the house here
			set(building_name,LIGHT);
			building_name.green=0;
			building_name.blue=0;
			building_name.red=255;
			wait(-.1);
			reset(building_name,LIGHT);
		}
		a+=1;//Continue to the next vertex
		wait(1);
	}
}




Re: c_trace [Re: MTD] #319513
04/15/10 13:44
04/15/10 13:44
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
have a look at c_setminmax, i'm guessing that it's detecting the bounding box of the other house


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