Modders - any way to keep "standard" units from being produced by a custom faction?


Not sure if this can be done, but better minds than mine......

I created a bunch of custom factions, and played each one so I could create special units for them all.  Now I want to play AGAINST eaach of these factions, but they typically still produce a bunch of "standard" units - e.g. Defender, Spearman, etc. - during the game.  I would prefer to have the factions create ONLY the units I designed for them.

Anybody know if/how this can be done?

Thanks

14,820 views 11 replies
Reply #1 Top

Remove the standard units from the XML. Or alter them so that they cannot be trained, by inserting prerequisites that can't be fulfilled.

Reply #2 Top

Actually, it is probably much easier to create a new racetype for the faction. See CoreRaceTypes.xml.

The racetype is then declared for each faction in its raceconfig ex <RaceInternalName>Race_Type_Altarians</RaceInternalName>

You'd have to change the racetype in all your pre-designed units as well.

Reply #3 Top

Indeed as Heavenfall said give either give the basic units a new antirequisite, or try creating a new race for those new factions. Basic units are tied to race. There is a race editor around.

Reply #4 Top

If I go route of deleting standard unit types from faction xml, do I delete both these lines?

"<StartingUnitType>Unit_Defender_Quendar</StartingUnitType>"

"<StartingUnitType>Unit_Defender_Quendar_AI</StartingUnitType>"

 

In any case, thanks so much for the thoughts!

Reply #5 Top

Those are two different units, one is just a AI only design. So ya delete both.

Reply #6 Top


For what it is worth, deleting the:

"<StartingUnitType>Unit_Defender_Quendar</StartingUnitType>"

"<StartingUnitType>Unit_Defender_Quendar_AI</StartingUnitType>"

etc.

from the faction.xml for the faction you created in the mod Rae folder doesn't do anyhting - they still show up in the game.

So going to go route of creating new racetypes..although not looking forward to having to change racetype for all the units I created - pesky!

Reply #7 Top


Also, for fun, I also tried deleting the

"<StartingUnitType>Unit_Defender_Quendar</StartingUnitType>"

"<StartingUnitType>Unit_Defender_Quendar_AI</StartingUnitType>"

etc.

from the "CoreraceTypes.xml" in the c:/Program Files (x86)...../English" folder...also made no impact and all nuits still showed up

 

Just an fyi - back to ceating nw racetypes....

Reply #8 Top

If they are not in racetypes and they are not in your raceconfig, they really should not show up in-game (except pioneers which have a hardcode I think?). Remember to restart the game and start a new game every time you change XML.

Reply #9 Top


Question.  If I have custom units I built while playing a faction, when it's under AI control, will the AI build those custom units along with the regular units?  I hadn't even considered playing the faction and making units for them.

Reply #10 Top

The AI will use any designs you create. It is thus a very good idea to play through as a custom faction and make them some custom units.

Reply #11 Top


Cool, thanks for confirming this.  Thats what it sounded like while I was reading the thread, but now I know for certain.  I'm going to play some quick paced games with the various factions and make some custom units for them!