Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: C-trace, click to place an object [Re: binsky33333] #283239
08/06/09 17:38
08/06/09 17:38
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
The problem is, that you're calling the spawn function from within another while loop smile

You either need to call spawn(); from somewhere else (outside a loop), or just change function spawn like this:

Code:
entity* ghostobject;
var isObjectSpawn = 0;

function spawn()
{
	if(isObjectSpawned != 0) {return;}
	
	temp.x = mouse_pos.x;
	temp.y = mouse_pos.y;
	temp.z = 0;
	
	vec_set(target,temp);
	target.z = 10000;
	
	vec_for_screen(temp,view_build);
	vec_for_screen(target,view_build);
	
	if(c_trace(temp,target,IGNORE_ME | IGNORE_PASSABLE) > 0)
	{
		if(ghostobject == NULL)
		{
			ghostobject = ent_create("crate.mdl",target,NULL);
			ghostobject.transparent = on;
			ghostobject.passable = on;
			ghostobject.alpha = 30;
		}
		else
		{
			vec_set(ghostobject.x,target);
		}
		
		if(mouse_left)
		{
			ent_create("crate.mdl",target,null);
			
			isObjectSpawned = 1;
			
			if(ghostobject != NULL)
			{
				ent_remove(ghostobject);
			}
			
			while(mouse_left) {wait(1);}
			
			isObjectSpawned = 0;
		}
	}
}



Re: C-trace, click to place an object [Re: Claus_N] #283248
08/06/09 18:22
08/06/09 18:22
Joined: Dec 2008
Posts: 56
B
binsky33333 Offline OP
Junior Member
binsky33333  Offline OP
Junior Member
B

Joined: Dec 2008
Posts: 56
WOOOO!!!!! smile

Thanks dude soo mucch!!! it finally works! You truly are the best!

Re: C-trace, click to place an object [Re: binsky33333] #283249
08/06/09 18:24
08/06/09 18:24
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
I'm glad to hear that it's working now wink

Page 3 of 3 1 2 3

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