1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Modder's Guide to A New Dawn

Discussion in 'Rise of Mankind: A New Dawn' started by Afforess, Dec 2, 2009.

  1. Zeta Nexus

    Zeta Nexus Chieftain

    Joined:
    Jan 23, 2014
    Messages:
    2,476
    Location:
    In a constant brainstorm...
    Anyone knows if the AI is aware of the advantages of civic buildings? Does it take into account the bonuses of the civic building too when changing civic?
     
  2. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
    I think it should but I haven't checked that part of the code. One problem might be anyway that value assigned to those buildings might not be in scale with other buildings and units because lot of things have changed since that part of the code was written. So AI might end up not using them enough, not because it doesn't know how to use them, but because it gives priority to other units/buildings.
     
  3. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
    Of course no problem for me.
     
  4. Zeta Nexus

    Zeta Nexus Chieftain

    Joined:
    Jan 23, 2014
    Messages:
    2,476
    Location:
    In a constant brainstorm...
    I asked because in my games AI seems to love Exploration civic too much. It had a big production bonus on some units - I think the AI values this too much.
    Than I changed the civic significantly reducing its bonuses by moving those prod. bonuses to the civic building, which is needs nothing else, but the civic. But in my test games AI still prefers this civic instead of the better ones.
     
  5. Arkatakor

    Arkatakor Chieftain

    Joined:
    Mar 11, 2006
    Messages:
    556
    Gender:
    Male
    Location:
    Stockholm, Sweden
    Thank you.
     
  6. nionios

    nionios Chieftain

    Joined:
    Sep 29, 2013
    Messages:
    385
    Maybe a silly question:
    This mod modifies some files (filetype .cpp) in the folder of BTS vanilla which in sourceforge is described as Sources folder.If I want to play again BTS vanilla or another mod does it mean that I have to use again the original vanilla .cpp files?Does the uninstallation of the mod restore the original files?
     
  7. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
    The mod doesn't alter those files in any way. And they have no influence in game because those are the files that are compiled into the dll.

    Edit: wait, don't tell me you've overwritten those files copying the source folder from the mod! If so, you have to restore them from a clean installation if you really need them. But they're really only needed for dll modding and have no impact in game.
     
  8. nionios

    nionios Chieftain

    Joined:
    Sep 29, 2013
    Messages:
    385
    @45°38'N-13°47'E:
    Maybe I misunderstand something or I don't get you.
    Look,for example:
    In sourceforge for REV 1028 it changes the file CvCity.cpp.Isn't it in the vanilla "bts" folder?
    Sometimes I manually update between REVs by downloading and overwriting files.Why these .cpp files have no impact in game?So why they're changed?
     
  9. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
    You don't need anything from SVN except what's inside Rise of Mankind - A New Dawn folder. Everything else is for developers only. You're not supposed to download cpp files, and you're not supposed to overwrite them to the original folder under BTS, which is called CvGameCoreDLL. Those files are meant to be compiled together by developers and they form CvGameCoreDLL.dll, which is the core of the game. There's a dll in main BTS folder but when you load the mod, the one in RAND folder is used. Anyway unless you are able to compile a dll, you have no use for those files as they don't have any impact on the game: they're just what the dll is made of.
     
  10. nionios

    nionios Chieftain

    Joined:
    Sep 29, 2013
    Messages:
    385
    Thanks for your thorough reply 45°38'N-13°47'E.When I return to my gaming PC,I'll have the chance to tidy things up.
     
  11. psza

    psza Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    65
    Hi,

    Been enjoying playing A New Dawn - still learning it.

    I was wondering if it was possible to mod it such that you can get the data out of A New Dawn. Maybe as you hit Enter it could output a text file with Commerce, Beakers, Maintenance etc etc. Is this at all feasible, or even that Modders do this to fine tune their creations? My idea would then be to geek out and write some custom (historical) reports in Python using the text files.

    Not gone under the hood yet with Modding.I would describe myself as a technically-incompetent-programmer as I work with programmers who are technically competent.
     
  12. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
    There is plenty of logging already available, you can switch it on in CivilizationIV.ini and under BUG options, one of the last tabs IIRC. But as I didn't write that part of the code I can not offer more help, I'm afraid.
     
  13. psza

    psza Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    65
    Thank you for your speedy reply.

    Right time to get to work (once I get back from work). But work on fun stuff!
     
  14. Zeta Nexus

    Zeta Nexus Chieftain

    Joined:
    Jan 23, 2014
    Messages:
    2,476
    Location:
    In a constant brainstorm...
    What does bForceDelete do? It's there in BuildingsSchema, GameInfoSchema and TerrainSchema.

    My guess is, that it should completely remove any item type. At least it would be very useful in modular modding if I could simply remove any un-wanted item.
    But it doesn't seem to do anything.
     
  15. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,621
    Location:
    Just wonder...
  16. Zeta Nexus

    Zeta Nexus Chieftain

    Joined:
    Jan 23, 2014
    Messages:
    2,476
    Location:
    In a constant brainstorm...
  17. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,542
    Location:
    Melbourne, Victoria, Australia
    Another post, not much info is Here
     
  18. Zeta Nexus

    Zeta Nexus Chieftain

    Joined:
    Jan 23, 2014
    Messages:
    2,476
    Location:
    In a constant brainstorm...
    Yeah, I have that page saved for the other tag infos.
    THX anyway :)
     
  19. Urza1234

    Urza1234 Chieftain

    Joined:
    Jul 17, 2012
    Messages:
    33
    This is my first time even touching python, so will someone please sanity check me?
    Spoiler :

    Code:
    def onEndGameTurn(self, argsList):
         iNumUnits = gc.getNumUnits()
         NumDamagedPlots = int(round(iNumUnits / 10))
     
         for i in range(0, NumDamagedPlots):
              DamagedPlot = random.randint(0, map.numPlots())
              plot = map.plotByIndex(DamagedPlot)
              if (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_ROAD")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_TRACK"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_PAVED")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_ROAD"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_MODERN_ROAD")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_PAVED"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_RAILROAD")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_PAVED"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_RAILROAD_ELECTRIC")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_GRAVTUBE")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))
              elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_JUMPLANE")):
                    plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))
    

    This is supposed to, on the end of every game turn,
    1. check the total number of units on the map
    2. choose an integer number of random map plots based on the number of units on the map
    3. if any randomly chosen map plot has a designated route type on it, downgrade the route

    Did I do a dumb?
     
    Last edited: Aug 14, 2017
  20. Vokarya

    Vokarya Chieftain

    Joined:
    Mar 25, 2011
    Messages:
    5,541
    First of all, it's really recommended to use gc.getGame().getSorenRandNum() to generate random numbers. Otherwise it generates OOS errors in multiplayer.

    The other thing you can do is use CyInterface().addMessage to test if your code works. Put a message wherever you want to test and if a message does pop up, the code got to that point without failing. I've used that a lot.
     

Share This Page