Page MenuHomeFeedback Tracker

[Feature Request] Alternative syntax for screenToWorld
New, NormalPublic

Description

It would be nice to have the extended syntax of the screenToWorld scripting command from VBS.
Alternative syntax allows the determination of any position on the screen, by defining its distance from the camera:

screenToWorld [X, Y, distance]

Params:

  • X: Number - X-coordinate of 2D screen position.
  • Y: Number - Y-coordinate of 2D screen position.
  • distance: Number - Distance from the camera, extended in the direction the camera is looking.

Returns end-position of a virtual line with the specified length (distance), starting at the camera, and ending at the defined screen position. Any ground or objects in the path are ignored.

Sample:

_mouse = getMousePosition;
_pos = screenToWorld [_mouse # 0, _mouse # 1, 10];

someObj setPosAGL _pos; //Setting the position of someObj 10 m in front of the player relative to the mouse position

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Feature Request

Event Timeline

ostello created this task.Dec 16 2020, 5:48 PM
ostello renamed this task from Alternative syntax for screenToWorld to [Feature Request] Alternative syntax for screenToWorld.Dec 16 2020, 5:51 PM