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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. Robo-Star

    Robo-Star Prince

    Joined:
    Jan 12, 2008
    Messages:
    464
    Awesome, thanks for the info. For 2) I guess I'd have check whenever Future Tech (1) is researched by a player that iterates through each other player if/until it finds one who has researched Future Tech (1), then call the Permanent Alliance set-up sub-trigger-routine...thing.
     
  2. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    Hi! Is there any function to check how many techs a civilization knows or do I have to check it by a loop?
     
  3. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    Techs are stored with the team and not players, but you still have to iterate through them all as far as I can see from the sdk source.
     
  4. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    Yeah, I'm aware that teams got techs. Anyway, thanks for the answer (although I hoped for a different one :p ). I guess, in order to check how many civs know a technology, I have to iterate as well?
     
  5. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    Yep, unless you want to tweak the SDK to keep a count, or at least do the iterating for you, which would be quicker than doing it in Python.
     
  6. Surtur

    Surtur Warlord

    Joined:
    Jan 20, 2005
    Messages:
    208
    Location:
    Karlsruhe, Germany
    Hi, I am working on my own mod but I can't figure this one out. In Civ4 BTS whenever you enter the city screen the music stops and you hear the city ambient sounds. As soon as you leave the screen the music resumes.
    I would like the music to just keep playing and get rid of the city ambient sounds. Any advice?
     
  7. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    It looks like it is handled in the dll (not Python). If you don't mod the dll, then what is left for you is to play with the settings defined in the XML/Audio folder (AudioSoundscapeScripts.xml, Audio2DScripts.xml).
     
  8. Surtur

    Surtur Warlord

    Joined:
    Jan 20, 2005
    Messages:
    208
    Location:
    Karlsruhe, Germany
    I am already modding the DLL. But I can't find where the music is handled.
     
  9. Blitzconfusion

    Blitzconfusion Chieftain

    Joined:
    Jul 30, 2014
    Messages:
    67
    So, two (and a half) unrelated questions:

    1: History: I (successfully) added Chariot Archers into the game, and wanted to alter the price for War Chariots event to be either combat 1 for them instead or add chariot archers to your army. The promotion reward was trivially simple enough. However, despite my efforts, I failed to locate the part for quest to reward Chariots in the files.
    Question 1: Where does the game check what units to give, and (if different file/location) where is the actual code for giving them is handled?

    2: History: It just bugs me in general that even my most houdini Bomber ever won't ever gain XP because of abysmal damage dealing, and increasing minimum damage or bomber interception kinda tweaks the wrong stuff.
    Question 2: Can I, without recompiling stuff, alter Air Combat so that instead/in addition of kills, the game rewards an Air Unit (and NOT an ground unit intercepting) a single point of xp for SURVIVING triggered air combat when intercepting/getting intercepted? (If complicated but doable, an hypothetical code example would be appreciated).

    Recompiling stuff is kinda a last ditch effort for me, but even those kind of answers would be really helpful in a no-can-do sort of way.

    PS. "Surviving aircombat" could simply be: "At the beginning of Air combat, give air units in the combat +1 exp." No one would know the difference, as dead men tell no tales about how much exp they had when they were shot down.
     
  10. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,690
    Location:
    UK
    the first one is eventinfo.xml (not eventtrigger)

    unitclass tag is where you specify what unit(s) to give and iNumFreeUnits is where you say how many.

    2) I am unsure if python has a function for surviving combat (I know it can do onvictory)..
    if it doesn't it would need a .dll math.
    Alternatively, some mods provide experience for a ranged combat attack...I can't remember the name of the one I got it from...argh...realism invictus (just checked my mod credits) but that would require a recompile of the .dll
     
  11. Blitzconfusion

    Blitzconfusion Chieftain

    Joined:
    Jul 30, 2014
    Messages:
    67
    Thank you for quick reply. The exp. thingy requiring recompiling is a bit disappointing, but what can do.
    It seems I missremembered the quest rewards: I thought there were a third one: gain a number of chariots. But that would have been kinda silly for a quest requiring one to build them, wouldn't it?
     
  12. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,690
    Location:
    UK
    Oh sorry, you are talking about a specific quest?

    I have only done my own quests from scratch so far, I don't know anything about specific quests.

    You can however add an extra event that gives the option of a number of free chariot archers.

    if you look at the event trigger for 'Chariot Quest' you can just add an extra event into the options there, then make it do whatever by adding it to the event file.

    if you are thinking balance it could be that you pay some gold to 'speed up production of this wonderful new technolgy' and get X archer chariots or any other negative effect, temporary unhappiness by whipping your work force into a frenzy, etc.
     
  13. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,553
    Gender:
    Male
    Location:
    Denmark
    What does the numbers mean in CvUnitAI.cpp

    ex : if (AI_anyAttack(1, 45, 3))
     
  14. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    In BBAI that is:

    Code:
    bool AI_anyAttack(int iRange, int iOddsThreshold, int iMinStack = 0, bool bAllowCities = true, bool bFollow = false);
    In BTS that is:

    Code:
    bool AI_anyAttack(int iRange, int iOddsThreshold, int iMinStack = 0, bool bFollow = false);
     
  15. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,553
    Gender:
    Male
    Location:
    Denmark
  16. kbiggs

    kbiggs Chieftain

    Joined:
    Oct 18, 2014
    Messages:
    17
    Location:
    'Murica
    How would I add this unit to the game as a mod? Without having to change the vanilla files?
     
  17. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,553
    Gender:
    Male
    Location:
    Denmark
  18. kbiggs

    kbiggs Chieftain

    Joined:
    Oct 18, 2014
    Messages:
    17
    Location:
    'Murica
  19. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,690
    Location:
    UK
    Ok, this has probably moved out of a quick answer then.

    My advice is open a new thread, and post a link here to it.

    That way people can help you work through your steps and see where it goes wrong, without bits getting lost in the general conversation here.
     
  20. kbiggs

    kbiggs Chieftain

    Joined:
    Oct 18, 2014
    Messages:
    17
    Location:
    'Murica
    Sure. Thank you.
     

Share This Page