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

TheLopez's Mod Component Library Thread and more

Discussion in 'Civ4 - Mod Components' started by TheLopez, May 26, 2006.

  1. PrimusPilus

    PrimusPilus Chieftain

    Joined:
    Feb 2, 2007
    Messages:
    5
    Hey, thanks for the response. Actually you can open that file with either notepad or wordpad. Like I had mentioned, the only thing in these two files is the MOD name. They look like this:

    #CvModName.py
    modName = "Pirates Mod"

    and

    #CvModName.py
    modName = "Enhanced Foreign Advisor"

    So, I'm wondering if this actually will affect the MODs performance or if these are just some sort of naming indicator files. Do I need them? Can I combine them and if so, can I just copy and paste these together or will the game only read the first line?

    Lastly, just to reiterate, if anyone knows about the files I mentioned in the INIParser folder it would be most appreciated.

    Thanks again!
     
  2. Amra

    Amra the Lion

    Joined:
    Mar 13, 2006
    Messages:
    1,036
    Location:
    Khauran
    You should only need one "CvModName.py" file in whatever mod you are creating. The modName should equal the name of your mod's directory. For instance in my Amra's Modpack the contents of this file are:

    #CvModName.py
    modName = "Amra v208"

    "Amra v208" is the name of the modpack's directory. I believe TheLopez's mods access the CvModName.py file in order to find the mod's directory and thus various files needed to run the mod component. So, it is important to include your modpack's exact directory name or parts of your mod may not function.

    I'm sure TheLopez could explain it better but hopefully I was able to help.
     
  3. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    Im not completely sure, but i think that a .py with no code at all except "modname" is about useless. .py files are used for the random maps (perhaps some other maps?) Most of the code inside often is just script for generating a map. I have made a few mods and integrated many mod components together, some which contain not a single .py file and they work perfectly.

    EDIT: Also Im pretty sure that the naming comes from (or can) the .ini file in the mod/modfolder/ folder
     
  4. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    actually, i just thought about this, and tested it slightly, I know .py files can contain things other than map scripts, And the .ini doesn't actually "name" the mod. I just put a simple mod together and just made a "mods/components/" folder, added 1 xml (the mod is only 3 folders, components/assets/XML, and 1 file, an XML), did not even create a .ini file or anything else, and it works. Civ4 automatically names the mod, based on the folder it is in, and automatically creates a .ini file during start up Basically unless u have messed with the game core, this is the case, so a simple naming file is about pointless in my opinion, just use the already existing .ini. I would imagine you could delete these 2 files, if that is all they contain, and it would still work. Only thing is, if there is a special tag or something associated with them, Im not sure.

    #CvModName.py
    modName = "Pirates Mod"

    and

    #CvModName.py
    modName = "Enhanced Foreign Advisor"

    I have tested it with the military bases mod. If you delete the militarybases.py that basically only names the mod, nothing changes, it is a useless file.
     
  5. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    This is organized very well, and is very usefull for learning and seeing working mods and the code within them. Also many of these mods implement things i wish civ4 would have came with, specifically the air forces mod. GREAT JOB TheLopez! :hatsoff:
     
  6. ghen

    ghen Chieftain

    Joined:
    Dec 3, 2005
    Messages:
    70
    Can you mark which mods are compatible with BtS?
     
  7. doronron

    doronron King

    Joined:
    Nov 16, 2003
    Messages:
    906
    Location:
    Home or Work...
    Currently, only a few of these have been updated to BtS. Look for some of the modcomps by Grave. Unfotunately, TheLopez hasn't posted to this forums in several months.
     
  8. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    Just to clear up some confusion, .py files contain more then just map scripts. Python is used to code everything from the event manager to the game screens.

    As for the CvModName.py file, it is used by the INIParser to figure out what folder the mod's config.ini options are in. The INIParser looks in '<Civ4 install dir>/Mods/<text value of modName>'. So if your running ImprovementsOutsideBorders mod, but your CvModName.py has its modName variable set to "Mad Nukes" then it will look for the config.ini files in the Mad Nukes directory. If you don't have a CvModName.py file then TheLopez's code will just fall back on all the default values.
     
  9. domino36963

    domino36963 Chieftain

    Joined:
    Aug 2, 2007
    Messages:
    76
    I'd like to see favorite religion and inquision mod bts compatable
     
  10. Aeven

    Aeven EU Citizen

    Joined:
    May 11, 2007
    Messages:
    228
    Location:
    the Netherlands, EU
    Domino: BtS already has a favourite religion feature ;)
     
  11. Grave

    Grave 1 Goat = 400 Horses

    Joined:
    May 5, 2002
    Messages:
    1,530
    Location:
    Louisiana
    And so is Inquisition.... sort of. Look at the Gods of Old scenario, they're in there. Wouldn't take much to turn that into a BtS mod for the epic game.
     
  12. Mylon

    Mylon Amateur Game Designer

    Joined:
    Nov 4, 2005
    Messages:
    1,013
    I coulda swore I saw a thread just like this a year ago or so that had a lot of different mods instead, one of which was a mod for discrete resources. Anyone remember it?
     
  13. domino36963

    domino36963 Chieftain

    Joined:
    Aug 2, 2007
    Messages:
    76
    seriously? is it in the epic game? if so, could you tell me how to increase the probability of the leaders switching, Isabell founded Christianity but didn't switch

    (couldn't quote this from Grave) "And so is Inquisition.... sort of. Look at the Gods of Old scenario, they're in there. Wouldn't take much to turn that into a BtS mod for the epic game."

    I tried to take it out but there were so many errors and I didn't understand how to fix many/some of them. Would it be possible for you or someone else to do 'extract' the inquistor from Gods of Old
     
  14. Arexack_heretic

    Arexack_heretic Emperor

    Joined:
    Oct 10, 2006
    Messages:
    1,119
    Location:
    Lugdunum
    Hi theLopez /Olleus.

    How is the tunnels modcomp coming along?
     
  15. zulu9812

    zulu9812 The Newbie Nightmare

    Joined:
    Jan 29, 2002
    Messages:
    6,389
    Location:
    Athens of the North
  16. Arexack_heretic

    Arexack_heretic Emperor

    Joined:
    Oct 10, 2006
    Messages:
    1,119
    Location:
    Lugdunum
    Well..neither have I to be honest. :p
     
  17. Mylon

    Mylon Amateur Game Designer

    Joined:
    Nov 4, 2005
    Messages:
    1,013
  18. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,463
    Gender:
    Male
    Location:
    MN
    Thread Necromancy again??,.,,,.,.
     
  19. Mylon

    Mylon Amateur Game Designer

    Joined:
    Nov 4, 2005
    Messages:
    1,013
    I gotta keep this thread on my watch list so I can peek at it every now and then and steal ideas (and code). :)
     
  20. Arexack_heretic

    Arexack_heretic Emperor

    Joined:
    Oct 10, 2006
    Messages:
    1,119
    Location:
    Lugdunum
    not much to watch here...you'd be better served with a bookmark. :p sad thing though.
     

Share This Page