Total conversion mod questions

Ahwaric

Shrubbery-hugger
Joined
Nov 12, 2005
Messages
1,217
Location
Kraków, Poland
First, sorry for starting another thread, with questions that probably were answered over and over.
Unfortunatelly, I can't find answers to some of my problems, and I am starting to feel frustrated. So before I explode or will underestimate Civ5 modding, let me ask ;)

In short, I am working on total conversion mod and would like to start with clean database regarding techs, civilizations, units and buildings, then add my own, though some using the same names.

1. Is there a way to make game overwrite the default assets with my own?
I.e. I have replaced the agriculture tech, or simply its description. I understand I should delete agriculture tech (or description) and then add another tech of that name? Is it possible?

2. Deleting techs
As an experiment, I have tried to add fishing tech and remove future tech. If I do only one thing at a time, it works fine. BUt If I put both deleting and adding parts in one file, it does nothing. If I put it in different files, one for delete and one for add, the game crashes on mod start.

3. C++
A very basic question, but one not covered by Kael's excellent guide. How do I access C++ edition? And how would I add table line to make a tag work?

4. Is it normal that it is hard to add Actions in mod properties? It takes me several tries to put OnModActivated and UpdateDatabase, usually if I hit enter it goes blank and I have to try again.

I would prefer xml solutions whenever possible, for several reasons I do not feel comfortable with sql edition.

Thanks for any help guys. The Orbis 2 existence is in your hands.

Edit: Just in case, the code for tech changes I am using.
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with the Orbis II xlsm editor by Ahwaric -->
<GameData>
    <Technologies>
        <Row>
            <Type>TECH_FISHING</Type>
            <Description>TXT_KEY_TECH_FISHING_TITLE</Description>
            <Civilopedia>TXT_KEY_TECH_FISHING_DESC</Civilopedia>
            <Help>TXT_KEY_TECH_FISHING_HELP</Help>
            <Quote>TXT_KEY_TECH_FISHING_QUOTE</Quote>
            <PortraitIndex>13</PortraitIndex>
            <IconAtlas>TECH_ATLAS_2</IconAtlas>
            <AudioIntro>AS2D_TECH_TRAPPING</AudioIntro>
            <AudioIntroHeader>AS2D_HEADING_TECH_TRAPPING</AudioIntroHeader>
            <Era>ERA_ANCIENT</Era>
            <GridX>0</GridX>
            <GridY>3</GridY>
            <Cost>55</Cost>
            <Trade>true</Trade>
            <GoodyTech>true</GoodyTech>
        </Row>
    </Technologies>
    <Technology_DomainExtraMoves>
    </Technology_DomainExtraMoves>
    <Technology_ORPrereqTechs>
    </Technology_ORPrereqTechs>
    <Technology_PrereqTechs>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <PrereqTech>TECH_TRAPPING</PrereqTech>
                </Row>
    </Technology_PrereqTechs>
    <Technology_Flavors>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <FlavorType>FLAVOR_GOLD</FlavorType>
                    <Flavor>8</Flavor>
                </Row>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <FlavorType>FLAVOR_TILE_IMPROVEMENT</FlavorType>
                    <Flavor>2</Flavor>
                </Row>
    </Technology_Flavors>
</GameData>
and the deleting:
Spoiler :
Code:
<GameData>
	<Technologies>
		<Delete Type="TECH_FUTURE_TECH"/>
	</Technologies>    
</GameData>
Also, text file
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with the Orbis II xlsm editor by Ahwaric -->
<GameData>
    <Language_en_US>
            <Row Tag="TXT_KEY_TECH_FISHING_TITLE">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_DESC">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_HELP">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_QUOTE">
                <Text>Fishing</Text>
            </Row>
    </Language_en_US>
</GameData>
In the attachment, you can see what I get in Database.log after the crash :crazyeye:
Edit&#321; removed - only general bugs were in
 
I am a beginner myself. Welcome.

I think your problem with deleting techs is that deleting Future Tech screws up the victory conditions code written into the game. In other words, it tests to see if you have researched Future_Tech, and if you have, you get so many points for having the full research tree. Many other people have reported this crash.

I bet if you search the forum there is a thread out there dedicated to getting rid of Future_Tech without crashing. Some claim that using the Delete worked for them... I dunno.

I think all your problems are related to deleting future tech. I personally have used delete commands (Tags?) in the same files as other commands. You want to avoid deleting techs outright because other game elements refer to them, and if they are missing, you will be in trouble. For example, deleting Future_Tech from the Technologies table does not remove it from the Technologies_PrereqTech table or the Technologies_Flavors table. The game will puke when it finds something undefined.

Yes, you can delete Agriculture and then re-declare it.

A more elegant solution might be to use the update tag:
<Update>
<Set GridX="1"/>
<Where Type="TECH_AGRICULTURE/>
</Update>

However elegant this might be, it involves lots of typing. Simply deleting the old tech, then copying the row definition from the original files and modifying it makes it go faster. But it depends what you want to change... Almost everything about Agriculture Tech you would want to change isn't stored in the <Technologies> table anyways. The prerequisites are in <Technologies_PrereqTechs> (double check the spelling on that one). The fact that Agriculture allows building a farm is stored somewhere in tileimprovement tables. The fact that Agriculture is a free tech is somewhere else... and the list goes on. Oh, and the text in the Civilopedia entry and the name of the tech "Agriculture" is in the <Language_en_US> table. (This is so multiple game translations have one single file and single table each.) So the point is, you likely only want to change one value here, one value there, so <Update> is really helpful.

The only things you probably want to change in Agriculture are the GridX, GridY, and Cost. Perhaps the icons as well... probably not. In this case, it is only 3 statements to update.

If you want to update the Text entries, use update tag to change the "TXT_KEY_TECH_AGRICULUTE_XXX" in the english language table.

Your error file looks identical to mine. I've never seen it change. I don't know what that means, but there you go.

I can't speak about the C++ side of things. I believe I read LUA can call C++ functions...

For Actions in Mod Properties, I click between boxes and type. Then I hit enter in the third box. It is a little goofy until you realize it only wants to work one way.

A great mod to look at to see how to do a mod like what you are thinking about is called Total Mod (Alpha). You can download it via the game in the Mods section. You can then see the XML, Art, and LUA files.
 
1 It is impossible to overwrite it but you can make for example:
Code:
<GameData>
	<Civilizations>
		<Delete />
	</Civilizations>
</GameData>
and then add what you want to add:
Code:
		<Row>
			<Type>CIVILIZATION_*****</Type>
			<Description>TXT_KEY_CIV_*****_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_*****_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_*****_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_*****_PEDIA</Civilopedia>
			<DefaultPlayerColor>PLAYERCOLOR_*****_WHITE</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_*****</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_*****</ArtStyleType>
			<Playable>*****</Playable>
			<AIPlayable>*****</AIPlayable>
			<PortraitIndex>*****</PortraitIndex>
			<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
			<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
		</Row>

2 I haven't changed teches yet but I already deleted alll units from game and added my own so try to check your xml and find mistakes

3 Firaxis haven't released C++ codes so you can't use it yet

4 I have similar problem and I solved it in this way: copy your sentence(Example: "OnModActivated") before doing next line.

P.S.
I hope Orbis 2 or FFH will be out as soon as possible :)
 
As far as the database errors, my advice is to make the foreign keys between the Language_en_US table and the other two tables in that database log cascade on delete. It looks like you have removed some records from Language_en_US while the dependent records still remain in the other two tables. But this is really hard to clean up a database, when you don't know what the schema is.
 
First, sorry for starting another thread, with questions that probably were answered over and over.
Unfortunatelly, I can't find answers to some of my problems, and I am starting to feel frustrated. So before I explode or will underestimate Civ5 modding, let me ask ;)

In short, I am working on total conversion mod and would like to start with clean database regarding techs, civilizations, units and buildings, then add my own, though some using the same names.

1. Is there a way to make game overwrite the default assets with my own?
I.e. I have replaced the agriculture tech, or simply its description. I understand I should delete agriculture tech (or description) and then add another tech of that name? Is it possible?

2. Deleting techs
As an experiment, I have tried to add fishing tech and remove future tech. If I do only one thing at a time, it works fine. BUt If I put both deleting and adding parts in one file, it does nothing. If I put it in different files, one for delete and one for add, the game crashes on mod start.

3. C++
A very basic question, but one not covered by Kael's excellent guide. How do I access C++ edition? And how would I add table line to make a tag work?

4. Is it normal that it is hard to add Actions in mod properties? It takes me several tries to put OnModActivated and UpdateDatabase, usually if I hit enter it goes blank and I have to try again.

I would prefer xml solutions whenever possible, for several reasons I do not feel comfortable with sql edition.

Thanks for any help guys. The Orbis 2 existence is in your hands.

Edit: Just in case, the code for tech changes I am using.
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with the Orbis II xlsm editor by Ahwaric -->
<GameData>
    <Technologies>
        <Row>
            <Type>TECH_FISHING</Type>
            <Description>TXT_KEY_TECH_FISHING_TITLE</Description>
            <Civilopedia>TXT_KEY_TECH_FISHING_DESC</Civilopedia>
            <Help>TXT_KEY_TECH_FISHING_HELP</Help>
            <Quote>TXT_KEY_TECH_FISHING_QUOTE</Quote>
            <PortraitIndex>13</PortraitIndex>
            <IconAtlas>TECH_ATLAS_2</IconAtlas>
            <AudioIntro>AS2D_TECH_TRAPPING</AudioIntro>
            <AudioIntroHeader>AS2D_HEADING_TECH_TRAPPING</AudioIntroHeader>
            <Era>ERA_ANCIENT</Era>
            <GridX>0</GridX>
            <GridY>3</GridY>
            <Cost>55</Cost>
            <Trade>true</Trade>
            <GoodyTech>true</GoodyTech>
        </Row>
    </Technologies>
    <Technology_DomainExtraMoves>
    </Technology_DomainExtraMoves>
    <Technology_ORPrereqTechs>
    </Technology_ORPrereqTechs>
    <Technology_PrereqTechs>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <PrereqTech>TECH_TRAPPING</PrereqTech>
                </Row>
    </Technology_PrereqTechs>
    <Technology_Flavors>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <FlavorType>FLAVOR_GOLD</FlavorType>
                    <Flavor>8</Flavor>
                </Row>
                <Row>
                    <TechType>TECH_FISHING</TechType>
                    <FlavorType>FLAVOR_TILE_IMPROVEMENT</FlavorType>
                    <Flavor>2</Flavor>
                </Row>
    </Technology_Flavors>
</GameData>
and the deleting:
Spoiler :
Code:
<GameData>
    <Technologies>
        <Delete Type="TECH_FUTURE_TECH"/>
    </Technologies>    
</GameData>
Also, text file
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with the Orbis II xlsm editor by Ahwaric -->
<GameData>
    <Language_en_US>
            <Row Tag="TXT_KEY_TECH_FISHING_TITLE">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_DESC">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_HELP">
                <Text>Fishing</Text>
            </Row>
            <Row Tag="TXT_KEY_TECH_FISHING_QUOTE">
                <Text>Fishing</Text>
            </Row>
    </Language_en_US>
</GameData>
In the attachment, you can see what I get in Database.log after the crash :crazyeye:


  1. If you are changing just a small part of what the Agriculture tech does, it is best to simply use an Update command (unless you drop all tables via SQL first, of course).
  2. Future Tech causes problems when deleted. Other assets work fine if you have delete commands and new content next to each other.
  3. You cannot access C++ yet. Best estimates are January or February of next year. It takes time to clean up the code after release to make it suitable for public consumption, and they also want a stable codebase (get the initial patches out). The same thing happened with Civ4 when it was released, so it was expected. Still frustrating, as my own mod is waiting on it.
  4. I've never had a problem with entering them, it's the fact that I can't scroll the screen and see all my files that causes problems. :lol: I simply type OnModActivated, hit tab, type UpdateDatabase, hit tab, enter the file, hit enter.

And I am telling you, sql is faster than using xml to clear things out. However, if you want to stick with xml, use the delete command the way Magzhi said. A little more typing, but it does the same thing as sql when it is loaded. Just make sure you do that for ALL tables involving units, buildings, civs, etc.
 
I am a beginner myself. Welcome.
I do not think I am a begginer any more. Well, I am , but just for Civ5. It gives me big headache and never ending frustration.

Thanks for all suggestions though, every help is appreciated.

Regarding my questions:

1. Unfotunatelly, in most cases I change all properties of an item (be it building, unit or tech). Usually, only the name is left. So, I will try to find a way to replace it.
Ok, no overwriting. When the modding is fixed (as it is clearly broken right now), I will delete all conflicting assets and then fill it with my own.

2.Future tech should stay then. But unfortunatelly, techs can't be deleted at all. Well, at least not if you also plan to add techs.

3.I should have check that. I guess the information "sdk released" got me confused.
But still, as it is, I can't imagine adding a new tag. There are much simpler things not working.

4. Using Tab did the trick. Thanks Valkrionn :)

Valkrionn said:
And I am telling you, sql is faster than using xml to clear things out. However, if you want to stick with xml, use the delete command the way Magzhi said. A little more typing, but it does the same thing as sql when it is loaded. Just make sure you do that for ALL tables involving units, buildings, civs, etc.

Ok, but there are two problems:
A.I know nothing of sql and have to learn it first
B.I am changing a lot of things in xml anyway. Couple extra delete lines does not change much.

For now, I hope we all will be able to help firaxis to move Civ5 modding past beta phase soon ;)
In the meantime, I decided to mess with base Civ5 xml files. And it is much easier with the excell editor I created, so for now I can wait ;)
 
Ahwaric,

For the sake of seeing Orbis2 a few hours earlier, I updated my total conversion mod progress here with some things that may be useful to you. Also, you will find that you have to learn SQL sooner or later, and sooner will be better for your mental health (my example should help).
 
How would I use the SQL to clear out the vanilla unit xML file considering I want to totaly replace it?
 
Ajidica, follow the link in my post above. (It's not exactly what you want, but as close as I've been able to come after much effort.)
 
Top Bottom