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: How to create a Projectile based off the Y-Wing's Ion Shot

In this Tutorial I will show you guys/gals how to create a projectile that has the same effects as the Y-Wings Ion cannon Shot.

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


Tutorial: How to create a Projectile based off the Y-Wing's Ion Shot
By: rebel5555 (AKA Joshua R.)

Before reading this tutorial I would highly recommend you read my tutorial "Good Times with the Rocket Ability" as I'm using the B-wing's "Rocket Ability" to use the ion cannon. Anyways, in this Tutorial I will show you guys/gals how to create a projectile that has the same effects as the Y-Wings Ion cannon Shot. This is a pretty easy thing to do and can make a Space Battle more interesting.

Below is the Hardpoint entry for the ion Cannon on my B-wing. The below code tells the game how the weapon acts as it's being fired from the B-Wing. To define what happens when the weapon hits the enemy we need to create/edit a projectile. So, lets open PROJECTILES.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>

The below code is the new Projectile for the B-Wing's Ion Cannon. You
can see that I did away with the goofy looking projectile that the Ion
Shot uses and went with the default projectile. What's really cool
about this is that when using this projectile with the "Rocket Ability"
instead of the "Ion Shot" you don't have to wait to have the ability
recharge thus making battles require a little more strategy to win a
space battle.

  1. XML code:
  1. <Projectile Name="Proj_Ship_Ion_Cannon_Bwing">
  2. <Text_ID>TEXT_NONE</Text_ID>
  3. <Projectile_Width>1.7</Projectile_Width>
  4. <Projectile_Length>55</Projectile_Length>
  5.  
  6. <Projectile_Custom_Render>1</Projectile_Custom_Render>
  7. <Projectile_Texture_Slot>2</Projectile_Texture_Slot>
  8.  
  9.  
  10. <Scale_Factor>0.50</Scale_Factor>
  11. <Damage_Type> Damage_IonCannon </Damage_Type>
  12. <Max_Speed>35.0</Max_Speed>
  13. <Max_Rate_Of_Turn>0.0</Max_Rate_Of_Turn>
  14. <Behavior>PROJECTILE, HIDE_WHEN_FOGGED</Behavior>
  15. <Projectile_Ion_Stun_On_Detonation>Yes</Projectile_Ion_Stun_On_Detonation>
  16. <Projectile_Disables_Engines_When_Power_Drained>No</Projectile_Disables_Engines_When_Power_Drained>
  17. <Projectile_Ion_Stun_Duration>1.0</Projectile_Ion_Stun_Duration>
  18. <Projectile_Ion_Stun_Speed_Reduction_Percent>0.55</Projectile_Ion_Stun_Speed_Reduction_Percent>
  19. <Projectile_Ion_Stun_Shot_Rate_Reduction_Percent>0.55</Projectile_Ion_Stun_Shot_Rate_Reduction_Percent>
  20. <Projectile_Ion_Stun_Stack_Duration>Yes</Projectile_Ion_Stun_Stack_Duration>
  21.  
  22. <Projectile_Stun_On_Detonation>Yes</Projectile_Stun_On_Detonation>
  23. <Projectile_Stun_Duration_Frames>300</Projectile_Stun_Duration_Frames>
  24. <Projectile_Stun_Radius>300</Projectile_Stun_Radius>
  25. <Projectile_Stun_Spawn_Effect> Stunned_Infantry </Projectile_Stun_Spawn_Effect>
  26. <Projectile_Stun_Victims_Category_Mask> All </Projectile_Stun_Victims_Category_Mask>
  27.  
  28. <Projectile_Max_Flight_Distance>2200.0</Projectile_Max_Flight_Distance>
  29. <Damage_Type>Damage_Fighter</Damage_Type>
  30. <Projectile_Damage>8.0</Projectile_Damage>
  31. <Projectile_Does_Shield_Damage>Yes</Projectile_Does_Shield_Damage>
  32. <Projectile_Does_Energy_Damage>Yes</Projectile_Does_Energy_Damage>
  33. <Projectile_Does_Hitpoint_Damage>No</Projectile_Does_Hitpoint_Damage>
  34. <Projectile_Energy_Per_Shot>10</Projectile_Energy_Per_Shot>
  35. <Projectile_SFXEvent_Detonate>SFX_Ion_Detonation</Projectile_SFXEvent_Detonate>
  36. <Projectile_SFXEvent_Detonate_Reduced_By_Armor> SFX_Small_Damage_Detonation </Projectile_SFXEvent_Detonate_Reduced_By_Armor>
  37. </Projectile>

Some you might ask: How does it stun a spacecraft and not drain it's shields like an Ion battery? The answer is the following segments of code which will have shot explanations on what they do at the end of each line of code:

  1. XML code:
  1. <Projectile_Disables_Engines_When_Power_Drained>No</Projectile_Disables_Engines_When_Power_Drained> (If this was set to True the targets engines would be disabled)
  2. <Projectile_Ion_Stun_Duration>1.0</Projectile_Ion_Stun_Duration> (How long the effect lasts)
  3. <Projectile_Ion_Stun_Speed_Reduction_Percent>0.55</Projectile_Ion_Stun_Speed_Reduction_Percent> (How much the speed is reduced)
  4. <Projectile_Ion_Stun_Shot_Rate_Reduction_Percent>0.55</Projectile_Ion_Stun_Shot_Rate_Reduction_Percent> (How much the Rate of fire is reduced)
  5. <Projectile_Ion_Stun_Stack_Duration>Yes</Projectile_Ion_Stun_Stack_Duration> (If hit multiple times the effect is greatly increased)

I hope this tutorial has been helpful to some people.

Have fun and May the force be with you

Rebel5555 (AKA Joshua R.)

Comments
rebel5555
rebel5555 Apr 22 2009, 9:08pm 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