Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / detect mouse click on entity

Author
Message
space buddy
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location:
Posted: 23rd Dec 2007 00:45
Hi All,

I am using DarkAI and created a few enemy entities, I need to be able to click on an entity and detect which one it is. Does anyone know the command for this?

Thanks
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 23rd Dec 2007 15:18 Edited at: 23rd Dec 2007 15:26
actualy for AI there is not one... i believe though that in your standard dark basic pro commands you have something that allows you to select the objects. In fact it was in the 5.8 examples.

I will be back with the command.

EDIT

Here ya go

PICK OBJECT

This command will return the Object Number of the closest object at the specified screen coordinates. The objects that are tested
against the 2D coordinate are only those within the Object Start and Object End range in order to speed up specific tests. If no object
exists at the coordinate, a value of zero is returned. If an object number is returned, additional data will be generated and stored
internally. This extra data can be retrieved using the GET PICK VECTOR and GET PICK DISTANCE commands. Be aware that there may
be multiple cameras when picking objects. To make sure you are selecting the correct screen object, use the SET CURRENT CAMERA
command for the screen being rendered by that camera view. Do not use extreme camera range or object distances with this command,
as this increases the inaccuracy of the raycast line being used internally. You can specify an optional parameter to ignore the camera
orientation, which is usefulfor selecting objects that also ignore the influences of the camera.

Syntax

Return Integer=PICK OBJECT(Screen X, Screen Y, Object Start, Object End)
Return Integer=PICK OBJECT(Screen X, Screen Y, Object Start, Object End, Ignore Camera)

Login to post a reply

Server time is: 2024-05-08 23:15:05
Your offset time is: 2024-05-08 23:15:05