DankanX37 29 Posted July 29, 2018 I'm trying to make a custom CAS Support, the problem is that I am not able to return the cursor position, I've tried both cursorTarget and cursorObject, but when I am not facing a target it return object nul, if I get the position of where I am facing it returns [0,0,0], is there a way to return the position of the cursor? 2 Share this post Link to post Share on other sites
gc8 970 Posted July 29, 2018 Yeah I think _wPos = screenToWorld [0.5,0.5]; does that Wiki: "Returns the position on landscape (PositionAGL) corresponding to the given point on screen (in UI coordinates)." 1 Share this post Link to post Share on other sites
the_one_and_only_Venator 162 Posted July 29, 2018 7 hours ago, gc8 said: Yeah I think _wPos = screenToWorld [0.5,0.5]; does that Wiki: "Returns the position on landscape (PositionAGL) corresponding to the given point on screen (in UI coordinates)." Yeah that should do it, Do you know a way of doing the same when using the map? So get the cursor coordinates on map screen into position? Share this post Link to post Share on other sites
7erra 629 Posted July 29, 2018 _worldCoord = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld getMousePosition; https://community.bistudio.com/wiki/ctrlMapScreenToWorld https://community.bistudio.com/wiki/getMousePosition 3 1 Share this post Link to post Share on other sites
gc8 970 Posted July 30, 2018 9 hours ago, the_one_and_only_Venator said: Yeah that should do it, Do you know a way of doing the same when using the map? So get the cursor coordinates on map screen into position? If you want map click position there is onMapSingleClick command. Share this post Link to post Share on other sites
DankanX37 29 Posted July 30, 2018 _wPos = screenToWorld [0.5,0.5]; this works well 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted July 30, 2018 Hello there DankanX37 ! This way it will give you the enemy. _target = cursorTarget; _displayname = getText (configFile >> "cfgVehicles" >> typeOf _target >> "displayname"); _information = format ["%1",_displayname]; Share this post Link to post Share on other sites
DankanX37 29 Posted July 30, 2018 Thanks for all the answers. 1 Share this post Link to post Share on other sites
bcon117 12 Posted February 19, 2019 Related question for you guys: How do I get the exact cursor position as you would for the basic "suppress" command. If I order a team member to suppress a target with vanilla actions, he will blast the exact spot I aimed at, not a cursorTarget or Object. How do I find that position and make him shoot at it the same way, but by script? screenToWorld and the others don't seem to work in this regard. What I'm doing is having an assaultman shoot a rocket, which he does by removing primary weapon and suppressing. But I'm trying to do it through a single Ace action instead of having to find him and go through the action menu. So basically just point and shoot that spot. cursorTarget just has him aim at the base of a building, which for my purposes does not work. Maybe you've covered it already here but I can't seem to connect the dots. Thanks guys Share this post Link to post Share on other sites
HazJ 1288 Posted February 19, 2019 Me and @Tankbuster needed a similar solution. screenToWorld always gives 0 for surface. Made a little hacky work around. I know this isn't exactly what you are after but thought I'd share anyway. I'm sure Tank will share his input on what we use it for. Debug: [] spawn { _ctrl = findDisplay 46 ctrlCreate ["RscPicture", 31357]; _ctrl ctrlSetPosition [0.48, 0.4799, 0.04, 0.04]; _ctrl ctrlSetText "\A3\ui_f\data\map\markers\military\destroy_CA.paa"; _ctrl ctrlSetTextColor [1, 0, 0, 1]; _ctrl ctrlCommit 0; }; Probably a better way to do this but couldn't figure it out with drawIcon3D. https://i.imgur.com/st8WiDn.jpg https://i.imgur.com/9MgscfK.jpg 3 Share this post Link to post Share on other sites
bcon117 12 Posted February 19, 2019 Hmm, tried it. that's pretty cool. Thanks for sharing. Might use it. How do I delete that marker after spawning it? So like, once I set the target? Sorry, I'm still pretty new to this. As for the "suppress exact spot" concept, I feel like it should be pretty straight forward. It's been in the game for awhile. Figured the syntax has got be posted somewhere.. Share this post Link to post Share on other sites
HazJ 1288 Posted February 19, 2019 11 minutes ago, bcon117 said: Hmm, tried it. that's pretty cool. Thanks for sharing. Might use it. How do I delete that marker after spawning it? So like, once I set the target? Sorry, I'm still pretty new to this. As for the "suppress exact spot" concept, I feel like it should be pretty straight forward. It's been in the game for awhile. Figured the syntax has got be posted somewhere.. https://community.bistudio.com/wiki/ctrlDelete 31357 is the IDC. I recommend not using display #46. It was just a quick example/test in debug. 1 Share this post Link to post Share on other sites