Set a few years before the events of Episode IV A New Hope, Empire at War lets players rewrite history as well as experience the aftermath of Star Wars: Episode III Revenge of the Sith, the creation of the Rebel Alliance, and Darth Vader's rise to power.

Post tutorial Report RSS Tutorial: Enabling/Disabling Units by Tech Level for Galactic Conquest

In This tutorial we will be covering how to make units enable or disable themselves by Tech Levels. This is pretty easy but does require editing several Files and common sense.

Posted by on - Intermediate Client Side Coding

Tutorial: Enabling/Disabling Units by Tech Level for Galactic Conquest
By: rebel5555 (AKA Joshua R.)

In this tutorial we will be covering how to make units enable or disable themselves by Tech Levels. This is pretty easy but does require editing several Files and common sense.

So, lets start by finding a Unit that we want to enable at a certain tech level. I will be using the
XJ-Wing to enable itself at tech level 3 replacing the old and outdated X-Wing.


    <Squadron Name="XJ_Wing_Squadron">
        <Text_ID> TEXT_XJ_WING_SQUADRON </Text_ID>
        <Encyclopedia_Good_Against> TIE_Fighter TIE_Interceptor TIE_Avenger </Encyclopedia_Good_Against>
        <Encyclopedia_Vulnerable_To> Imperial_Lancer_Fregatte Assault_Gunboat </Encyclopedia_Vulnerable_To>
        <GUI_Row> 1 </GUI_Row>
        <Required_Timeline />
        <Required_Special_Structures />
        <Squadron_Units>XJ-Wing, XJ-Wing</Squadron_Units>
        <Squadron_Units>XJ-Wing, XJ-Wing</Squadron_Units>
        <Squadron_Units>XJ-Wing, XJ-Wing</Squadron_Units>

        <Max_Squad_Size> 6 </Max_Squad_Size>
        <GUI_Offset>0 0 0</GUI_Offset>


        <Property_Flags> SmallShip </Property_Flags>
        <Unit_Abilities_Data SubObjectList="Yes">
            <!-- Primary ability -->
                <Mod_Multiplier>WEAPON_DELAY_MULTIPLIER,    3.0f</Mod_Multiplier>
                <Mod_Multiplier>SHIELD_REGEN_MULTIPLIER,    1.0f</Mod_Multiplier>
                <Mod_Multiplier>ENERGY_REGEN_MULTIPLIER,    1.0f</Mod_Multiplier>
                <Mod_Multiplier>SPEED_MULTIPLIER,        2</Mod_Multiplier>
                <!-- details in the unit's XML -->
        <Encyclopedia_Unit_Class> TEXT_ENCYCLOPEDIA_CLASS_FIGHTER </Encyclopedia_Unit_Class>
        <Tactical_Build_Prerequisites />
        <Score_Cost_Credits> 600</Score_Cost_Credits>

Alright, I've got my code for XJ-Wing's Squadron and I've set it's tech level to level 3. Next we're going to add the trigger that enables it in GC and disables the X-Wing.

This is were you will most likely have to edit several files. Lets open CAMPAIGNS_MULTIPLAYER.XML & CAMPAIGNS_SINGLEPLAYER.XML. These files are the basis for any Galactic Conquests (I've seen some mods use both of them or just one of them). In CAMPAIGNS_SINGLEPLAYER.XML the first entry should be:

<Campaign Name="Sandbox_Alderaans_Demise_Rebel">

Under this entry find:


The Above code references an XML file that contains the plot information for this particular GC Scenario. now find that file and open it. When you have opened it find:


This is the file that contains the triggers that enable/disable units for this certain GC, now lets open that file.

When you open that file you will/should see the following code:

<?xml version="1.0" ?>

<!--****** This story file is used to automatically set some things that would normally happen ******-->
<!--****** in story mode for the full campaign.  This file should be generic enough to use for  ******-->
<!--****** any sandbox campaign set.                                                           ******-->

<!-- Sandbox Campaign: Alderaan's Demise -->


    <Event Name="Universal_Story_Start">

<!-- Force Rebels to get X-wing instead of Z-95 to start -->
    <Event Name="Unlock_X_wings">

<!-- Rebel Hero Release -->

    <!-- Spawn Starting Heroes -->

    <Event Name="Rebel_AI_Heroes_01">

    <Event Name="Rebel_AI_Heroes_02">

    <!-- Spawn Tech 1 Heroes -->

    <Event Name="Rebel_AI_Heroes_03">

    <Event Name="Rebel_AI_Heroes_04">

    <!-- Spawn Tech 2 Heroes -->

    <Event Name="Rebel_AI_Heroes_05">

    <Event Name="Rebel_AI_Heroes_06">

    <!-- Spawn Tech 3 Heroes -->

    <Event Name="Rebel_AI_Heroes_07">

    <Event Name="Rebel_AI_Heroes_08">

    <!-- Spawn Tech 4 Heroes -->

    <Event Name="Rebel_AI_Heroes_09">

    <Event Name="Rebel_AI_Heroes_10">

    <Event Name="Rebel_AI_Heroes_11">


What we are going to do is create a new entry that will tell the game
to enable our XJ-Wing and replace/disable the X-Wing. here's the Code:

    <!--Replace X-Wing with XJ-Wing-->
    <Event Name="Remove_X-Wing">
        <Prereq>Unlock_X_wings Rebel_AI_Heroes_07</Prereq>

What the following code does is It Replaces the X-Wing with the XJ-Wing
at tech level 3. You ask How do I know it's tech level 3? That's easy
it's this following section of code that tells us this:

    <Event Name="Rebel_AI_Heroes_07">

Now our XJ-Wing will replace the X-Wings in the GC "Alderaan's Demise". To do this with other GC's follow the previous steps to find out which GC Plots files are what or you can just add this to every Story_Sandbox_#_Rebel/Empire.XML + STORY_UNIVERSAL_TRIGGERS_R/E.XML.

From another site where my tutorial is at the user JC9542 has brought to my attention that if you start at higher Tech Level you can have multiple versions of a unit. JC9542 along with Smallpox's help have came up with a solution to this that I have added to the above tutorial. Below are the primary guidelines to do this.

JC9542 wrote: So far as I can figure it out the important things are:
1.Upgraded Squadron/company must be initially locked, but not sliceable.
2.Event code for 2nd upgrade and so on needs to have at least 2
parameters to trigger, an event from the correct tech level and the
previous upgrade has to have occured.

I hope this tutorial has been helpful and hasn't confused you. Remember
coding can be frustrating so if you are feeling like throwing your
computer out the window just take a break.

Have fun,

Rebel5555 (AKA Joshua R.)

rebel5555 Author

If you need any help following this tutorial or want to post any feedback please feel free to leave me a comment or send me a pm.

Reply Good karma+1 vote

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Star Wars: Empire At War
Windows, Mac
Send Message
Release date
Game watch
Related Games
Star Wars: Empire At War
Star Wars: Empire At War Real Time Strategy
Related Engines
Alamo Commercial
Related Groups
LucasArts Developer & Publisher
Petroglyph Developer & Publisher