Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,296 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse_ent #256594
03/17/09 17:58
03/17/09 17:58
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
Hello,
Can anyone explain, how does mouse_ent function exactly work?
Or even better, can anyone say, why this bit of code doesnt work?
Code:
while(1)		
{		mouse_pos.x = mouse_cursor.x;    
		mouse_pos.y = mouse_cursor.y;
		
		if(mouse_ent)
	a=1;
	else
	a=0;
		wait(1);
	}


this should set variable a to 1, if mouse pointer is on any entity. Variable is watched on panel
Code:
digits(25, 5, "%1.f", *, 1, a);


It works when the position of the entity is (0,0,0), but when it is placed somewhere else, variable a is still 0, even when the pointer is on this entity.

What am I doing wrong?

Re: mouse_ent [Re: wolodo87] #256598
03/17/09 18:05
03/17/09 18:05
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
There is a command like mouse_range. The mouse_ent command just works within this value. I think 1000 by default. Just set the value to 9000 or such and test it then.



Re: mouse_ent [Re: Nicotin] #256601
03/17/09 18:12
03/17/09 18:12
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
mouse_range is right, and when deciding what number to use, take into account
the expected distance in world co-ordinate units between the camera's
XYZ position to the entities XYZ position.
(ie how far "behind" the screen the entity is)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: mouse_ent [Re: wolodo87] #256609
03/17/09 18:25
03/17/09 18:25
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
mouse_range was the solution. But what it exactly means? For example 2000 means 2000 quants from point 0,0,0?

Re: mouse_ent [Re: wolodo87] #256621
03/17/09 19:30
03/17/09 19:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
2000 quants from the camera's XYZ position to the entities XYZ position.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: mouse_ent [Re: EvilSOB] #256623
03/17/09 19:42
03/17/09 19:42
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
Originally Posted By: EvilSOB
2000 quants from the camera's XYZ position to the entities XYZ position.


this makes sense to me. finaly smile thanks for help to both of you.


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