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.

Report article Tutorial: Good Times with the Rocket Ability

In this tutorial I will show you guys/gals how we can use the "Rocket Ability" to our advantage when modding EAW/FOC. Some of you might be wondering what is the "Rocket Attack Ability"? The answer is that it is the ability used by the T-4B to switch from it's main guns to use it's Rockets. This ability can be adapted to other units to do new things.

Posted by rebel5555 on Apr 21st, 2009 digg this super bookmark
Intermediate Client Side Coding.


Tutorial: Good Times with the Rocket Ability
By: rebel5555 (AKA Joshua R.)

In this tutorial I will show you guys/gals how we can use the "Rocket Ability" to our advantage when modding EAW/FOC. Some of you might be wondering what is the "Rocket Attack Ability"? The answer is that it is the ability used by the T-4B to switch from it's main guns to use it's Rockets. This ability can be adapted to other units to do new things.

Alrighty then. So, here we go. I'm using code from a modified B-wing from my personal mod. First I'm going to open SPACEUNITSFIGHTERS.XML & SQUADRONS.XML

SPACEUNITSFIGHTERS.XML

  1. XML code:
  1.   <SpaceUnit Name="B_Wing">
  2.     <Text_ID>RV_BWING_ID</Text_ID>
  3.     <Encyclopedia_Unit_Class> TEXT_ENCYCLOPEDIA_CLASS_BOMBER </Encyclopedia_Unit_Class>
  4.     <Encyclopedia_Text>RV_BWING_TEXT</Encyclopedia_Text>
  5.     <Encyclopedia_Good_Against> Executor_Stardestroyer ISD2 Star_Destroyer </Encyclopedia_Good_Against>
  6.     <Encyclopedia_Vulnerable_To> Imperial_Missleboat TIE_Avenger TIE_Defender </Encyclopedia_Vulnerable_To>
  7.     <Space_Model_Name>rv_bwing.alo</Space_Model_Name>
  8.     <Scale_Factor>0.38</Scale_Factor>
  9.     <Select_Box_Scale>70</Select_Box_Scale>
  10.     <Select_Box_Z_Adjust>1.0f</Select_Box_Z_Adjust>
  11.     <Mouse_Collide_Override_Sphere_Radius> 50.0 </Mouse_Collide_Override_Sphere_Radius>
  12.     <Dense_FOW_Reveal_Range_Multiplier>0.2</Dense_FOW_Reveal_Range_Multiplier>
  13.     <Mass>0.98</Mass>
  14.     <Max_Speed>4.6</Max_Speed>
  15.     <Min_Speed>1.5</Min_Speed>
  16.     <Max_Rate_Of_Turn>2.0</Max_Rate_Of_Turn>
  17.     <Max_Thrust>1.0</Max_Thrust>
  18.     <Max_Rate_Of_Roll>2.5</Max_Rate_Of_Roll>
  19.     <Bank_Turn_Angle>50</Bank_Turn_Angle>
  20.     <Begin_Turn_Towards_Distance>300.0</Begin_Turn_Towards_Distance>
  21.     <Fires_Forward>no</Fires_Forward>
  22.     <Turret_Rotate_Extent_Degrees>20</Turret_Rotate_Extent_Degrees>
  23.     <Turret_Elevate_Extent_Degrees>40</Turret_Elevate_Extent_Degrees>
  24.     <Hyperspace>Yes</Hyperspace>
  25.     <Hyperspace_Speed>0.6</Hyperspace_Speed>
  26.     <Maintenance_Cost>0.1</Maintenance_Cost>
  27.     <Max_Lift>4</Max_Lift>
  28.     <Affiliation>Rebel</Affiliation>
  29.     <Required_Ground_Base_Level>0</Required_Ground_Base_Level>
  30.     <Required_Star_Base_Level>1</Required_Star_Base_Level>
  31.     <Shield_Points>100</Shield_Points>
  32.     <Tactical_Health>120</Tactical_Health>
  33.     <Shield_Refresh_Rate>10</Shield_Refresh_Rate>
  34.     <Energy_Capacity>1000</Energy_Capacity>
  35.     <Energy_Refresh_Rate>500</Energy_Refresh_Rate>
  36.     <Armor_Type> Armor_Fighter </Armor_Type>
  37.         <Shield_Armor_Type>Shield_Fighter</Shield_Armor_Type>
  38.     <Ranged_Target_Z_Adjust>0</Ranged_Target_Z_Adjust>
  39.     <Ship_Class>bomber</Ship_Class>
  40.     <Formation_Priority>1</Formation_Priority>
  41.     <Is_Escort>No</Is_Escort>
  42.     <Is_Bomber>Yes</Is_Bomber>
  43.     <Political_Control>0</Political_Control>
  44.     <Squadron_Capacity>0</Squadron_Capacity>
  45.     <Number_per_Squadron>6</Number_per_Squadron>
  46.     <Build_Cost_Credits>60</Build_Cost_Credits>
  47.     <Build_Time_Seconds>15</Build_Time_Seconds>
  48.     <Size_Value>4</Size_Value>
  49.     <Land_Bomber_Type>B_Wing_Bombing_Run</Land_Bomber_Type>  
  50.     <SpaceBehavior>HUNT, ABILITY_COUNTDOWN, FIGHTER_LOCOMOTOR, SELECTABLE, TARGETING, WEAPON, POWERED, SHIELDED, HIDE_WHEN_FOGGED, AMBIENT_SFX, DAMAGE_TRACKING, REVEAL, NEBULA </SpaceBehavior>     
  51.     <Collidable_By_Projectile_Living>Yes</Collidable_By_Projectile_Living>
  52.     <Damage>7</Damage>
  53.     <Land_FOW_Reveal_Range>130.0</Land_FOW_Reveal_Range>
  54.     <Space_FOW_Reveal_Range>600.0</Space_FOW_Reveal_Range>
  55.     <Targeting_Max_Attack_Distance>500.0</Targeting_Max_Attack_Distance>
  56.     <Death_Explosions>Small_Explosion_Space</Death_Explosions>
  57.     <Death_SFXEvent_Start_Die>Unit_A_Wing_Death_SFX</Death_SFXEvent_Start_Die>
  58.     <Asteroid_Damage_Hit_Particles>Small_Damage_Space</Asteroid_Damage_Hit_Particles>
  59.     <Hardpoints>
  60.       HP_BWING_ION,
  61.       HP_Bwing_Lasers,
  62.       HP_BWING_Torpedo
  63.     </Hardpoints>
  64.     <SFXEvent_Fire>Unit_A_Wing_Fire</SFXEvent_Fire>
  65.     <SFXEvent_Select>Unit_Select_A_Wing</SFXEvent_Select>
  66.     <SFXEvent_Move>Unit_Move_A_Wing</SFXEvent_Move>
  67.     <SFXEvent_Fleet_Move>Unit_Fleet_Move_A_Wing</SFXEvent_Fleet_Move>
  68.     <SFXEvent_Attack>Unit_Attack_A_Wing</SFXEvent_Attack>
  69.     <SFXEvent_Guard>Unit_Guard_A_Wing</SFXEvent_Guard>
  70.     <SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_LASER, Unit_HP_LASER_A_Wing </SFXEvent_Attack_Hardpoint>
  71.     <SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_MISSILE, Unit_HP_MISSILE_A_Wing </SFXEvent_Attack_Hardpoint>
  72.     <SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_TORPEDO, Unit_HP_TORP_A_Wing </SFXEvent_Attack_Hardpoint>
  73.     <SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_ION_CANNON, Unit_HP_ION_A_Wing </SFXEvent_Attack_Hardpoint>
  74.     <SFXEvent_Attack_Hardpoint> HARD_POINT_SHIELD_GENERATOR, Unit_HP_SHIELDS_A_Wing </SFXEvent_Attack_Hardpoint>
  75.     <SFXEvent_Attack_Hardpoint> HARD_POINT_ENGINE, Unit_HP_ENGINES_A_Wing </SFXEvent_Attack_Hardpoint>
  76.     <SFXEvent_Attack_Hardpoint> HARD_POINT_GRAVITY_WELL, Unit_HP_GRAV_A_Wing </SFXEvent_Attack_Hardpoint>
  77.     <SFXEvent_Health_Low_Warning> Unit_Health_Low_A_Wing </SFXEvent_Health_Low_Warning>
  78.     <SFXEvent_Health_Critical_Warning> Unit_Health_Critical_A_Wing </SFXEvent_Health_Critical_Warning>
  79.     <SFXEvent_Enemy_Damaged_Health_Low_Warning> Unit_Enemy_Health_Low_A_Wing </SFXEvent_Enemy_Damaged_Health_Low_Warning>
  80.     <SFXEvent_Enemy_Damaged_Health_Critical_Warning> Unit_Enemy_Health_Critical_A_Wing </SFXEvent_Enemy_Damaged_Health_Critical_Warning>
  81.     <SFXEvent_Ambient_Moving> Unit_A_Wing_Fly_By </SFXEvent_Ambient_Moving>
  82.     <SFXEvent_Ambient_Moving_Min_Delay_Seconds> 5 </SFXEvent_Ambient_Moving_Min_Delay_Seconds>
  83.     <SFXEvent_Ambient_Moving_Max_Delay_Seconds> 10 </SFXEvent_Ambient_Moving_Max_Delay_Seconds>
  84.     <SFXEvent_Engine_Cinematic_Focus_Loop> Unit_A_Wing_Cinematic_Engine_Loop </SFXEvent_Engine_Cinematic_Focus_Loop>
  85.     <CategoryMask> Bomber | AntiCapital | Fighter | AntiBomber</CategoryMask>
  86.     <Property_Flags> SmallShip </Property_Flags>
  87.     <Icon_Name>I_BUTTON_RV_BWING.TGA</Icon_Name>
  88.     <Victory_Relevant>yes</Victory_Relevant>
  89.     <Air_Vehicle_Turret_Target> Yes </Air_Vehicle_Turret_Target>   
  90.     <Is_Visible_On_Radar>Yes</Is_Visible_On_Radar>
  91.     <Custom_Footprint_Radius> 7.0 </Custom_Footprint_Radius>
  92.     <MovementClass> Space </MovementClass>
  93.     <FormationOrder>1</FormationOrder>
  94.     <Out_Of_Combat_Defense_Adjustment>-1.0</Out_Of_Combat_Defense_Adjustment>
  95.     <Minimum_Follow_Distance>25.0</Minimum_Follow_Distance>
  96.     <Create_Team>Yes</Create_Team>
  97.     <AI_Combat_Power>80</AI_Combat_Power>
  98.     <Collision_Box_Modifier>2.0</Collision_Box_Modifier>
  99.     <Targeting_Priority_Set>Bomber</Targeting_Priority_Set>  
  100.     <Targeting_Stickiness_Time_Threshold>5.0</Targeting_Stickiness_Time_Threshold>
  101.    
  102.     <Unit_Abilities_Data SubObjectList="Yes">
  103.       <Unit_Ability>
  104.       <Type>SPOILER_LOCK</Type>  
  105.         <Mod_Multiplier>WEAPON_DELAY_MULTIPLIER,  3.0f</Mod_Multiplier>
  106.         <Mod_Multiplier>SHIELD_REGEN_MULTIPLIER,  3.0f</Mod_Multiplier>
  107.         <Mod_Multiplier>ENERGY_REGEN_MULTIPLIER,  3.0f</Mod_Multiplier>
  108.         <Mod_Multiplier>SPEED_MULTIPLIER,               1.5</Mod_Multiplier>
  109.         <SFXEvent_GUI_Unit_Ability_Activated>Unit_Ability_On_X_Wing</SFXEvent_GUI_Unit_Ability_Activated>
  110.         <SFXEvent_GUI_Unit_Ability_Deactivated>Unit_Ability_Off_X_Wing</SFXEvent_GUI_Unit_Ability_Deactivated>
  111.       </Unit_Ability>
  112.       <Unit_Ability>
  113.         <Type>ROCKET_ATTACK</Type>
  114.       </Unit_Ability>
  115.     </Unit_Abilities_Data>
  116.    
  117.     <Spin_Away_On_Death>Yes</Spin_Away_On_Death>
  118.     <Spin_Away_On_Death_Chance>0.2</Spin_Away_On_Death_Chance>
  119.     <Spin_Away_On_Death_Time>2.0f</Spin_Away_On_Death_Time>
  120.     <Spin_Away_On_Death_Explosion>Small_Explosion_Space</Spin_Away_On_Death_Explosion>
  121.     <Spin_Away_On_Death_SFXEvent_Start_Die>Unit_A_Wing_Spinning_By</Spin_Away_On_Death_SFXEvent_Start_Die>
  122.     <Remove_Upon_Death>true</Remove_Upon_Death>  
  123.     <Strafe_Distance>500.0</Strafe_Distance>
  124.     <Population_Value>0</Population_Value> 
  125.   </SpaceUnit>

 

SQUADRONS.XML

  1. XML code:
  1.   <Squadron Name="Rebel_B_Wing_Squadron">
  2.     <Text_ID>RV_BWING_SQUAD_ID</Text_ID>
  3.     <Encyclopedia_Good_Against> Executor_Stardestroyer ISD2 Star_Destroyer </Encyclopedia_Good_Against>
  4.     <Encyclopedia_Vulnerable_To> Imperial_Missleboat TIE_Avenger TIE_Defender </Encyclopedia_Vulnerable_To>
  5.     <GUI_Row> 1 </GUI_Row>
  6.     <Is_Dummy>Yes</Is_Dummy>
  7.     <Formation_Priority>1</Formation_Priority>
  8.     <Is_Escort>No</Is_Escort>
  9.     <Is_Bomber>Yes</Is_Bomber>
  10.     <Autoresolve_Health>500</Autoresolve_Health>
  11.     <Damage>40</Damage>
  12.     <Affiliation>Rebel</Affiliation>
  13.     <Political_Control>0</Political_Control>
  14.     <Build_Cost_Credits>800</Build_Cost_Credits>
  15.     <Build_Time_Seconds>25</Build_Time_Seconds>
  16.     <Build_Tab_Heroes>Yes</Build_Tab_Heroes>
  17.     <Tech_Level>3</Tech_Level>
  18.     <Required_Timeline />
  19.     <Required_Star_Base_Level>1</Required_Star_Base_Level>
  20.     <Required_Special_Structures />
  21.     <Behavior>DUMMY_SPACE_FIGHTER_SQUADRON</Behavior>
  22.     <Squadron_Units>B_Wing, B_Wing</Squadron_Units>
  23.     <Squadron_Units>B_Wing, B_Wing</Squadron_Units>
  24.     <Squadron_Units>B_Wing, B_Wing</Squadron_Units>
  25.     <Squadron_Offsets>15.0,15.0,0.0</Squadron_Offsets>
  26.     <Squadron_Offsets>15.0,-15.0,0.0</Squadron_Offsets>
  27.     <Squadron_Offsets>15.0,90.0,0.0</Squadron_Offsets>
  28.     <Squadron_Offsets>15.0,-90.0,0.0</Squadron_Offsets>
  29.     <Squadron_Offsets>0.0,30.0,0.0</Squadron_Offsets>
  30.     <Squadron_Offsets>0.0,-30.0,0.0</Squadron_Offsets>
  31.     <Max_Squad_Size> 6 </Max_Squad_Size>
  32.     <Icon_Name>I_BUTTON_RV_BWING.TGA</Icon_Name>
  33.     <GUI_Model_Name>RV_Bwing.ALO</GUI_Model_Name>
  34.     <GUI_Distance>95</GUI_Distance>
  35.     <GUI_Offset>0 0 0</GUI_Offset>
  36.     <GUI_Velocity>45</GUI_Velocity>
  37.  
  38.     <SFXEvent_Build_Started>RHD_Build_Vehicle</SFXEvent_Build_Started>
  39.     <SFXEvent_Build_Cancelled>RHD_Unit_Canceled</SFXEvent_Build_Cancelled>
  40.     <SFXEvent_Build_Complete>Unit_Complete_X_Wing</SFXEvent_Build_Complete>
  41.  
  42.     <FormationOrder>2</FormationOrder>
  43.     <Squadron_Formation_Error_Tolerance>25.0</Squadron_Formation_Error_Tolerance>
  44.     <Guard_Chase_Range>1000.0</Guard_Chase_Range>
  45.     <Idle_Chase_Range>200.0</Idle_Chase_Range>
  46.     <Attack_Move_Response_Range>300.0</Attack_Move_Response_Range>
  47.     <Property_Flags> SmallShip </Property_Flags>
  48.     <Autonomous_Move_Extension_Vs_Attacker>500.0</Autonomous_Move_Extension_Vs_Attacker>
  49.  
  50.     <Unit_Abilities_Data SubObjectList="Yes">
  51.       <Unit_Ability>
  52.         <Type>SPOILER_LOCK</Type>
  53.         <Mod_Multiplier>WEAPON_DELAY_MULTIPLIER,  9.0f</Mod_Multiplier>
  54.         <Mod_Multiplier>SHIELD_REGEN_MULTIPLIER,  0.1f</Mod_Multiplier>
  55.         <Mod_Multiplier>ENERGY_REGEN_MULTIPLIER,  0.1f</Mod_Multiplier>
  56.         <Mod_Multiplier>SPEED_MULTIPLIER,               1.5</Mod_Multiplier>
  57.         <SFXEvent_GUI_Unit_Ability_Activated>Unit_Ability_On_X_Wing</SFXEvent_GUI_Unit_Ability_Activated>
  58.         <SFXEvent_GUI_Unit_Ability_Deactivated>Unit_Ability_Off_X_Wing</SFXEvent_GUI_Unit_Ability_Deactivated>
  59.       </Unit_Ability>
  60.       <Unit_Ability>
  61.         <Type>ROCKET_ATTACK</Type>
  62.       </Unit_Ability>
  63.     </Unit_Abilities_Data>
  64.    
  65.     <Encyclopedia_Text>RV_BWING_TEXT</Encyclopedia_Text>
  66.     <Encyclopedia_Unit_Class> TEXT_ENCYCLOPEDIA_CLASS_FIGHTER </Encyclopedia_Unit_Class>
  67.    
  68.     <!--<MULTIPLAYER SKIRMISH VALUES BEGIN>-->
  69.     <Tactical_Build_Cost_Multiplayer>900</Tactical_Build_Cost_Multiplayer>
  70.     <Tactical_Build_Time_Seconds>30</Tactical_Build_Time_Seconds>
  71.     <Tactical_Build_Prerequisites />
  72.     <Tactical_Production_Queue>Tactical_Units</Tactical_Production_Queue>
  73.     <!--<Build_Limit_Current_Per_Player>0</Build_Limit_Current_Per_Player>-->
  74.     <!--<Build_Limit_Lifetime_Per_Player>0</Build_Limit_Lifetime_Per_Player>-->  
  75.     <!--<MULTIPLAYER SKIRMISH VALUES END>-->
  76.     <Population_Value>1</Population_Value>
  77.     <Score_Cost_Credits> 600</Score_Cost_Credits>
  78.   </Squadron>

 

If you looked through my code very closely you should of seen some the below code in both files.

  1. XML code:
  1.       <Unit_Ability>
  2.         <Type>ROCKET_ATTACK</Type>
  3.       </Unit_Ability>

 

That code is for the "Rocket Attack Ability" What this code does is set up the Special ability button, however we can not use the ability yet as we haven't told the game what weapon will we be using when we turn the button on/off.

Now I'm going to open HARDPOINTS.XML to tell the game what weapon to use when the abilities button is turned on/off.

HARDPOINTS.XML

  1. XML code:
  1.    <HardPoint Name="HP_BWING_ION">
  2.       <Type> HARD_POINT_WEAPON_ION_CANNON </Type>
  3.             <Is_Targetable>No</Is_Targetable>
  4.             <Is_Destroyable>No</Is_Destroyable>
  5.  
  6.             <Fire_Bone_A>MuzzleA_00</Fire_Bone_A>
  7.             <Fire_Bone_B>MuzzleA_01</Fire_Bone_B>
  8.       <Fire_Bone_B>MuzzleA_02</Fire_Bone_B>
  9.       <Fire_Bone_B>MuzzleA_03</Fire_Bone_B>
  10.             <Fire_Cone_Width>90.0</Fire_Cone_Width>
  11.             <Fire_Cone_Height>90.0</Fire_Cone_Height>
  12.             <Fire_Projectile_Type>Proj_Ship_Ion_Cannon_Bwing</Fire_Projectile_Type>
  13.             <Fire_Min_Recharge_Seconds>1.0</Fire_Min_Recharge_Seconds>
  14.             <Fire_Max_Recharge_Seconds>2.0</Fire_Max_Recharge_Seconds>
  15.             <Fire_Pulse_Count>3</Fire_Pulse_Count>
  16.             <Fire_Pulse_Delay_Seconds>0.25</Fire_Pulse_Delay_Seconds>
  17.             <Fire_Range_Distance>900.0</Fire_Range_Distance>
  18.       <Fire_SFXEvent>Unit_Ion_Fire</Fire_SFXEvent>
  19.  
  20.       <Damage_Type> Damage_IonCannon </Damage_Type>
  21.  
  22.       <Fire_Inaccuracy_Distance> Fighter, 2.0 </Fire_Inaccuracy_Distance>
  23.       <Fire_Inaccuracy_Distance> Bomber, 2.0 </Fire_Inaccuracy_Distance>
  24.       <Fire_Inaccuracy_Distance> Transport, 2.0 </Fire_Inaccuracy_Distance>
  25.       <Fire_Inaccuracy_Distance> Corvette, 10.0 </Fire_Inaccuracy_Distance>
  26.       <Fire_Inaccuracy_Distance> Frigate, 1.0 </Fire_Inaccuracy_Distance>
  27.       <Fire_Inaccuracy_Distance> Capital, 1.0 </Fire_Inaccuracy_Distance>
  28.       <Fire_Inaccuracy_Distance> Super, 30.0 </Fire_Inaccuracy_Distance>
  29.  
  30.       <Fire_When_In_Rocket_Attack_Mode>Yes</Fire_When_In_Rocket_Attack_Mode>
  31.       <Fire_When_In_Normal_Attack_Mode>No</Fire_When_In_Normal_Attack_Mode>
  32.   </HardPoint>
  33.  
  34.       <HardPoint Name="HP_Bwing_Lasers">
  35.       <Type> HARD_POINT_WEAPON_LASER </Type>
  36.             <Is_Targetable>No</Is_Targetable>
  37.             <Is_Destroyable>No</Is_Destroyable>
  38.  
  39.             <Fire_Bone_A>MuzzleA_00</Fire_Bone_A>
  40.             <Fire_Bone_B>MuzzleA_01</Fire_Bone_B>
  41.       <Fire_Bone_C>MuzzleA_02</Fire_Bone_C>
  42.       <Fire_Bone_C>MuzzleA_03</Fire_Bone_C>
  43.       <Fire_Cone_Width>20.0</Fire_Cone_Width>
  44.             <Fire_Cone_Height>20.0</Fire_Cone_Height>
  45.             <Fire_Projectile_Type>Proj_Ship_Small_Laser_Cannon_E_Wing</Fire_Projectile_Type>
  46.             <Fire_Min_Recharge_Seconds>0.5</Fire_Min_Recharge_Seconds>
  47.             <Fire_Max_Recharge_Seconds>0.5</Fire_Max_Recharge_Seconds>
  48.             <Fire_Pulse_Count>6</Fire_Pulse_Count>
  49.             <Fire_Pulse_Delay_Seconds>0.2</Fire_Pulse_Delay_Seconds>
  50.             <Fire_Range_Distance>500.0</Fire_Range_Distance>
  51.       <Fire_SFXEvent>Unit_Rebel_Ship_Laser_Fire</Fire_SFXEvent>
  52.  
  53.       <Damage_Type> Damage_Fighter </Damage_Type>
  54.  
  55.       <Fire_Inaccuracy_Distance> Fighter, 2.5 </Fire_Inaccuracy_Distance>
  56.       <Fire_Inaccuracy_Distance> Bomber, 1.5 </Fire_Inaccuracy_Distance>
  57.       <Fire_Inaccuracy_Distance> Transport, 2.0 </Fire_Inaccuracy_Distance>
  58.       <Fire_Inaccuracy_Distance> Corvette, 30.0 </Fire_Inaccuracy_Distance>
  59.       <Fire_Inaccuracy_Distance> Frigate, 30.0 </Fire_Inaccuracy_Distance>
  60.       <Fire_Inaccuracy_Distance> Capital, 30.0 </Fire_Inaccuracy_Distance>
  61.       <Fire_Inaccuracy_Distance> Super, 30.0 </Fire_Inaccuracy_Distance>
  62.      
  63.       <Fire_When_In_Rocket_Attack_Mode>No</Fire_When_In_Rocket_Attack_Mode>
  64.       <Fire_When_In_Normal_Attack_Mode>Yes</Fire_When_In_Normal_Attack_Mode>
  65.   </HardPoint>
  66.  
  67.  
  68.   <HardPoint Name="HP_BWING_Torpedo">
  69.       <Type> HARD_POINT_WEAPON_TORPEDO </Type>
  70.       <Is_Targetable>No</Is_Targetable>
  71.       <Is_Destroyable>No</Is_Destroyable>
  72.       <Damage_Type> Damage_Proton_Torp </Damage_Type>
  73.  
  74.       <Fire_Bone_A>MuzzleB_00</Fire_Bone_A>
  75.       <Fire_Bone_B>MuzzleB_01</Fire_Bone_B>
  76.       <Fire_Cone_Width>30.0</Fire_Cone_Width>
  77.       <Fire_Cone_Height>30.0</Fire_Cone_Height>
  78.       <Fire_Projectile_Type>Proj_Ship_Proton_Torpedo_Fighter</Fire_Projectile_Type>
  79.       <Fire_Min_Recharge_Seconds>8.0</Fire_Min_Recharge_Seconds>
  80.       <Fire_Max_Recharge_Seconds>8.0</Fire_Max_Recharge_Seconds>
  81.       <Fire_Pulse_Count>6</Fire_Pulse_Count>
  82.       <Fire_Pulse_Delay_Seconds>0.3</Fire_Pulse_Delay_Seconds>
  83.       <Fire_Range_Distance>300.0</Fire_Range_Distance>
  84.       <Fire_SFXEvent>Unit_Torpedo_Fire</Fire_SFXEvent>
  85.  
  86.       <Fire_Category_Restrictions> Fighter, Bomber </Fire_Category_Restrictions>
  87.       <Allow_Opportunity_Fire_When_Targeting>False</Allow_Opportunity_Fire_When_Targeting>
  88.       <Allow_Opportunity_Fire_When_Idle>False</Allow_Opportunity_Fire_When_Idle>
  89.      
  90.     <Fire_When_In_Rocket_Attack_Mode>No</Fire_When_In_Rocket_Attack_Mode>
  91.     <Fire_When_In_Normal_Attack_Mode>Yes</Fire_When_In_Normal_Attack_Mode>
  92.     </HardPoint>

 

Again, if you looked through my code very closely you should of seen the below lines of code.

  1. XML code:
  1. <Fire_When_In_Rocket_Attack_Mode>Yes</Fire_When_In_Rocket_Attack_Mode>  <Fire_When_In_Normal_Attack_Mode>No</Fire_When_In_Normal_Attack_Mode>
  2.  
  3. and this
  4.  
  5. <Fire_When_In_Rocket_Attack_Mode>No</Fire_When_In_Rocket_Attack_Mode>
  6. <Fire_When_In_Normal_Attack_Mode>Yes</Fire_When_In_Normal_Attack_Mode>
  7.  

  

This particular pieces of code tells the game that when the "Rocket Attack Ability" is turned off the B-wing fires it's Laser Cannons and Proton Torpedoes. However, when the "Rocket Attack Ability" is turned on the B-wing only Fires it's Ion Cannons. Pretty neat huh.

This ability can be used to have a vehicle switch from AA fire to Ground fire, have a vehicle switch from Anti-Tank fire to Anti-Infantry fire, etc.

I hope you guys/gals have enjoyed another of my series of tutorials. Now children just remember to be patient when you're modifying code because shit happens sometimes and we have all wanted to throw are computers out the window several times at one time or another.

    Have Fun and Godspeed,
        Rebel5555 (AKA joshua R.)

Comments
rebel5555
rebel5555 Apr 22 2009, 11:39am says:

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.

+1 vote     reply to comment
Post a Comment

Only registered members can share their thoughts. So come on! Join the community today (totally free) and do things you never thought possible.

Icon
Star Wars: Empire At War
Platform
PC
Developer
Petroglyph
Publisher
LucasArts
Engine
Alamo
Contact
Send Message
Official Page
Lucasarts.com
Release Date
Released Feb 16, 2006
Game Watch
Track this game
Bookmark
Digg Super bookmark
Tutorial
Browse
Tutorials
Report Abuse
Report article
Bookmark
Digg Super bookmark
Related Games
Star Wars: Empire At War
Star Wars: Empire At War
Single & Multiplayer Real Time Strategy
Related Engines
Alamo
Alamo
Commercial Released Jul 20, 2006
Related Groups
LucasArts
LucasArts
Developer & Publisher
Petroglyph
Petroglyph
Developer & Publisher