I thought I did everything right but I guess not

Forcystus

Chieftain
Joined
Sep 22, 2007
Messages
62
Location
Everywhere
I wanted to add the Eagle Warrior to the Aztec Civilization as part of a mod I'm working on. I imported the civilization and unit xmls into modbuddy. I then copy pasted all the spearman data and added two promotions to it. I then gave the Aztecs the unit. Finally I went to the mod properties and told it to add all of the changed files. When I got to the game, I installed the mod and started a game. The Eagle Warrior did not exist. What did I do wrong?
 
You can't just copy paste the entire core file. Your file will fail in that instance.

It's not like civ4 where you REPLACE the core file. In civ5 your xml ADDS to the core files.
 
Actually ... I think that If you are really naughty you can! (and/or if you are restructuring an entire XML for a special scenario/mod).

Although I haven't tested it yet then in theory adding <Delete/> to the start of all the individual nodes of your copy/pasted/edited XML(s) should work.
Code:
<GameData>
	<[I]whatever node #1[/I]>
		[B]<Delete/>[/B]
		...
		[I]copy/pasted/edited xml entries[/I]
		...
	</[I]whatever node #1[/I]>
	<[I]whatever node #2[/I]>
		[B]<Delete/>[/B]
		...
		[I]copy/pasted/edited xml entries[/I]
		...
	</[I]whatever node #2[/I]>
	...
	etc. etc.
	...
</GameData>

Just keep in mind that if you do this it wont exactly do wonders for the chance that other mods will also be able to work along side yours.
 
Actually ... I think that If you are really naughty you can! (and/or if you are restructuring an entire XML for a special scenario/mod).

Although I haven't tested it yet then in theory adding <Delete/> to the start of all the individual nodes of your copy/pasted/edited XML(s) should work.
Code:
<GameData>
	<[I]whatever node #1[/I]>
		[B]<Delete/>[/B]
		...
		[I]copy/pasted/edited xml entries[/I]
		...
	</[I]whatever node #1[/I]>
	<[I]whatever node #2[/I]>
		[B]<Delete/>[/B]
		...
		[I]copy/pasted/edited xml entries[/I]
		...
	</[I]whatever node #2[/I]>
	...
	etc. etc.
	...
</GameData>

Just keep in mind that if you do this it wont exactly do wonders for the chance that other mods will also be able to work along side yours.

If you want to delete everything, there's no need to copy the whole original file. Just use the delete all command. ;)
 
If you have lots of changes to make this would be way faster than using the rather rigid <Update><Where><Set> method for each and every entry you wanted to change. Especially if you are continually experimenting and are likely to perform several adjustments and additions.

I used the method myself for moving the tech entries from being all AND to being all OR reqs - and after the deletion adding a few entirely new AND reqs.
 
Wait, so if I'm just adding something, all I have to do is input that? What if I'm changing something that already exists?
 
Thanks. One last strange problem. Whenever there is more than two unique things (either unit or building or any combination) it only displays two at the beginning. However, they are all available during play. Is there anyway to fix this?
 
If you have lots of changes to make this would be way faster than using the rather rigid <Update><Where><Set> method for each and every entry you wanted to change. Especially if you are continually experimenting and are likely to perform several adjustments and additions.

I used the method myself for moving the tech entries from being all AND to being all OR reqs - and after the deletion adding a few entirely new AND reqs.

You could use an SQL file in your mod. ;)

For instance, to modify every unit's cost........
Code:
UPDATE Units SET 'Cost' = cost*0.8 WHERE Cost > 0;
 
That is nice for sweeping changes and final release, but useless for WIP doing individual tech and resource prereq tweaks (etc.). SQL just doesn't make make that kind of editing needs any easier without a proper GUI frontend ... and since there isn't one of those then having all relevant data available in a few single files is still the 'best' option available.


@Forcystus:
That should be fixable by expanding on the various LUA generated screens that display civilization specific information (GameSetup and Civilopedia etc.)
 
All depends on what changes you're making. Like you said above if you're moving prereqs from AND to OR, that could be done in 2 SQL statements. Set OR = AND and then delete AND.
 
How would that be faster than what I did by adding <Delete/> and renaming the 'prereq' node to 'ORprereq' (that is now also available to be edited on an individual basis)?
 
It's a little quicker loading the mod as the engine now converts all the XML into SQL statements, where doing SQL statements skips that step. I dunno, a matter of style I suppose. :p
 
Can someone tell me where and how? I've never worked with Lua before
 
Back
Top Bottom