It does not matter which order I click the buttons, the stability map simply does not work. For the city names, when I hover over a tile it gives me these widget errors.
The maps are in the Info advisor screen, you are looking in the civilopedia.
(The Info advisor is the one with the demographics screen and top-5-cities and wonders screen)
No no I know, it's just when I click F12 to take the screenshot in steam it opens the pedia as well But everything I said still applies. The widget error message is given at the top of the screen,
Can you explain how you did city names in the tile tooltip? I don't think I was ever aware that you had this feature, and I was always under the impression it can only be modified from the DLL.
Can you explain how you did city names in the tile tooltip? I don't think I was ever aware that you had this feature, and I was always under the impression it can only be modified from the DLL.
All maps are basically created the same. I have 1 base map image and several small, different colored images. These small images are basically a colored square, exactly the size of 1 tile of the base map.
Flipzone maps and Stability maps:
Similar to your script, I determine what type (=color) each tile is. (In fact, I took most of your code and made some adjustments to it) If the tile is "special" (e.g. in flipzone, historical etc) I place a small image on top of the base image. (It's an image on top of another images basically)
So you are actually looking at 100+ small images on top of 1 large base image.
CNM:
What I basically do, is placing a lot of transparent images on the map. Each image resembles 1 tile. I use the BUG WidgetUtil (also used for the button of the Byzantine and Aztec UP) to get a hoovering label which contains the name for each image/tile.
To get the name, the CNM needs 2 things: coordinates and a civ. I use a custom CNM (called dcnm, d for dummy) to avoid problems with respawn civs like Maya-Colombia. There is a constant in dcnm which is the selected civ. Upon selecting a civ, that constant in changed to the new selected civ.
When creating all transparent images, I gave each images 2 tags. The first (iData1) is used to get a hoovering text by the WidgetUtil. The second contains the coordinates. (1 integer that contains to integers )
Spoiler:
Code:
def drawCNMMaps(self):
for x in range(con.iWorldX):
for y in range(con.iWorldY):
plot = gc.getMap().plot(x, y)
if plot.isWater() or plot.isPeak(): continue
self.drawCNMTile(x, y)
def drawCNMTile(self, iX, iY):
screen = self.getScreen()
iScreenX = self.X_STABILITY_MAP + iX *5
iScreenY = self.Y_STABILITY_MAP + self.H_STABILITY_MAP - iY * 5 - 5
ArtKey = "Art/Interface/StabilityMaps/Color6.dds"
iNumXY = iX*100+ iY
screen.addDDSGFC(self.getNextCNMWidgetName(), ArtKey, iScreenX, iScreenY, 5, 5, WidgetTypes.WIDGET_GENERAL, 10003, iNumXY)
The WidgetUtil adds a hoovering label to all images with iData1 == 10003. (Which are all transparent tile images) To get the text for the label, it uses my dcnm. It breaks down iData2 to get the coordinates again and uses them to get a name for that coordinates. As the selected civ is already known by the dcnm, only the coordinates are enough to get a name.
Spoiler:
Code:
#Merijn: Returns the CNM of a tile
if iData1 == 10003:
iX = iData2 / 100
iY = (iData2 - (iX * 100))
szName = dcnm.getFoundName((iX, iY))
return CyTranslator().getText(str(szName), ())
"Error in WidgetUtil callback handler getWidgetHelp" when clicking on TXT_KEY_CNM
Clicking on stability maps does nothing except making 2 new buttons appear: show foreign core, extender core N/A. Clicking them does nothing.
As soon as another civ is selected with the drop down list button both "show foreign core" and "exnteded core N/A" buttons disappear and they won't appear anymore until I close the info screen and open it again.
You could try to redownload the modcomp. I remember I had similar problems when coding it. Maybe you have an old version in which those bugs were still around or your download was corrupted.
You shouldn't get any TXT_KEY_CNM in the first place. That key should be replaced with a proper text.
You could try to redownload the modcomp. I remember I had similar problems when coding it. Maybe you have an old version in which those bugs were still around or your download was corrupted.
You shouldn't get any TXT_KEY_CNM in the first place. That key should be replaced with a proper text.
A modcomp (fully: mod component) is a (optional) component that is an addition to a mod, specifically made for that mod. It adds something to the main mod. You can consider them as a kind of plugin.
In this case, it adds a tool to view certain maps from within the game.
Small code update. (Easier handling of secondary civs)
Harappa included. (Technically, it was already included. But now it's core won't show up as foreign if it's not enabled)
Sorry to bump such an old post, but this was a really cool feature. If it's compatible with the most recent versions, could it maybe be stickied? Or possibly integrated into the main mod (if that's not too much trouble)?
Anyway, it will be incorporated in the main version soon. The WB will get a feature to edit the stabilitymaps. Obviously, the stabilitymapviewer will be a part of that. (In fact, the viewer part is already done)
Anyway, it will be incorporated in the main version soon. The WB will get a feature to edit the stabilitymaps. Obviously, the stabilitymapviewer will be a part of that. (In fact, the viewer part is already done)
Awesome! I reinstalled DoC a while ago and lost the viewer. I really missed it and had to go searching the old threads to find the link again. Glad to hear it's being added.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.