Green Rollover Red Rollover Arrow Rollover Focused Userbar Register Button Rollover Red Button Rollover
Welcome Guest ( Log In / Register )

A Basic Hardpoint.

Tutorial for Forces of Corruption FOC

No Avatar

Longleaf

Category: Coding
Level: Beginner
Created: Friday August 14, 2009 - 19:00
Updated: Friday August 14, 2009 - 19:07
Views: 5278
Summary: How to code a hardpoint broken down and hopefuly easy.

Rating

Staff says

-

Members say

-

Average

-

0 votes

Ok so i thought i would make a thingy to help new modders out so here is my hard point coding part.

Things to do before starting.
Go to you install directory for FOC you need the map editor or FOC XMLS in the game data folder make a new folder named XML and then in your copy of XMLs Copy and paste Hardpoints.xml now right click and hit edit go down to the bottom and follow the tutorial.

Here we have a complete hardpoint code for an extra massdriver on the Vengeance.


<HardPoint Name="HP_VENGEANCE_MASS_DRIVER_1">
<Type> HARD_POINT_WEAPON_MASS_DRIVER </Type>
<Is_Targetable>Yes</Is_Targetable>
<Is_Destroyable>Yes</Is_Destroyable>
<Tooltip_Text>TEXT_WEAPON_MASS_DRIVER</Tooltip_Text>
<Health>300.0</Health>

<Death_Explosion_Particles> Large_Explosion_Space_Empire </Death_Explosion_Particles>
<Death_Explosion_SFXEvent>Unit_Hardpoint_Mass_Driver_Death</Death_Explosion_SFXEvent>

<Attachment_Bone>MUZZLEA_00</Attachment_Bone>
<Collision_Mesh>MUZZLEA_00</Collision_Mesh>
<Damage_Decal>MUZZLEA_00</Damage_Decal>
<Damage_Particles>MUZZLEA_00</Damage_Particles>



<Fire_Bone_A>MUZZLEA_00</Fire_Bone_A>
<Fire_Bone_B>MUZZLEA_00</Fire_Bone_B>
<Randomize_Between_Fire_Bones> No </Randomize_Between_Fire_Bones>
<Fire_Cone_Width>45.0</Fire_Cone_Width>
<Fire_Cone_Height>150.0</Fire_Cone_Height>

<Fire_Projectile_Type>Proj_Vengeance_Mass_Driver</Fire_Projectile_Type>
<Fire_Min_Recharge_Seconds>3.0</Fire_Min_Recharge_Seconds>
<Fire_Max_Recharge_Seconds>4.0</Fire_Max_Recharge_Seconds>
<Fire_Pulse_Count>4</Fire_Pulse_Count>
<Fire_Pulse_Delay_Seconds>0.2</Fire_Pulse_Delay_Seconds>
<Fire_Range_Distance>1700.0</Fire_Range_Distance>

<Fire_SFXEvent>Unit_Anti_Air_Fire</Fire_SFXEvent>

<Fire_Inaccuracy_Distance> Fighter, 60.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Bomber, 55.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Transport, 20.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Corvette, 10.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Frigate, 5.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Capital, 25.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Super, 30.0 </Fire_Inaccuracy_Distance>
</HardPoint>


Here are some of the most important part the code containers.
<HardPoint Name="HP_VENGEANCE_MASS_DRIVER_1">
</HardPoint>
What are these used for ? to tell it were the hardpoint code starts and ends.
Hardpoint type.

<Type> HARD_POINT_WEAPON_MASS_DRIVER </Type>
This tells it what kind of hardpoint we are coding.

<Is_Targetable>Yes</Is_Targetable>

Weather we can see it or not just put No if you do not want it to be targetable .

<Is_Destroyable>Yes</Is_Destroyable>

Weather we can destroy it or not just put No if you do not want it to be able to be destroyed.

<Tooltip_Text>TEXT_WEAPON_MASS_DRIVER</Tooltip_Text>

It's text string name.

<Health>300.0</Health>
It's health do not go over board like a number like 188761.

<Death_Explosion_Particles> Large_Explosion_Space_Empire </Death_Explosion_Particles>
It's Death Particles.

<Death_Explosion_SFXEvent>Unit_Hardpoint_Mass_Driver_Death</Death_Explosion_SFXEvent>
It's Death Sound.

All of the fowling bits are on bones on the model.

<Attachment_Bone>MUZZLEA_00</Attachment_Bone>
Were we see the hardpoint.

<Collision_Mesh>MUZZLEA_00</Collision_Mesh>
It's Collision Mesh i do not know much about this one.

<Damage_Decal>MUZZLEA_00</Damage_Decal>
Not needed but it tells it were to find the damage marks on the model.

<Damage_Particles>MUZZLEA_00</Damage_Particles>
We do not need this one either it tells it were to find the sparks and smoke on the model.

<Fire_Bone_A>MUZZLEA_00</Fire_Bone_A>
Were the projectile comes from.

<Fire_Bone_B>MUZZLEA_00</Fire_Bone_B>
Were the projectile can come from as a B point.

<Randomize_Between_Fire_Bones> No </Randomize_Between_Fire_Bones>
Weather to randomize between hardpoint firing or fire one after the other.

That concludes or bone section.

Other stuff.

<Fire_Cone_Width>45.0</Fire_Cone_Width>
<Fire_Cone_Height>150.0</Fire_Cone_Height>
If i only knew what these do sad.gif .

Weapon part.

<Fire_Projectile_Type>Proj_Vengeance_Mass_Driver</Fire_Projectile_Type>
The projectile we are firing.

<Fire_Min_Recharge_Seconds>3.0</Fire_Min_Recharge_Seconds>
Projectile's min Firing delay.

<Fire_Max_Recharge_Seconds>4.0</Fire_Max_Recharge_Seconds>
Projectile's Max firing delay.

<Fire_Pulse_Count>4</Fire_Pulse_Count>
The amount of shots we want to fire before a brake.

<Fire_Pulse_Delay_Seconds>0.2</Fire_Pulse_Delay_Seconds>
How rapid the shots are fired.

<Fire_Range_Distance>1700.0</Fire_Range_Distance>
How far it can target other units.

<Fire_SFXEvent>Unit_Anti_Air_Fire</Fire_SFXEvent>
The firing sound.

Now for the last bit the accuracy ratings.
<Fire_Inaccuracy_Distance> Fighter, 60.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Bomber, 55.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Transport, 20.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Corvette, 10.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Frigate, 5.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Capital, 25.0 </Fire_Inaccuracy_Distance>
<Fire_Inaccuracy_Distance> Super, 30.0 </Fire_Inaccuracy_Distance>

And if you want to add a model just use this line.

<Model_To_Attach>(Insert Model Name)</Model_To_Attach>


There you have it you coded your first hardpoint have fun coding more please fell free to ask questions.

Add comment

Please enter your message below. Max 10000 characters.