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

Help with Greek UP

Discussion in 'Rhye's and Fall Modmods' started by TDK, May 25, 2009.

  1. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Hello, I am making a mod-scenario where I need to remove the Greek UP and replace it with the Carthagenian one from RFC Multiplayer(+1 trade route per city).

    I have tried to remove the greek UP from 1.184 Rhye but I can't even get that right, much less put in the +1 trade route. In short, I'm a lousy programmer. If any of you could help me program that or even just point me in the right direction I would be grateful.

    Thanks,
    TDK
     
  2. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    The Greek UP is contained in Rhye's modified DLL file, like most unique powers, in order to speed up the game. It is quite straightforward to delete the lines about the Greek power and then recompile the modified DLL. I presume the Carthaginian UP is in the MP DLL.
     
  3. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Thanks, I was trying in various text files and such because I thought it looked like the right place. Can you point me in the right direction here? What program to use and how?

    Thanks again,
    TDK
     
  4. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    You can use Notepad or other text editors like Notepad++ to edit the relevant file within the DLL. I don't know how you compile the DLL, though. Check the Modding guides forum.

    I think the uncompiled DLL files are bundled with the RFC download.
     
  5. Cethegus

    Cethegus King

    Joined:
    Feb 28, 2008
    Messages:
    922
    Location:
    Finland
  6. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Okay thanks guys. I'm a bit overwhelmed by that DLL guide.

    So Panoptican, you are saying:
    -that some UPs etc that used to be in the Python or XML is now in the DLL to speed up the game?
    -There is some kind of "raw"(uncompiled) version of these files with the download that I can edit with a text editor and then compile afterwards.

    Thanks again,

    TDK
     
  7. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    I don't know if the Unique Powers in the DLL were ever in Python. What I do know is that code's being in the DLL makes the game run faster, which is why they are in there.

    I presume you can obtain the modified DLL from Rhye if you were to ask.
     
  8. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    I get this error when trying to compile the DLL, any ideas?

    c:\Projekt\Byzantines_610AD\CvGameCoreDLL\CvGameCoreDLL.h|160|fatal error C1083: Cannot open include file: 'boost/python/list.hpp': No such file or directory|
     
  9. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    I'm not even sure that I know exactly what the SDK is, I presume it's just the files in the \CvGameCoreDLL. Please tell me if I'm right?
     
  10. onedreamer

    onedreamer Dragon

    Joined:
    Oct 21, 2004
    Messages:
    6,580
    Location:
    Torino - Italia
    SDK stands for software development kit. It actually DOES NOT exist in Civ4 although Firaxis initially promised to release one, they never did and instead they posted guides on how to use external programs to do the job.
    Anyways, the compiler can't find a file, but I suspect it would be just the first of a long list, I presume because you put your files in a path outside the Civilization4 folder.
     
  11. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Okay, thanks.

    I'm now getting this after it spent about 10 minutes compliling: "LINK : fatal error LNK1104: cannot open file '..\Assets\CvGameCoreDLL.dll'".

    Any ideas?
     
  12. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    10 - 15 minutes is what it takes to compile (depending on the CPU that you have).

    I am assuming that you get this message at the end of the compile process. Here are my thoughts:

    1. The process should not read from CvGameCoreDLL.dll, but to it.
    2. Is the file marked as read only (you should be able to write to it).
    3. Why is the thing looking into ..\Assets\, my suggestion would be to set up a separate folder (completely separate from the program) and do all modifications/compilations in it. You can see the guide that I am using from the first post in RFCEurope Files thread. Download the .dll information. Note that the files in it are for RFCEurope and should not be used for RFC, but the instructions would work for either one.
     
  13. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Thanks 3miro, I compiled my first working .DLL with the Greek UP removed. Baby steps...

    Now I want to borrow the code from the Netherlands UHV from RFCE, but I can't locate it in the files, can you help? I was guessing CvCity but I can't find it there.

    Thanks,
    TDK
     
  14. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    Make a global search for the comment 3MiroUP, that will give you all the places where UP were coded.

    The Netherlands one is either in CvCity, or in CvTeam or in CvPlayer. I cannot remember of hand. Let me know if you are having trouble finding it.
     
  15. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    I found this piece in CVPlayer:
    I don't really understand how that piece of code is related to any specific civilization though? I mean it doesn't say Netherlands or something anywhere, so how would I attach it to greece in my scenario?

    Thanks,
    TDK
     
  16. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    How much C++ do you know? Here I am assuming that you have the basic understanding of classes.

    The class CvPlayer has a function getID() which returns the value of the ID attribute. All players are identified by their ID attribute.

    Unlike RFC, RFCE does not explicitly connect player to power, everything is done via the UniquePowers array and in that way any player can easily have 1, 2, or even more UP and everything is set via python. Unlike the RFC .dll file, RFCE is oblivious to which nation is Byzantine and which one is German. In RFCE it is all handled in python.

    To change the Greek UP for RFC, you will have to change the code to something like:
    Code:
    int CvPlayer::getTradeRoutes() const
     {
     // TDKUP: New Greek UP
     if ( getID() == GREECE ){
     return m_iTradeRoutes + 2;
     }else{
     return m_iTradeRoutes;
     };
     }
    
    Feel free to change the 2 to whatever you feel like.
     
  17. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    No, I'm completely new to this. At least I'm beginning to understand a little bit of what the compiler does, and I'm amazed it can add just the file I changed instead of starting over every time.

    I can certainly see how referencing like that instead of connecting it to a specific civ is a better method of structuring stuff.

    I will try to get it to work next time I'm at it.

    Best regards,
    TDK
     
  18. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    Two notes:

    1. If you make any change to any of the .h files, select project -> clean and then recompile everything from scratch. You may run into a lot of weird trouble otherwise.

    2. In one of the XML files (I beleive it was in Assets\XML\CvGlobalDefine or something, there is a constant that defines the maximum number of trade routes. You will have to update that one too (i.e. 1 generic, +2 for Great Lighthouse, +2 for Cotton, +1 for Free Market, +2 for Currency and Corporations ... +2 for the Greek UP). Otherwise you may get bad crashes. (There is no need to compile/recompile the .xml files)
     
  19. TDK

    TDK Emperor

    Joined:
    Feb 22, 2006
    Messages:
    1,229
    Location:
    Denmark
    Are you mentioning this here because I have to do something in the .h file as well?

    I know I'm pathetic here, so just say it if you think it's to much MM.
     
  20. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    No change to .h files is needed. Just in general, if you make a change to just one file only that file will be recompiled, however, if you make a change to any .h file, everything needs to be recompiled.

    It is no problem to help.
     

Share This Page