Problems with <Delete /> -- Making a TechTree from scratch

Xadie

Chieftain
Joined
Aug 3, 2009
Messages
7
Location
Dresden
After careful reading Kaels Guide and adding several testing technologies into the game, I thought it is time to start what I really want: Building a complete new tech tree from scratch. And the problems began...

As the amount of dependencies between the "Rule-Tables" is sheer endless just deleting the technologies.xml and adding a new one wouldn't work. So the plan is point all tech references to one dummy tech, then building a new tech tree.

Obviously the old techs had to disappear, so I tried my luck with <Delete />

According to Kaels Guide if I use:

<Technologies>
<Delete />
</Technologies>

Then it should delete all entries in the Technology Table and I should be able to add new stuff to it. So in theory if I set it up like this:

<Technologies>
<Delete />

<<copy+paste full content of original Technology-Table>>

</Technologies>

it should wipe the Technologies data-table clean and then populate it with the exact same data. The game should fire up without any problems (at least with my logic). But in practice I receive every time a CTD whenever I try to load the mod.

I cross-checked whether it is a problem with my installation:
- normal games start fine
- Kaels Civ Mod loads fine

On the project action the xml file is correctly implemented with

OnModActivated UpdateDatabase setuptechnologies.xml

I juggled around when to use the delete order and tried this:

<Technologies>
<Delete />
</Technologies>

<Technologies>
<<copied full content of original Technology-Table>>
</Technologies>

or puting the delete order into a different .xml file with these adjustments on the mod properties:

OnModActivated UpdateDatabase deletetechnologies.xml
OnModActivated UpdateDatabase setuptechnologies.xml


But nothing helps... there is CTD every time.

I checked the database.log file but it doesn't look any different than what appears normally.

Just now i also tried to add technology flavor and technology preq tables to my .xml file in case <Delete /> also wipes these clean. Same results.

So do you think that it is strange that it doesn't work? Now it get's way better:

When I do the EXACT same steps with civilizations:

<Civilizations>
<Delete />
<<copied full content of original Civilization-Table>>
</Civilizations>

..it works flawless. And all further changes on the table have been integrated into the game.

So what I'm missing here?
 
As the amount of dependencies between the "Rule-Tables" is sheer endless just deleting the technologies.xml and adding a new one wouldn't work. So the plan is point all tech references to one dummy tech, then building a new tech tree.

Just to confirm; you already went into the building.xml, unit.xml and resources.xml and changed all the prerequisites tech to <PrereqTech>TECH_DUMMY</PrereqTech> and then also created a technology called 'Dummy' to compensate?

Edit: Kael beat me to a response.. guess there's no work around =x. What happens if you set all the techs to have a prerequistie of tech_dummy as well?
 
ah.. I see. Thx for the quick response Kael.

So is there a way that technologies don't appear on the tech tree? So I could just turn these entries invisible on the tech-tree screen for now.

@Evalis: nope I haven't. Because before I want do such a huge undertaking (because tech references are everywhere, even in the AI files) I wanted to be sure that the <Delete /> works as expected. GOOD that I did that. Saved a lot of time.

Edit: Kael beat me to a response.. guess there's no work around =x. What happens if you set all the techs to have a prerequistie of tech_dummy as well?

It might work, but the clutter on the tech tree would be unbearable. But haven't tried that yet as it would take some time to set up the Update order for each tech in the game. I rather expect to hit at some limitation of how many tech can use the same preq.
 
Just to confirm; you already went into the building.xml, unit.xml and resources.xml and changed all the prerequisites tech to <PrereqTech>TECH_DUMMY</PrereqTech> and then also created a technology called 'Dummy' to compensate?

And don't forget the help texts (in NewText/EN_US/etc.), which includes, for instance, a file whose sole purpose is to provide the language-specific name ("Iron Working") corresponding to each tech ("TECH_IRON_WORKING"). When you're adding new techs, there are a LOT of random things to adjust for.

Now, I don't know why that'd lead to a CTD if you just tried to add back in the original tech tree. It's possible that the tech tree is hard-coded to always have at least one valid entry, so a full delete wouldn't work, while that limit might not exist for things like Civs.

(In my mod I'm adding about 45 new techs, complete with units, wonders, improvements, rule changes, etc., and it's been a tremendous amount of work to ensure that everything's cross-linked correctly.)
 
@Spatzimaus:
So far all my testings have shown that the texts are absolute non critical. Whenever the program couldn't find the matching string to the text key it just displayed the text key as string in-game. So no problems there.

But as Kael pointed out (check out the link) it seems like there is no easy solution to it.
 
So far all my testings have shown that the texts are absolute non critical. Whenever the program couldn't find the matching string to the text key it just displayed the text key as string in-game.

Sure, I'm not claiming that those help texts will break the game per se. My point was just that the interdependencies in Civ5 are pretty far-reaching, especially in the technologies. Adding a new tech requires changes in a LOT of places; new tech definition, new flavor for the AI, new prerequisites, references in help text, references in civilopedia, half a dozen new icon sizes, and so on, and that's before you start adding units or improvements to it. Even if many of those are bypassable, I'd think that it would be easy to miss a critical one somewhere. (Barring Kael's bug report, of course.)

I kind of miss the Civ 3-style mod interfaces; adding a new tech or unit to earlier games was pretty easy, even if it couldn't do nearly as much with them due to hard-coding. You didn't have to deal with dozens of files at once in Civ 3. (Now, I LOVE the dynamic techtree of Civ5, how it draws in the arrows as needed and reshapes the eras to the techs within them. So I'd never go back, I'm just saying.)

As to the OP, one way around this could be to delete all but one tech. So you delete everything with ERA_ANCIENT, ERA_CLASSICAL, etc. to knock out the existing tree in clumps, but leave the Future Tech. (Hmm, could you delete any tech with a cost greater than 0, leaving only Agriculture? Not sure if greater than or less than logic works on those Where commands.) Then after adding in your new ones, delete the remaining original tech.
Or if it executes the commands in order (which it'd seem to, given your test cases), then add in your new techs first, giving them unique era names (or some other identifier that old techs don't have), and then wipe out all of the old eras one at a time; no need to save any techs at all that way. Either way works.
 
If you want to delete anything, you have to unlink it from everything else first.
 
Back
Top Bottom