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

Modmodding Q&A Thread

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Dec 14, 2013.

  1. Steb

    Steb King

    Joined:
    May 20, 2009
    Messages:
    815
    Gender:
    Male
    Location:
    Montréal
    Thanks Leoreth, that was a lot of help!

    I think I got it done with Python event handlers for religion spread and acquired/lost Jewish cities (I still need to test though). But there's no event handler for opening/closing borders. Should I create one? (not that I know how). Or should I handle this in the DLL somewhere?
     
    1SDAN and Leoreth like this.
  2. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,484
    Gender:
    Male
    Location:
    House of Hades
    You're right, there currently is no event handler for diplomacy events, including open borders. If you want to create one, you need to do so in the DLL. You can work yourself through the process from one of the existing examples in CvEventReporter.cpp. Or you just implement the effect directly in the DLL.
     
    1SDAN and Steb like this.
  3. Steb

    Steb King

    Joined:
    May 20, 2009
    Messages:
    815
    Gender:
    Male
    Location:
    Montréal
    Awesome, I made new event handlers and now it all works! Expect a beta release of the Israel modmod sometime soon, depending on how much playtesting I feel like doing.
     
    ales_ likes this.
  4. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,484
    Gender:
    Male
    Location:
    House of Hades
    That's great!
     
  5. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,810
    Location:
    The city of the original vlaai
    Maybe I should release my new civs as well. But not before the release of the definitive version of v1.15.
     
    ozqar and 1SDAN like this.
  6. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,484
    Gender:
    Male
    Location:
    House of Hades
    Yes, it would be great if everyone could bring their additional civ modules up to date with 1.15 after the release.
     
    Steb and 1SDAN like this.
  7. Steb

    Steb King

    Joined:
    May 20, 2009
    Messages:
    815
    Gender:
    Male
    Location:
    Montréal
    I have a weird bug in my mod. Upon loading the 600 AD scenario as China, I found that Xi'an has an edubba and an airport instead of a taixue and a forge. (The edubba appears right before the taixue, and the airport right before the forge, in the Buildings XML.) It's weird because the 600 AD scenario map correctly lists the forge and taixue on the Xi'an plot, and no other city or scenario is affected as far as I'm aware. In every other respect that I've seen, the buildings are correct.

    Has anyone encountered something like this or does anyone have an idea what's going on?
     
  8. Imp. Knoedel

    Imp. Knoedel Properly Paranoid Proletarian

    Joined:
    Nov 11, 2011
    Messages:
    8,733
    Location:
    The cooler Germany
    Did you perhaps add a new building without editing Consts?
     
    1SDAN likes this.
  9. Steb

    Steb King

    Joined:
    May 20, 2009
    Messages:
    815
    Gender:
    Male
    Location:
    Montréal
    Thanks, that wasn't the problem, but it led me to double-check and find that the building I added was misplaced within the list of constants, and that did it.
     
    Leoreth and Imp. Knoedel like this.
  10. ace99

    ace99 Deity

    Joined:
    Sep 5, 2012
    Messages:
    3,455
    This may have been answered already, but for 1.14, what do I need to change so the human player always collapses to the core rather than gets defeated? I like to play the ancient civs and lead them through the ups and downs, including rebuilding the empire after collapse.

    Additonally, what do I need to change so civs like Harappa and Polynesia spawn in games where they aren't player civs?
     
  11. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    432
    Change values of PLAYER_OCCURRENCE_HARRAPA and PLAYER_OCCURRENCE_POLYNESIA in ...\Assets\XML\GlobalDefinesAlt.xml from 0 to 1.
     
    1SDAN likes this.
  12. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,484
    Gender:
    Male
    Location:
    House of Hades
    For the first question, I suggest you just run a diff with e.g. Winmerge on Stability.py to see the required changes.
     
  13. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    I'm trying to merge two of Merjin's civ modmods, and have been running into the following error whenever I start a scenario:

    Code:
    Traceback (most recent call last):
      File "BugEventManager", line 400, in _handleDefaultEvent
      File "CvRFCEventHandler", line 112, in onGameStart
      File "Modifiers", line 41, in init
      File "Modifiers", line 37, in updateModifiers
      File "Modifiers", line 33, in updateModifier
      File "Modifiers", line 5, in getModifier
    AttributeError: 'NoneType' object has no attribute 'getCivilizationType'
    I'm currently trying to figure out what's causing this, though if anyone already knows what the cause is that'd help very much.

    EDIT: I realized that since they both add a single civ, they probably both changed the MAX CIVs variable in CvDefines.h to 50 without any conflict, going to increase it to 51 and see if it works now.

    Speaking of adding civs, I heard there's currently a maximum in the number of players, what exactly is that maximum?

    EDIT2: The error is still occurring, pushing edits now

    EDIT3: Apparently I forgot to increment the value I was talking about, no idea how that happened.

    EDIT4: Even after changing MAX_CIV_PLAYERS to 51 I'm still getting the error.
     
    Last edited: Jan 30, 2018
  14. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,484
    Gender:
    Male
    Location:
    House of Hades
    The maximum is the one defined in the DLL.
     
  15. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    But didn't Merjin's mods change the maximum? If that's possible what's with all I heard about recoding the max civ slots and respawns?
     
  16. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    Just an update saying that I'm absolutely stumped, I have zero idea what's causing this error.

    I've gone through Leoreth's guide to adding civs to the game just in case I missed something, and unless I missed something I'm pretty sure I didn't miss a step.
     
  17. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,810
    Location:
    The city of the original vlaai
    Did you rebuild the DLL?
     
  18. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    I thought I did, I'll try again. Also, I just noticed I posted a link to the code on your thread but not on this one, so here's the fork.

    https://github.com/earthcrafterman/Dawn-of-Civilization

    EDIT: IT WORKED! I guess the issue is that I've been rebuilding the solution instead of the DLL. Huh, neat!
     
    Last edited: Jan 30, 2018
  19. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    I'm trying to merge the Israel mod now but have run into a crash when launching the 1700 AD scenario, I used to have the same issue with 600AD but I fixed it without realizing. The merge attempt is currently on the AllCivs branch, because I didn't notice I didn't click the TESTING branch. I think it may have something to do with the scenario file, but I can't for the life of me figure out where the error is, no matter how many times I roll through the diffs in winmerge.
     
  20. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,681
    No matter what I do I can't seem to find the source of these crashes. Does anyone have any advice? I've checked the logs but there doesn't seem to be anything about a crash.
     

Share This Page