Author Topic: Get cursor location on map?  (Read 423 times)

Legacy_AndrueD

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +0/-0
Get cursor location on map?
« on: February 01, 2016, 10:49:16 pm »


               

Is a key like Baldur Gate "L" or "X" that work for NWN while playing to find x,y location at cursor?  If not built into game, can some way be done to get that?  I check all console codes but none that give location so am thinking maybe special code needed to do simple thing.


 


tyvm for any help



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Get cursor location on map?
« Reply #1 on: February 01, 2016, 11:12:22 pm »


               It's possible to script a quickslot (and therefore its associated hotkey) to report the player's location in debug mode.


You can also script a unique power item or player tool to do the same thing in normal gameplay.


How would you use the information?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Get cursor location on map?
« Reply #2 on: February 02, 2016, 12:42:46 am »


               

its not there because the game works on client-server architecture.


 


It would be possible to get this info in singleplayer with usage of NWNCX but not much doable in multiplayer.


 


However whatever you need this for I would bet you can do it a bit differently without need for cursor location.



               
               

               
            

Legacy_AndrueD

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +0/-0
Get cursor location on map?
« Reply #3 on: February 02, 2016, 01:48:14 am »


               

Getting location in-game help to set placeables.  Many time what look right on toolset map donna work out right when play it. Some time easy for player to get caught behind placeable but if could set where cursor shows, would be perfect place for object.  Some elevation not easy to spot in toolset either and placeable look stupid. Take very long to change a bit, test play, move some more, over and over.  Same thing for setting NPC walk route.  Easier to figur each WP when looking in game.  Test play always SP.  Not trying to do when on server.


 


Dinna know about what Shadooow say.  That explain why not built in then.


 


 



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Get cursor location on map?
« Reply #4 on: February 02, 2016, 02:02:47 am »


               


Getting location in-game help to set placeables.  Many time what look right on toolset map donna work out right when play it. Some time easy for player to get caught behind placeable but if could set where cursor shows, would be perfect place for object.  Some elevation not easy to spot in toolset either and placeable look stupid. Take very long to change a bit, test play, move some more, over and over.  Same thing for setting NPC walk route.  Easier to figur each WP when looking in game.  Test play always SP.  Not trying to do when on server.


 


Dinna know about what Shadooow say.  That explain why not built in then.




if this is what you want then you can use dm/pc tools for that, these feats are instant - you can use one of those feats as a cursor location marker. Using the feat will activate cursor with active which you can use on ground, then you can use others feat to create something on the location stored. It can be done even backwards - first set up what you want to do, then when you use locaton marker you can instantly do it.


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Get cursor location on map?
« Reply #5 on: February 02, 2016, 09:46:24 am »


               

Getting location in-game help to set placeables.  Many time what look right on toolset map donna work out right when play it. Some time easy for player to get caught behind placeable but if could set where cursor shows, would be perfect place for object.  Some elevation not easy to spot in toolset either and placeable look stupid. Take very long to change a bit, test play, move some more, over and over.  Same thing for setting NPC walk route.  Easier to figur each WP when looking in game.  Test play always SP.  Not trying to do when on server.


I've never had much of a problem using the toolset. To see exactly what's going on, I have a mouse with a wheel. Hold wheel to tilt the view, turn wheel to zoom, CTRL-left-button-drag to pan.

That should show you exactly where placeables and waypoints are. R-click > AdjustLocation to fine tune. Unlike creatures, these objects spawn exactly where you place them.

I can't imagine determining in-game coordinates for every placeable. It would take too long. However, for occasional use, you can get the position of the player in SP in debug mode using the dm_runscript console command:
 
void main()
{
  object oPC     = GetFirstPC();

  SendMessageToPC(oPC, LocationToString(GetLocation(oPC)));
}
Here's a tutorial on how to make a player tool.

In your case, you'll need TARGET_SELF to be **** and Target Type 0x03 (area / ground).

When you use the tool, point the cursor to the desired location and click, it will return the location. In the final script in the tutorial, you'll need to uncomment the line that sets lTarget, and add this line to report the location:
 
SendMessageToPC(oPC, LocationToString(lTarget));
instead of the line that starts a conversation.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Get cursor location on map?
« Reply #6 on: February 02, 2016, 12:57:27 pm »


               

Not sure if its whats needed, but if you are looking to get the location of a point on the ground, you can use the PlayerTool feats, and script one of them to tell you the X,Y,Z of the GetSpellTargetLocation();


 


That's basically the 'cursor position at a moment in time'