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

Promotions DLL

Discussion in 'Civ4 - Mod Components' started by TheLadiesOgre, Sep 2, 2009.

  1. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    If you have the time these tags would also be very nice:

    UnitClassAttackMod and UnitClassDefenseMod

    Something similar for units has been done by TheLopez in his Combat Attack Defense Mod
     
  2. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Oh yes that would be fantastic. But you should use thelopez code for that if needed so we can use both. :)
     
  3. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    Hey TLO,

    I found a little bug (nothing gamebreaking but nevertheless annoying) in CvGameTextMgr.cpp.

    This code:

    Code:
    iHappy += std::max(0, (city.getCelebrityHappiness()));
    should be:
    Code:
    iHappy = std::max(0, (city.getCelebrityHappiness()));
     
  4. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    the + does not matter even if its 0 before.
     
  5. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    Yes, it does. Check it and you'll see the difference :p
     
  6. CaptainMidnight

    CaptainMidnight Warlord

    Joined:
    Apr 16, 2006
    Messages:
    141
  7. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Well, but why? Is it called multiple times?
     
  8. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands


    See?
     
  9. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    okay strange. :)
     
  10. ripple01

    ripple01 Emperor

    Joined:
    Mar 7, 2006
    Messages:
    1,252
    Location:
    New York City
    Hi Arian,

    Were you able to resolve this issue with Super Spies? I am running into the same thing.
     
  11. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    I think I solved the problem.
     
  12. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    hey guys, don't know if anyone wtill watches this thread, but I cannot get the tags to work in game?? They compile fine and the info diplays in the promotions, but the effects don't work in game? so far I have tried the celebrity and bonusiaircombat, the effects appears in the info but doesn't affect the game??

    Any Idea what might be wrong or anything that I might have missed to get this curious outcome??

    EDIT: Never mind.... I missed a chunk of SDK code! finally found it!
     
  13. stolenrays

    stolenrays Deity

    Joined:
    Aug 2, 2009
    Messages:
    2,061
    I think I figured out another CTD bug in this MOD, but I could be mistaken.
    I wasn't creating any paratroopers so I think it was the AI building/using paratroopers.

    I was getting a CTD because of the paratrooper tag in UnitAI.cpp

    The CTD is a Division by Zero problem. I think it arrises because the paratrooper promotions can be used by units with the UNITAI_PARADROP. Because of this, I think that iParatrooperCount can be zero. I changed:


    Code:
    iValue += 20 * (AI_attackOdds(pAdjacentPlot, true) - ((50 * iDefenderCount) / (iParatrooperCount + iAttackerCount)));
    to this:


    Code:
    iValue += 20 * (AI_attackOdds(pAdjacentPlot, true) - ((50 * iDefenderCount) / ([COLOR="Red"]std:max: (1, [/COLOR]iParatrooperCount) + iAttackerCount)));
    Then no more CTD. Is any of this correct?
     
  14. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    So I decided to come back here today. Thanks for the compliments/maintenance while I was gone. Probably not getting back into modding, though I can't tell the future so.......
     

Share This Page