Gamestudio Links
Zorro Links
Newest Posts
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
4 registered members (AndrewAMD, ozgur, AbrahamR, wdlmaster), 849 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse in 3D #327799
06/08/10 17:20
06/08/10 17:20
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Hey,

it is very simple but I cant figure it out. I already did it and it worked but when i use the same code it isnt working. The block is coming from a special point to me. it isnt using the mouse pos.

if(mouse_left == 1)
{
vec_set(to, mouse_dir3d);
vec_scale(to, 1000);
c_trace(camera.x, to, 0);
vec_set(to,target);
ent_create("block.mdl",to,NULL);
}

yes, simple as hell. But the point is when I start at nullvector, it is in the upper left corner of the screen.


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Mouse in 3D [Re: Liamissimo] #327802
06/08/10 17:34
06/08/10 17:34
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Do you have a plane within the range of 1000, that the trace can hit?

Re: Mouse in 3D [Re: Pappenheimer] #327804
06/08/10 17:37
06/08/10 17:37
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
no, the distance was 1400, now i changed it into scale 2000. Still downst work


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Mouse in 3D [Re: Liamissimo] #327814
06/08/10 18:11
06/08/10 18:11
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Have you locked the mouse position to the cursor? Do this in the main function/while loop.
Code:
while (1)
  {  
    mouse_pos.x = mouse_cursor.x;    
    mouse_pos.y = mouse_cursor.y;
    wait(1);
  }



Last edited by DJBMASTER; 06/08/10 18:11.
Re: Mouse in 3D [Re: DJBMASTER] #327849
06/08/10 20:33
06/08/10 20:33
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
doesnt work... sorry laugh

Code:
var schalten = 0;
function setzen()
{
	VECTOR to;
	while(1)
	{
		if(mouse_left == 1)
		{
		 	vec_set(to,mouse_dir3d);
 			vec_scale(to,2000); 
 			vec_add(to,mouse_pos3d);
 			c_trace(mouse_pos3d,to,USE_BOX | IGNORE_MODELS | IGNORE_SPRITES);
 			vec_set(to,target.x);
			if(schalten == 0)
			{
				ent_create("block.mdl",mouse_pos3d.x,NULL);
			}
		}
  	   wait(1);
	}
}
function scroller()
{
	var lastkey = 0;
	while(1)
	{
		if(mouse_right == 1 && schalten < 6)
		{
			schalten += 1*time_step/2;
		}	
		if(schalten >=6)
		{
			schalten = 0;
		}
		wait(1);
	}
}
PANEL* schalte_pan =
{
	pos_x = 0; pos_y = 0;
	layer = 1;
	digits(0,0,2,Arial#20b,1,schalten);
	flags |= (SHOW);
}
function main()
{
	mouse_mode = 4;
	video_set(1024,768,0,0);
	level_load("leer.wmb");
	wait(1);
	scroller();
	setzen();
	while (1)
 	{  
   	mouse_pos.x = mouse_cursor.x;    
   	mouse_pos.y = mouse_cursor.y;
   	wait(1);
  	}
}



Last edited by TheLiam; 06/08/10 20:33.

"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Mouse in 3D [Re: Liamissimo] #327870
06/08/10 22:41
06/08/10 22:41
Joined: Mar 2009
Posts: 42
Dominican Republic
keilyn3d Offline
Newbie
keilyn3d  Offline
Newbie

Joined: Mar 2009
Posts: 42
Dominican Republic
if what you want is create the block in the position of the wall or floor that you clicked change the ent_create line to this:
ent_create("block.mdl",hit.x,NULL);

Re: Mouse in 3D [Re: keilyn3d] #327945
06/09/10 13:12
06/09/10 13:12
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
OK genius, it works grin


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011

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