Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python

Notices

Reply
 
Thread Tools
Old Aug 09, 2007, 03:31 PM   #1
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,255
Question [Q] XY Coordinates on Map

Is there a way to get X/Y coordinates to show on the map in worldbuilder by any chance?? Thanks!
Ambreville is offline   Reply With Quote
Old Aug 09, 2007, 03:34 PM   #2
JeBuS27
Heretic
 
JeBuS27's Avatar
 
Join Date: Sep 2005
Posts: 321
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.
__________________
Addendum:
This is simply my opinion, and should not be taken as an attack or lible against any person. Use of basic reasoning skills and logic is recommended when reading my posts. No emotional inflection should be read into my posts, nor should any attitude, positive or negative, be inferred from my posts.
JeBuS27 is offline   Reply With Quote
Old Aug 09, 2007, 04:21 PM   #3
Zebra 9
Emperor
 
Zebra 9's Avatar
 
Join Date: May 2006
Location: Middle of Cyberspace
Posts: 1,554
I'll see if it's possible. It should be.
__________________
I'm Updating My MOD COMPs

Zebra 9 is offline   Reply With Quote
Old Aug 09, 2007, 04:28 PM   #4
JeBuS27
Heretic
 
JeBuS27's Avatar
 
Join Date: Sep 2005
Posts: 321
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.
__________________
Addendum:
This is simply my opinion, and should not be taken as an attack or lible against any person. Use of basic reasoning skills and logic is recommended when reading my posts. No emotional inflection should be read into my posts, nor should any attitude, positive or negative, be inferred from my posts.
JeBuS27 is offline   Reply With Quote
Old Aug 09, 2007, 05:07 PM   #5
NNCSavage
Chieftain
 
Join Date: Feb 2005
Posts: 24
I believe if you have WorldBuilder enabled - holding shift and mousing over the plot in question will show the x,y coords.
NNCSavage is offline   Reply With Quote
Old Aug 09, 2007, 05:12 PM   #6
JeBuS27
Heretic
 
JeBuS27's Avatar
 
Join Date: Sep 2005
Posts: 321
That only works when I'm not in WorldBuilder.
__________________
Addendum:
This is simply my opinion, and should not be taken as an attack or lible against any person. Use of basic reasoning skills and logic is recommended when reading my posts. No emotional inflection should be read into my posts, nor should any attitude, positive or negative, be inferred from my posts.
JeBuS27 is offline   Reply With Quote
Old Aug 09, 2007, 05:58 PM   #7
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,255
It doesn't seem to work in either modes for me...
Ambreville is offline   Reply With Quote
Old Aug 09, 2007, 06:50 PM   #8
NNCSavage
Chieftain
 
Join Date: Feb 2005
Posts: 24
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.

Last edited by NNCSavage; Aug 09, 2007 at 07:00 PM.
NNCSavage is offline   Reply With Quote
Old Aug 09, 2007, 07:45 PM   #9
JeBuS27
Heretic
 
JeBuS27's Avatar
 
Join Date: Sep 2005
Posts: 321
WB and console are not the same.
__________________
Addendum:
This is simply my opinion, and should not be taken as an attack or lible against any person. Use of basic reasoning skills and logic is recommended when reading my posts. No emotional inflection should be read into my posts, nor should any attitude, positive or negative, be inferred from my posts.
JeBuS27 is offline   Reply With Quote
Old Aug 10, 2007, 04:37 PM   #10
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,255
Quote:
Originally Posted by NNCSavage View Post
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...
Ambreville is offline   Reply With Quote
Old Nov 21, 2007, 08:10 PM   #11
wotan321
Emperor
 
wotan321's Avatar
 
Join Date: Oct 2001
Location: NC, USA
Posts: 1,104
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.
__________________
Freedom Exists!
wotan321 is offline   Reply With Quote
Old Dec 30, 2007, 09:36 AM   #12
CharlieM
Creative, Spiritual
 
CharlieM's Avatar
 
Join Date: Dec 2003
Location: Existential State
Posts: 260
Quote:
Originally Posted by wotan321 View Post
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?
__________________
"You must be the change you seek in the world." Gandhi
CharlieM is offline   Reply With Quote
Old Jan 04, 2008, 05:00 AM   #13
Dale
Deity
 
Dale's Avatar
 
Join Date: Mar 2002
Location: Melbourne
Posts: 6,481
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).
__________________
http://www.brrgames.com
Dale is offline   Reply With Quote
Old Sep 11, 2008, 07:27 AM   #14
none
si vis pacem para bellum
 
none's Avatar
 
Join Date: Sep 2008
Location: Nowhere
Posts: 154
Quote:
Originally Posted by Dale View Post
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:

Quote:
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.
__________________
War cannot be avoided; it can only be postponed to the other's advantage.

Last edited by none; Sep 11, 2008 at 07:31 AM.
none is offline   Reply With Quote
Old Sep 11, 2008, 07:11 PM   #15
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
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: %d %d" %(CyInterface().getMouseOverPlot().getX(), CyInterface().getMouseOverPlot().getY())
                CyInterface().addImmediateMessage(message,"")
##### Dale - WB X-Y Plot Show END
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground.
Silly monkeys, give them thumbs they make a club and beat their brother down.


BUG Mod - BTS Unaltered Gameplay
[ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ]

BAT 3.0.1 QuickFix™ released Oct 24th
EmperorFool is offline   Reply With Quote
Old Sep 11, 2008, 10:02 PM   #16
Dresden
Emperor
 
Dresden's Avatar
 
Join Date: Jul 2008
Posts: 1,081
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
Dresden is offline   Reply With Quote
Old Sep 11, 2008, 10:07 PM   #17
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
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).
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground.
Silly monkeys, give them thumbs they make a club and beat their brother down.


BUG Mod - BTS Unaltered Gameplay
[ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ]

BAT 3.0.1 QuickFix™ released Oct 24th
EmperorFool is offline   Reply With Quote
Old Sep 11, 2008, 10:22 PM   #18
Dresden
Emperor
 
Dresden's Avatar
 
Join Date: Jul 2008
Posts: 1,081
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.

Last edited by Dresden; Sep 11, 2008 at 10:37 PM.
Dresden is offline   Reply With Quote
Old Sep 11, 2008, 10:34 PM   #19
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
Quote:
Originally Posted by Dresden View Post
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. 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.
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground.
Silly monkeys, give them thumbs they make a club and beat their brother down.


BUG Mod - BTS Unaltered Gameplay
[ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ]

BAT 3.0.1 QuickFix™ released Oct 24th
EmperorFool is offline   Reply With Quote
Old Sep 11, 2008, 10:44 PM   #20
Dresden
Emperor
 
Dresden's Avatar
 
Join Date: Jul 2008
Posts: 1,081
In case you didn't catch my edit:
Quote:
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.
Dresden is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python > [Q] XY Coordinates on Map

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to shift a map's coordinates? initiael Civ4 - Creation & Customization 4 Jan 10, 2009 10:40 AM
How about geographic coordinates Dr.Pseikone Civ4 - Realism Invictus 4 Mar 06, 2007 01:38 PM
X - Y coordinates Komoda Civ3 - General Discussions 1 Apr 25, 2005 12:23 AM
Coordinates and Civ Aphex_Twin Civ3 - General Discussions 2 Jan 02, 2004 09:06 AM


Advertisement

All times are GMT -6. The time now is 11:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR