Scrocco88 1 Posted June 25, 2013 (edited) How can i get the location pointed by a player? Something like the ( ) cursor when using support modules. Tried with cursorTarget but it works only if targeting some object, not working if pointing at ground. Thanks Edited June 25, 2013 by Scrocco88 Share this post Link to post Share on other sites
samatra 85 Posted June 25, 2013 http://community.bistudio.com/wiki/posScreenToWorld http://community.bistudio.com/wiki/screenToWorld One of these should be a solution for you Share this post Link to post Share on other sites
Scrocco88 1 Posted June 29, 2013 Thank you, it worked. PS. I've been playing on your wasteland servers these days.... i really love your work! :D Share this post Link to post Share on other sites
Scrocco88 1 Posted July 1, 2013 (edited) im using this to get the pointer position: (findDisplay 46) displayAddEventHandler ["MouseMoving","cursorPos=screenToWorld [_this select 1, _this select 2];hint format ['%1',cursorPos];"]; but it seems working only after a first Restart of my mission. What am i doing wrong? Do i need to waitUntil some library before using it? Edit: Actually it works only with a very short distance... if i try to look at something distant a get coordinates much more far away then the real point :( Edited July 1, 2013 by Scrocco88 Share this post Link to post Share on other sites
f2k sel 164 Posted July 1, 2013 it's starting too soon is all. waitUntil {!isNull(findDisplay 46)}; (findDisplay 46) displayAddEventHandler ["MouseMoving","cursorPos=screenToWorld [_this select 1, _this select 2];hint format ['%1',cursorPos];"]; ---------- Post added at 10:55 PM ---------- Previous post was at 10:45 PM ---------- it's starting too soon is all. waitUntil {!isNull(findDisplay 46)}; (findDisplay 46) displayAddEventHandler ["MouseMoving","cursorPos=screenToWorld [_this select 1, _this select 2];hint format ['%1',cursorPos];"]; the distance problem is probably because it doesn't see obstructions so anything above ground level goes to the max distance. Share this post Link to post Share on other sites
Scrocco88 1 Posted July 1, 2013 The point returned is always the same point, in the upper-left part of the screen. And it's exactly the (0,0) point of the GUI EDITOR grid. Share this post Link to post Share on other sites
f2k sel 164 Posted July 1, 2013 Is this what your after while {true} do { _pos = screenToWorld [0.5,0.5]; if (!isnull cursortarget) then { _pos = getpos cursortarget }; sleep 0.1; hint format ["%1",_pos]; }; [0.5,0.5]; is the center of the screen I use cursortarget to find buildings other wise it looks through them Share this post Link to post Share on other sites