Buttons showing up unintentionally

zahgrim

Chieftain
Joined
Mar 3, 2009
Messages
11
Location
Toronto, ON, Canada
Newb here with a quick question:

I put together a quick mod on an Earth map, with a bunch of civs; I have since customized some of the units for the whole game (i.e. via Assets/XML/Units/UnitInfo, etc. etc.), as well as added some Modular Custom Civilizations (specifically America, Israel, and Italy... with more to come; Many thanks to strategyonly for a lot of great work on his modular civs!)

I changed the art on the game-wide Carrier, and then added a Supercarrier (using a copy of the included 'Nimitz'-like art) strictly for the Americans; I also added to new types of fighters, again, strictly for the Americans;

My problem is this:
When testing as a playable civ OTHER than the Americans, I get "duplicate" build buttons in the City Interface; In the case of the Carrier, it's identical to the 'normal' Carrier build button a few spots to the left... it's mouseover displays the correct generic carrier info, and it does in fact build a generic carrier; Same thing happens for both fighter buttons... the game creates an additional button for the generic fighter which behaves the same way...

Is there any tips on where I might have messed up? Shouldn't the new units and their respective build buttons be visible only when playing as the Americans?

Also, if anyone knows how to "arrange" the list/display order of the buttons, I would love to tidy that up too!

Thanks for reading all this, hope you can help!
Cheers,
Z.
 
What is your UnitInfos and UnitClassInfo?
It sound like a problem there.

PS:
Welcome to the Forums, zahgrim.:beer:
 
Thanks for the welcome! For all the years I have been computing and gaming, this is actually the very first forum I have EVER interacted with... I usually just read what other people have to say! Very good people here so far!

The primary files I have been editing are:
MyMod/Assets/XML/Units/UnitInfos.xml
MyMod/Assets/XML/Units/UnitClassInfos.xml
MyMod/Assets/Modules/Custom Civilizations/America/America_UnitInfos.xml
MyMod/Assets/Modules/Custom Civilizations/America/America_UnitClassInfos.xml

I will try to attach them to this post (SUCH a newb I am!)

If that works, and you would take a look, it would be much appreciated!

I did try changing the <DefaultUnit> tags to match the <UnitType>, thinking it wouldn't be a "Replaces Carrier" unit anymore, but that just made the America specific units available to all the civs!

See what you think!
Cheers,
Z
 

Attachments

You want to create an unit, which can only be built by americans, and you did it, through replacing the standard-unit through an other unit, am i right?

If yes: This will not work.
The double buttons are right for this case, because you get an carrier for the normal carrier, and you get an carrier for the super-carrier.

What would work: You would have to add to every civ an UU with the unitclass of your wished unit, but for the unit you type NONE in it.
So all other civilizations can't build this unit.
 
J, thanks for the reply!

I wanted to create a "generic" carrier for all civs, with standard stats, and in effect I really only changed the art on the standard UNIT_CARRIER in the CIV4ArtDefines_Unit.xml.

I then copied the art from the included Carrier (which is in fact a model of a Nimitz class Supercarrier) into my America UU module. That worked.

So the run-of-the-mill Carrier gets a new look, and we use the art from a copy of the old Carrier to represent the Supercarrier... (gets a bit confusing doesn't it!:))

I want America to have access to both the "generic" carrier, and the UU Supercarrier; Other civs should only have access to the "generic".

America is working perfectly;

What is not is that this extra button is showing up for other civs, but it is NOT the Supercarrier button, it's merely a second copy of the "generic" Carrier, about 3 slots down from the first instance of the button.

i.e. Italian city interfaces have 2 identical buttons for building a Carrier, which are the same look (referencing the same .dds) and when used either button will produce the same "generic" carrier, NOT a generic carrier and a Supercarrier.

The same situation exists with the UU fighters I added... other civs get extra buttons, but those buttons are also identical copies of the standard Jet Fighter button, and either button will only produce a standard Jet Fighter...

Does that explain the situation better? I appreciate your interest, as I am very new at this... I hope that I am explaining the situation adequately.

Thanks again for the reply.
 
Hey J,

IT WORKED! I had tried setting the <DefaultUnit> tag to match the <UnitType>, as I had seen in the base Civ4 files, that made them available to everyone... I didn't know NONE was an option! No more duplicate buttons for the non-american civs, and all the right ones for the american civ!

Interestingly, a side effect of the NONE setting seems to be that the new units are no longer reported as Unique Units in the leader selection screen, but I can live with that! I had one CTD when testing (happened when I rush built a vanilla fighter), but after numerous attempts I can't recreate the crash... so all is well!

I very much appreciate your help on this! I was really starting to pull my hair out on this one!

Any suggestions on how one can change the "order" that the buttons are presented in? i.e. I would like to have the fighters "grouped" together, the naval units, etc...

Thanks,
Z.
 
that the new units are no longer reported as Unique Units in the leader selection screen

no. you have to add any UU to CIV4CivilizationInfos.xml
 
Any suggestions on how one can change the "order" that the buttons are presented in? i.e. I would like to have the fighters "grouped" together, the naval units, etc...

The order the units and buildings are listed is determined through the order of the classes in the Civ4UnitClassInfos.xml, you would have to move the super-carrier unitclass definition before or after the unitclass of the normal carrier.

no. you have to add any UU to CIV4CivilizationInfos.xml

Yes, he did that.
But the default unit in unitclass was NONE, and now the UU is not reported as UU.
 
Thanks for that answer J! So herein lies the problem... my super-carrier and assorted aircraft are in a separate America_UnitClassInfos.xml, which resides in ZMod\Assets\Modules\Custom Civilizations\America\;

The Civ4UnitClassInfos.xml file resides in ZMod\Assets\XML\Units...

If I understand how the XML is loaded (and there is a really good chance I don't!), I would assume that the Civ4UnitClassInfos.xml version is being loaded, and the America_UnitClassInfos.xml is then read in next;

This would account for the fact that all the new units and their buttons I have added are appearing at the end of the available units build list in the City screen.

Or is it because the America_.* files are modular?

I will try experimenting to get to the correct answer, but if you know ahead of me (very likely!) trying, it would save me a lot of time and trouble!

Thanks again for all your help :)
 
If I understand how the XML is loaded (and there is a really good chance I don't!), I would assume that the Civ4UnitClassInfos.xml version is being loaded, and the America_UnitClassInfos.xml is then read in next;

This would account for the fact that all the new units and their buttons I have added are appearing at the end of the available units build list in the City screen.

Or is it because the America_.* files are modular?

I think, both things are the same. Normal civ can only have one file for the units, so there's only one way, to load an other file after the normal, and this is modular loading.

So the only way, to get your units to the right place, is, to make your mod not modular.
There's also the question, why do you do that?
When you have your own mod, there's no reason for making it modular.

Thanks again for all your help :)

I'm happy, when i can help :).


Oh, i was near forgetting it: I didn't find out, what causes the listing of the units, it was Cybah, who invested time in this :).
 
Back
Top Bottom