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

[Religion and Revolution]: Mod Development

Discussion in 'Civ4Col - Religion and Revolution' started by Robert Surcouf, Sep 5, 2011.

Thread Status:
Not open for further replies.
  1. Schmiddie

    Schmiddie Emperor

    Joined:
    Feb 27, 2012
    Messages:
    1,257
    Location:
    Germany
    Lol, seems that you did not notice that I'm already absent since some months. To be honest...I have currently no idea how to set up this environment. I haven't modded since 2.7 has been published and I set up the environment more than one year ago...
     
  2. ShadesOfTime

    ShadesOfTime Chieftain

    Joined:
    May 3, 2012
    Messages:
    31
    Oh yes, I have noticed that with sadness.
     
  3. devolution

    devolution Warlord

    Joined:
    Oct 7, 2016
    Messages:
    257
    Gender:
    Male
    Location:
    Stavanger, Norway
    You definitively have to use the SDK\toolchain provided by VS2003 (v7.1). MS has the habit of breaking their ABI with almost every release unfortunately, so we're stuck with this ancient compiler. If only they had used COM :sad:

    @Schmiddie : Nice to see you getting active again :goodjob: I may consider some more modding myself...
     
    Last edited: May 11, 2018
  4. devolution

    devolution Warlord

    Joined:
    Oct 7, 2016
    Messages:
    257
    Gender:
    Male
    Location:
    Stavanger, Norway
    @ShadesOfTime
    Is this your fork https://sourceforge.net/u/allrandom/religion-and-revolution-bugfixes/ci/master/tree/ ?

    If you intend to help out with fixing bugs, that would be great :). I have a rather long list of issues that we could coordinate\work off (not published anywhere since it needs to be cleaned up), so I'm sure we won't run out of stuff to do anytime soon.
    This would also allow me to use more of my time to work on the AI, which is the reason I originally joined the project.
     
    Last edited: May 11, 2018
  5. ShadesOfTime

    ShadesOfTime Chieftain

    Joined:
    May 3, 2012
    Messages:
    31
    devolution,

    this is indeed my fork. But calm the horses. As of now I just want to fix some bugs which I don't like. Like this, where I already found a solution for:
    https://forums.civfanatics.com/thre...-bugs-and-todos.449958/page-121#post-15086562

    and i would send you pull requests when i was able to fix something.
    I do not want to commit to anything beyond that. I am working full time. If you have any internal communication, I would be interested though. I would see your issue list and progress and I would maybe pick an issue once in a while, if I have the time and knowledge resources.

    Do you have any links or clues on how to get the 2003 sdk onto windows 10?
     
  6. Schmiddie

    Schmiddie Emperor

    Joined:
    Feb 27, 2012
    Messages:
    1,257
    Location:
    Germany
    I'll be back in a few weeks/months, but I hope to have more time then...for playing AND modding...
     
  7. Randomsheep

    Randomsheep Warlord

    Joined:
    Oct 19, 2017
    Messages:
    121
    Are Schmiddie and devolution even aware there is a very nasty unfixed bug which is ruining 2.7?

    I am referring to the bug which ShadesOfTime has found a solution for.

    If you can't at least fix this one horrible bug, may I suggest you roll back the official version to 2.6 because it is a far better experience as versions stand.
     
  8. devolution

    devolution Warlord

    Joined:
    Oct 7, 2016
    Messages:
    257
    Gender:
    Male
    Location:
    Stavanger, Norway
    Please explain how to reproduce the bug in the appropriate bug thread, thanks!
     
  9. devolution

    devolution Warlord

    Joined:
    Oct 7, 2016
    Messages:
    257
    Gender:
    Male
    Location:
    Stavanger, Norway
    About the 2003 SDK, I am not aware of any issues that prevents it from working on W10.
    My setup for RaR/BTS modding is W10, 2003 SDK, VS2010 and VS2017 community edition.I recommend the latter for debugging and editing over 2010. I think 2010 is required for historical purposes, we should just migrate to VS2017.

    @Nightinggale is the resident build system guru and would know more
     
    Last edited: May 13, 2018
  10. albucc

    albucc Chieftain

    Joined:
    Dec 3, 2013
    Messages:
    53
    Location:
    São Paulo/Brazil
    I haven't found if you have already discussed what I consider an annoying bug : when you click the "end turn" button, and have ships in europe, you know about that in the next turn... so you have already lost a full turn with the ship in europe, needlessly...

    I've just hacked a "solution" with python: I've changed the CvEventInterface for the keyDown event, so if the player hits "enter" it will test for the "nags" and "feats" and, if they return 1, the event for ending the turn is cancelled as well...
    Code:
            if ( eventType == self.EventKeyDown ):
                theKey=int(key)
                if ( theKey == 44) : #enter key
    
                    if ( CyInterface().shouldDisplayEndTurn() ) :
                        iPlayer = game.getActivePlayer();
                        abmpEndPlayerResult1 = CvAdvisorUtils.endTurnNags(iPlayer)
                        abmpEndPlayerResult2 = CvAdvisorUtils.endTurnFeats(iPlayer)
                        print("abmpendturnresult" + str(abmpEndPlayerResult1) + " " + str(abmpEndPlayerResult2) )
                        if ( abmpEndPlayerResult1 == 1 or abmpEndPlayerResult2 == 1) :
                            return 1
    
    But this has a drawback: while I don't move ships out of europe, the nagging that there are ships at europe goes on forever... unless I click the end turn, since I haven't trapped the mouse button as well...

    I've thought about setting somehow a global variable, but I haven't found so far anywhere where I can place it, so I can control that the player have clicked at least once on the "I know that, thank you" button, that turn.

    Do you have any hints?
     
  11. Nightinggale

    Nightinggale Deity Supporter

    Joined:
    Feb 2, 2009
    Messages:
    4,137
    I would change it to when you end turn, instead of just ending, it should pop up a confirm window if there are ships in Europe.
    Another solution would be to have an image, which is displayed when there is a ship in Europe and clicking it acts like clicking the Europe button.

    I like the idea. I have forgotten about ships in Europe many times. A classic is to have one colonist in Europe, want to wait a turn to make it take two and when I start to wonder why I have no money and lots of cargo, I have 5 colonists in Europe :cry: (ok, it haven't happened often, but it has happened)
     
  12. rah

    rah Deity Supporter

    Joined:
    Sep 12, 2005
    Messages:
    8,569
    Location:
    Chicago
    I doubt anyone here has ever not forgotten about ships in Europe but for me Africa and Port Royal are more likely to have a ship lingering there for many turns.
     
    Marla_Singer likes this.
  13. albucc

    albucc Chieftain

    Joined:
    Dec 3, 2013
    Messages:
    53
    Location:
    São Paulo/Brazil
    Yep, I've detected that the nag about ships at port only check europe... I'm not sure how to specify africa or port royal...

    For me, I keep forgetting ships in europe because I keep switching screens to decide the cargo to place at the ship, to which indians will I trade next... city needs... and then I get distracted by something else, click end turn and BAM... "you have ships in europe"... at the wrong turn...
     
  14. albucc

    albucc Chieftain

    Joined:
    Dec 3, 2013
    Messages:
    53
    Location:
    São Paulo/Brazil
    Yep, I've tried this initially... but the bug is caused just because the onEndTurn hook is a mute one: it can't be "consumed" if it is detected something wrong. But the key event is consumable... you can say the engine to stop processing that keyboard event. This way, I have nag at the same turn.

    But the challenge here is that I don't want the nag dialog that "there are ships in europe" to keep popping up if the player have already clicked on the "I know that, thank you" option... The problem is that I don't know how to set a python global variable that spawns different modules...

    What I would like to do is:

    If there are ships in europe and the player hit "end turn", if there isn't a previous confirmation at the same turn that the player said "I know that", the popup keeps popping up. For that, the popup dialog must set a global variable telling that the player have confirmed that on turn X...
     
  15. Nightinggale

    Nightinggale Deity Supporter

    Joined:
    Feb 2, 2009
    Messages:
    4,137
    Python hooks are intended for mods, which for one reason or another wants to avoid modding the DLL (like making it mac compatible). If you have the option to pick between the DLL or python, pick the DLL. Not only is the compiled C++ code faster, it allows debugging and assert checks, both useful tools regarding creating a bug free mod. I think all the python hooks are in the DLL code, meaning any code using a hook can be written in the DLL. Also a lot of features are DLL exclusive. There is some python exclusive code as well, mainly GUI stuff.
    You can even mix DLL and python and make a hybrid to benefit from both. The XML editor is an example of this as the data handling is in the DLL and python handles all the screen drawing.

    I did overwrite the end turn button in Medieval Conquest once to do something other than end the turn if it has unanswered diplomacy (M:C specific feature). I can't remember offhand how I did it, but it worked, meaning it must be in the git log somewhere. However knowing my workflow, odds are that it was in the DLL. However I do know for certain that it can be done.
     
  16. albucc

    albucc Chieftain

    Joined:
    Dec 3, 2013
    Messages:
    53
    Location:
    São Paulo/Brazil
    To tell you the truth, I'm avoiding going into the dll, if I can. I'm aware that Python is slower, but my previous experience is that to actually be able to compile the DLL is something that takes a significant effort, and that is also difficult to merge and distribute... You have a big package with all the code in a big "take it or leave it " state... Not mentioning all compatibility issues that you may create if you don't do it right (like make it not to work on a Mac, or create a memory leak, CTD... Does civ4col work on Mac? Didn't know that ) ...

    But I'm afraid that to fix this I will really have to go there... maybe change the global context to allow for a hashmap for modders to use...
     
  17. Nightinggale

    Nightinggale Deity Supporter

    Joined:
    Feb 2, 2009
    Messages:
    4,137
    Compiling is an issue, but I wrote a wiki guide to tell precisely what to do.
    Colonization is released for mac, but the port is bad and the DLL part is compiled into the game files themselves and it doesn't support external code. Since RaR is already using a modded DLL file, you shouldn't be concerned about mac support since it's already broken. There are some BTS mods, which are intentionally python only due to mac support, but all Colonization mods use modded DLL files.

    You would have to do something really weird to cause memory leaks by modding the end turn code to add a confirm button. CTD is valid, but only if you write something, which would also break python. Besides if RaR accepts code from outsiders, it will always be reviewed for quality issues. In other words fear of possibly bugs shouldn't stop you from trying. If anything now would be a good time to try precisely because it would grant you access to a code review and feedback of same.
     
    albucc likes this.
  18. albucc

    albucc Chieftain

    Joined:
    Dec 3, 2013
    Messages:
    53
    Location:
    São Paulo/Brazil
    Cool the wiki guide... I'm finishing installing a git client now. One sordid detail, though: microsoft registration site is somewhat broken, and gives the impression that registration have failed. However it still emails you a registration key...
     
  19. Ag0range

    Ag0range Chieftain

    Joined:
    Apr 12, 2013
    Messages:
    88
    Gender:
    Male
    Sirs, is there any SVN or other way to obtain the latest build? Thanks beforehand
     
  20. Nightinggale

    Nightinggale Deity Supporter

    Joined:
    Feb 2, 2009
    Messages:
    4,137
    There is a git repository on sourceforge and the link is in the first post in the download thread under "2. Mod Development on SourceForge". The direct link is https://sourceforge.net/p/religion-and-revolution-git/code/ci/master/tree/.

    You need to compile yourself though.
     
    DKVM likes this.
Thread Status:
Not open for further replies.

Share This Page