mouse_ent causes me pain and agony (Fixed, thanks everyone!)

Posted By: TehV

mouse_ent causes me pain and agony (Fixed, thanks everyone!) - 03/03/12 16:41

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
Posted By: FoxHound

Re: mouse_ent causes me pain and agony - 03/03/12 21:28

Show some code. Second the entity needs to be a decent amount wide to make them easy to pick.
Posted By: Lukas

Re: mouse_ent causes me pain and agony - 03/03/12 23:27

Maybe you have invisible or translucent objects between the camera and the object?
Posted By: Uhrwerk

Re: mouse_ent causes me pain and agony - 03/04/12 00:51

... or panels with the UNTOUCHABLE flag not set?
Posted By: MrGuest

Re: mouse_ent causes me pain and agony - 03/04/12 14:52

set mouse_range to be higher
Posted By: TehV

Re: mouse_ent causes me pain and agony - 03/05/12 19:15

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?
Posted By: EvilSOB

Re: mouse_ent causes me pain and agony - 03/05/12 20:03

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...


Posted By: TehV

Re: mouse_ent caused me pain and agony - no longer the case - 03/06/12 06:52

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!
Posted By: EvilSOB

Re: mouse_ent caused me pain and agony - no longer the case - 03/06/12 07:04

Coolio!
© 2024 lite-C Forums