Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (blaurock), 750 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse_ent causes me pain and agony (Fixed, thanks everyone!) #396170
03/03/12 16:41
03/03/12 16:41
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Hi,
I need to detect if the mouse pointer of a player is pointing at an entity, and if yes, what entity it is.
I've tried using mouse_ent with mouse_mode set to both 1 and 2. I've set mouse_range to ridiculously high values. However, I need to get really close to an entity for it to be detected (The distance from the surface of the entity is definetely less than 100 quants by the time it gets detected).
Can somebody help me out a little? Is there anything I forgot to do or need to keep in mind?

Cheers,
~TehV

Last edited by TehV; 03/06/12 06:53.
Re: mouse_ent causes me pain and agony [Re: TehV] #396194
03/03/12 21:28
03/03/12 21:28
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Show some code. Second the entity needs to be a decent amount wide to make them easy to pick.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: mouse_ent causes me pain and agony [Re: FoxHound] #396199
03/03/12 23:27
03/03/12 23:27
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Maybe you have invisible or translucent objects between the camera and the object?

Re: mouse_ent causes me pain and agony [Re: Lukas] #396202
03/04/12 00:51
03/04/12 00:51
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
... or panels with the UNTOUCHABLE flag not set?


Always learn from history, to be sure you make the same mistakes again...
Re: mouse_ent causes me pain and agony [Re: Uhrwerk] #396238
03/04/12 14:52
03/04/12 14:52
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
set mouse_range to be higher

Re: mouse_ent causes me pain and agony [Re: MrGuest] #396332
03/05/12 19:15
03/05/12 19:15
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
I don't have invisible entities spawned. All I have spawned is a few spheres at random positions (in a solar-system type arrangement) and they're pretty small, and all are visible. I've verified this.
I set mouse_range to ridiculously high values, ranging between 1000 and 10^7. The mouse_range seems to have no effect.
As to panels, I don't have any at the moment.

On a side note, I currently have no level loaded (only a blank one using level_load("");). Maybe that has an effect?

Edit: Thanks for the replies so far laugh
Edit 2: The entities spawned are a maximum of 30'000 units away from eachother. With a mouse_range of 10^5 I should be able to get all of them, no?

Last edited by TehV; 03/05/12 19:18.
Re: mouse_ent causes me pain and agony [Re: TehV] #396339
03/05/12 20:03
03/05/12 20:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Educated guess here,

But try putting this line somewhere that gets executed once a frame...
Code:
vec_set(mouse_pos, mouse_cursor);


Note: Both mouse_pos and mouse_cursor are system variables,
so put the line in EXACTLY as is.

Let us know how you go...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: mouse_ent caused me pain and agony - no longer the case [Re: EvilSOB] #396363
03/06/12 06:52
03/06/12 06:52
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Originally Posted By: EvilSOB
Educated guess here,

But try putting this line somewhere that gets executed once a frame...
Code:
vec_set(mouse_pos, mouse_cursor);


Note: Both mouse_pos and mouse_cursor are system variables,
so put the line in EXACTLY as is.

Let us know how you go...



That did it, works perfectly fine now. Thanks a bunch!

Re: mouse_ent caused me pain and agony - no longer the case [Re: TehV] #396365
03/06/12 07:04
03/06/12 07:04
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Coolio!


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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