1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Stability Maps in the Info Advisor

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by merijn_v1, Dec 18, 2014.

  1. alpav

    alpav Prince

    Joined:
    Mar 29, 2011
    Messages:
    512
    Location:
    Vojvodina
  2. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    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)
     
  3. alpav

    alpav Prince

    Joined:
    Mar 29, 2011
    Messages:
    512
    Location:
    Vojvodina
    No no I know, it's just when I click F12 to take the screenshot in steam it opens the pedia as well :p But everything I said still applies. The widget error message is given at the top of the screen,
     
  4. zinedine

    zinedine Chieftain

    Joined:
    Mar 18, 2015
    Messages:
    63
    i have the stability maps in my 1.12 standard rfc doc mod, but I get widget errors for everything besides flip zones.:(
     
  5. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    Do you have screenshots?
    (I suggest we continue this in the thread belonging to the ingame maps)

    Moderator Action: Moved the posts - Leoreth
     
  6. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,202
    Gender:
    Male
    Location:
    Leblanc
    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.
     
  7. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    New version with an updated base map (India changes) is up.

    No other changes.
    - Small bugfix
     
  8. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    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 :crazyeye:)

    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), ())
     
  9. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,202
    Gender:
    Male
    Location:
    Leblanc
    Cool, thanks.
     
  10. calad

    calad Emperor

    Joined:
    Jul 26, 2012
    Messages:
    1,377
    This is the best modmodmod after sliced bread.
     
  11. zinedine

    zinedine Chieftain

    Joined:
    Mar 18, 2015
    Messages:
    63
    "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.

    using 1.12 standard
     
  12. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    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.
     
  13. zinedine

    zinedine Chieftain

    Joined:
    Mar 18, 2015
    Messages:
    63

    redownloaded, from the link in the first page, same problem.

    what is modcomp? I thought this mod was standalone, just copy paste in rfc dawn of civ.
     
  14. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    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.
     
  15. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    Small update:

    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)
     
  16. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    New version is up:

    Added a zoom function
    Added a grid function (This disables the option to see the owner of foreign cores/ contested territory however)
     
  17. MechatronicJazz

    MechatronicJazz Warlord

    Joined:
    Aug 15, 2007
    Messages:
    232
    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)?
     
  18. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    It should be compatible with the latest version.

    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)
     
  19. MechatronicJazz

    MechatronicJazz Warlord

    Joined:
    Aug 15, 2007
    Messages:
    232
    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. :)
     
  20. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,613
    Location:
    The city of the original vlaai
    The 2nd post of the Forum thread index has a link to all modcomp, modmods etc., if you loose it again. ;)
     

Share This Page