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

ModModder's Guide

Discussion in 'Rise from Erebus Modmod' started by Valkrionn, Jul 31, 2010.

  1. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    I will be constructing this post over the next few days.
     
  2. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
  3. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
  4. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
  5. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
  6. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Alright, this should be enough.... Hopefully. :lol:
     
  7. Zai

    Zai Chieftain

    Joined:
    Oct 23, 2009
    Messages:
    77
    This will probably be answered in your guide once you have the time to get to it, but I have just one quick question. How do I set a specific XML file to override the original from within a module rather than simply adding onto it? For example, I have a module that adds some new leaders, and in that module I have a CIV4CivilizationInfos.xml where I've removed the old leaders for a civ and added the new ones. Yet when I load the game with that module I see both the old leaders and the new ones for that civ, which is not what I want.
     
  8. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Yeah, it will be in the thread (I'm planning to work on that tonight), but I'll explain it here. Not difficult, really, just have to take an extra step.

    There is a tag called <bForceOverwrite>; Set it for your entry. This will force the game to completely replace the standard entry with that of your module, only way to load default values back in.

    However, that means you must have the entire entry for the unit/building/civ/whatever you are modifying. Otherwise, it will simply delete everything that is not listed. So make sure you have the entire entry when using that tag. ;)
     
  9. Zai

    Zai Chieftain

    Joined:
    Oct 23, 2009
    Messages:
    77
    Awesome, works perfectly now. Thanks! :D
     
  10. Pohlmann

    Pohlmann Chieftain

    Joined:
    Feb 24, 2009
    Messages:
    232
    trying to start my 1st module :D.

    Question: what for / when do i have to use the unitSchema?

    i wanted to start just by adding a new unit or two and grant it a new spell.

    do i only need to add the unitSchema when i add a new tag and how do i start the unitinfos.xml then if i dont need to start with unit schema?
     
  11. shoggi

    shoggi Team RifE Grunt

    Joined:
    Jul 10, 2008
    Messages:
    252
    Location:
    Germany
    If you use any xml file in your module that requires a schema (which are all, except the gametext ones), you have to include the schema that is associated with it. Look at the top of the file for what schema you need.
    Then you have to rename the schema to something like YOURMOD_CIV4UnitSchema.xml or whatever schema you are using and change the filename in the file that needs the schema too.
    look at the chain of command module for how it is done exactly.

    Normally you shouldn't touch the schema at all, but it has to be included.
     
  12. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    The simplest module to look at is the BuildXP module. It contains two real files and a schema; Both files use the UnitSchema.

    You must rename the schema (YOURMOD_OriginalFileName.xml), and then change the reference to the schema in your actual file.

    To use your unit example... You need Civ4UnitInfos.xml and Civ4UnitSchema.xml. Add "YourModName_" to the front of both of those (YourModName_Civ4UnitSchema.xml), and then in UnitInfos, change the following line:

    <Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">

    to

    <Civ4UnitInfos xmlns="x-schema:YourModName_CIV4UnitSchema.xml">
     
  13. odalrick

    odalrick Chieftain

    Joined:
    Nov 12, 2003
    Messages:
    1,114
    You don't actually have to rename the schema, but if you don't any later patch that alters the schema will break your module.
     
  14. Pohlmann

    Pohlmann Chieftain

    Joined:
    Feb 24, 2009
    Messages:
    232
    thx!

    another question. wanted to make a spell that converts all living resources into a drained resource. that wasnt too hard as i could copy the fertility code :D and modify it. but then i want the bonus to return to its original form some turns later. i have no idea how to achieve this.
    Is there a way to do this like improvements say "10 turns to village"?
    If not i could do it like its done with hell terrain and turn the terrain to something drained earth like thingy for 10 turns and then turn it back to the old form but i dont know how to do that, either.
     
  15. JujZe

    JujZe Chieftain

    Joined:
    Nov 17, 2005
    Messages:
    76
    Location:
    Finland
    Im learning a little modding by myself, but how do I make a spesific unit non buildable?
    Im making sheaim (my favourite civ) more funnier, I have a lot of questions but I have solved some by just looking the code.
    Is there any good tutorial about how to add units or change unit art?

    Thanks! :)
     
  16. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    This is true, but renaming it is a good idea regardless. :lol:

    You can use the setTempBonusType function. For example:

    pPlot.setTempBonusType(Bonus, Timer)

    There are several ways.... Easiest way would be to use <iCost>-1</iCost>
     
  17. arcticnightwolf

    arcticnightwolf Chieftain

    Joined:
    Jun 8, 2008
    Messages:
    1,301
    Location:
    Prague, Czech Republic
    Is it possible to use relative path to base schema ?? (( Like: "../../Assets/Units/CIV4UnitSchema.xml" ))
     
  18. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    No idea.
     
  19. Beardy Dan

    Beardy Dan Chieftain

    Joined:
    Aug 4, 2009
    Messages:
    150
    Is there a (preferably easy) way to add a new specialist type for one Civ only?
     
  20. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Not at the moment, unfortunately.
     

Share This Page