Jump to content

Line of sight - objects


tosfera

Recommended Posts

Posted

Hi,

I'm trying to see if I can get an interaction working with some objects. It's going quite good but, not every object will be returned as an object type. The processLineOfSight doesn't return an 'object' as type while hovering my mouse over it.

sample code from the wiki;

local w, h = guiGetScreenSize ()

local tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 50 )

local px, py, pz = getCameraMatrix()

hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz )

if hit then

outputChatBox ( "Looking at " .. x .. ", " .. y .. ", " .. z )

if elementHit then

outputChatBox ( "Hit element " .. getElementType(elementHit) )

end

end

So, is there any way to let your cursor or client or server to reconise these objects while creating a preocess line? ( it's about object; 2813, 2816, 2824 and a few more )

thanks

Posted
getPedTarget 

Edit:

Just re-read and post while not in zombie-mode. You'll want to take a look at the Editor since it returns the object ID when you're looking at it with your mouse.

Posted

That's the point, when you spawned these books ( obj 2813 for example ) you can't click on it to select it. That's why the game doesn't return an valid object either. Only way to remove these books would be CTRL+Z or the 'all elements' tab. :\

Posted

Correct me if I'm wrong, but while in the editor - when you press E, your crosshair should become red. Doesn't that help in selecting otherwise un-selectable objects?

Posted
Correct me if I'm wrong, but while in the editor - when you press E, your crosshair should become red. Doesn't that help in selecting otherwise un-selectable objects?

it does work with the E. What is this bind doing with the cursor in the editor? O_O

edit1; high_sensitivity_mode, I see. time to find out how to enable this by default :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...