[Q] XY Coordinates on Map

I would also like to know if there's a way to find the coordinates of a plot in the WB. I usually end up getting out of WB to find the coordinate then going back in, which is a pain in the neck after a while.
 
Well, I've not done any UI modding, but I imagine it shouldn't be impossible to display a line of text somewhere that tells where the cursor is pointed.
 
I believe if you have WorldBuilder enabled - holding shift and mousing over the plot in question will show the x,y coords.
 
That only works when I'm not in WorldBuilder.
 
I guess I should say that by WorldBuilder I meant if I turn the cheats on (CheatCode = chipotle) the shift function works for me.
With cheats enabled and I hit Ctrl-W it doesnt show there.
Ctrl-Q to toggle back out and it's back to working.
I went and tested and if I change the .ini back to "CheatCode = 0" i get nothing when pressing shift.
 
WB and console are not the same. ;)
 
I guess I should say that by WorldBuilder I meant if I turn the cheats on (CheatCode = chipotle) the shift function works for me.
With cheats enabled and I hit Ctrl-W it doesnt show there.
Ctrl-Q to toggle back out and it's back to working.
I went and tested and if I change the .ini back to "CheatCode = 0" i get nothing when pressing shift.

Maybe I'm speaking in a foreign language here, but I tried your approach and saw no coordinates anywhere...
 
Did anyone figure out how this works? I can go back and forth in and out of worldbuilder, and the ONLY time I see plot info down in the lower left is when I am OUTSIDE worldbuilder, when the world is still covered in darkness.... pretty darned useless then! Any way to reveal the whole map? Or get the plot info while in worldbuilder where the world is revealed?

Any help is appreciated.
 
Did anyone figure out how this works? I can go back and forth in and out of worldbuilder, and the ONLY time I see plot info down in the lower left is when I am OUTSIDE worldbuilder, when the world is still covered in darkness.... pretty darned useless then! Any way to reveal the whole map? Or get the plot info while in worldbuilder where the world is revealed?

Any help is appreciated.

I would LOVE to know the answer to this. Any way to reveal X/Y coordinates in the World Builder?
 
Well, the SIMPLEST way is to edit ..\Assets\Python\Screens\CvWorldBuilderScreen.py

Find the function mouseOverPlot and add the following code:

Code:
	def mouseOverPlot (self, argsList):
				
##### Dale - WB X-Y Plot Show START
                message = "Plot: %s %s" %(CyInterface().getMouseOverPlot().getX(), CyInterface().getMouseOverPlot().getY())
                CyInterface().addImmediateMessage(message,"")
##### Dale - WB X-Y Plot Show END

This put the plot x, y in the message area (you may have to move a window to view it correctly).
 
Well, the SIMPLEST way is to edit ..\Assets\Python\Screens\CvWorldBuilderScreen.py

Find the function mouseOverPlot and add the following code:

Code:
	def mouseOverPlot (self, argsList):
				
##### Dale - WB X-Y Plot Show START
                message = "Plot: %s %s" %(CyInterface().getMouseOverPlot().getX(), CyInterface().getMouseOverPlot().getY())
                CyInterface().addImmediateMessage(message,"")
##### Dale - WB X-Y Plot Show END

This put the plot x, y in the message area (you may have to move a window to view it correctly).

I tried to do that but I didn't succeed (it didn't show but I'm not sure I added the code at the right place).

Here's what I've got:

def mouseOverPlot (self, argsList):
if (self.m_bReveal):
if (self.m_pCurrentPlot != 0):
self.showMultipleReveal()
self.m_pCurrentPlot = CyInterface().getMouseOverPlot()
if (CyInterface().isLeftMouseDown() and self.m_bLeftMouseDown):
self.setMultipleReveal(True)
elif(CyInterface().isRightMouseDown() and self.m_bRightMouseDown):
self.setMultipleReveal(False)
else: #if ((self.m_tabCtrlEdit == 0) or (not self.m_tabCtrlEdit.isEnabled())):
self.m_pCurrentPlot = CyInterface().getMouseOverPlot()
self.m_iCurrentX = self.m_pCurrentPlot.getX()
self.m_iCurrentY = self.m_pCurrentPlot.getY()
if (CyInterface().isLeftMouseDown() and self.m_bLeftMouseDown):
if (self.useLargeBrush()):
self.placeMultipleObjects()
else:
self.placeObject()
elif (CyInterface().isRightMouseDown() and self.m_bRightMouseDown):
if (not (self.m_bCityEdit or self.m_bUnitEdit)):
if (self.useLargeBrush()):
self.removeMultipleObjects()
else:
self.removeObject()
return


Is there any other way to get coordinates for placing starting points for different civs (using the notepad) when editing a map?

I'd sure would appreciate some help with that. Thanks.
 
I think the problem is in the string formatting. Integers (X and Y coordinates) need "%d" instead of "%s". Try this:

Code:
	def mouseOverPlot (self, argsList):
				
##### Dale - WB X-Y Plot Show START
                message = "Plot: [B]%d %d[/B]" %(CyInterface().getMouseOverPlot().getX(), CyInterface().getMouseOverPlot().getY())
                CyInterface().addImmediateMessage(message,"")
##### Dale - WB X-Y Plot Show END
 
This is a neat idea; I'm glad this topic was bumped. ;) I went the following way with mine, using a similar approach as BUG's NJAGC implementation.

Code:
	def mouseOverPlot (self, argsList):
		szText = "Plot: (%d, %d)" %(CyInterface().getMouseOverPlot().getX(), CyInterface().getMouseOverPlot().getY())
		screen = CyGInterfaceScreen( "WorldBuilderScreen", CvScreenEnums.WORLDBUILDER_SCREEN )
		screen.setLabel( "WBCoords", "Background", szText, CvUtil.FONT_CENTER_JUSTIFY, screen.getXResolution()/2, 6, -0.3, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		# rest of function unchanged
 
Nice touch switching it to a static text label vs. flooding the message queue. Aren't the plot's coordinates sent in argsList? If you want to see, use %r to dump argsList in list form or %s with str(argsList).
 
The rest of that function does stuff like this (inside an else block so the vars are not always set)
Code:
			self.m_pCurrentPlot = CyInterface().getMouseOverPlot()
			self.m_iCurrentX = self.m_pCurrentPlot.getX()
			self.m_iCurrentY = self.m_pCurrentPlot.getY()
so I never even thought to look if the coords were in the args list. Probably a good idea to check though.

EDIT: argsList contains a single argument. I have no idea what the argument is, but it isn't coordinates or even a plot index. On a quick test, it was a constant "23" regardless of what plot I was mousing over.
 
I never even thought to look if the coords were in the args list. Probably a good idea to check though.

Oh I wouldn't be surprised if they weren't in there. :crazyeye: I've been accused of premature optimization more than a few times, but that doesn't seem to stop me. ;) In this case it's more a matter of curiosity.
 
In case you didn't catch my edit:
argsList contains a single argument. I have no idea what the argument is, but it isn't coordinates or even a plot index. On a quick test, it was a constant "23" regardless of what plot I was mousing over.
 
Top Bottom