Printable Version of Topic

Click here to view this topic in its original format

SWR Productions Forum _ C&C Modding _ Range based damage tutorial

Posted by: Sergeant Freedom 12 Aug 2016, 19:17

When it comes to some weapons it is a nice to have the weapon do more damage to enemies who are closer up and less damage to enemies who are father away (especially on shotguns).

The way to do this is to make the unit have multiple versions of the same weapon with each weapon's minimum range set as the maximum range of the previous weapon




IMPORTANT INFO:

The only stuff that should vary from weapon to weapon are the parts in bold.

Make sure the reload time, clip size and delay between shots are the same on ALL of the weapons.

It should look similar to this:



Weapon Weapon1
PrimaryDamage = 60
PrimaryDamageRadius = 5.0
AttackRange = 50.0
DamageType = ARMOR_PIERCING
DeathType = NORMAL
WeaponSpeed = 400 ; dist/sec
WeaponRecoil = 5 ; angle to deflect the model when firing
ProjectileObject = Generic
FireFX = WeaponFX_GenericTankGunNoTracerSmall
ProjectileDetonationFX = WeaponFX_GenericTankShellDetonation
FireSound = ScorpionTankWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 0
ClipSize = 1
ClipReloadTime = 1000
ProjectileCollidesWith = STRUCTURES WALLS
End

Weapon Weapon2
PrimaryDamage = 40
PrimaryDamageRadius = 5.0
AttackRange = 100.0
MinimumAttackRange = 50.0

DamageType = ARMOR_PIERCING
DeathType = NORMAL
WeaponSpeed = 400 ; dist/sec
WeaponRecoil = 5 ; angle to deflect the model when firing
ProjectileObject = Generic
FireFX = WeaponFX_GenericTankGunNoTracerSmall
ProjectileDetonationFX = WeaponFX_GenericTankShellDetonation
FireSound = ScorpionTankWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 0
ClipSize = 1
ClipReloadTime = 1000
ProjectileCollidesWith = STRUCTURES WALLS
End

Weapon Weapon3
PrimaryDamage = 20
PrimaryDamageRadius = 5.0
AttackRange = 150.0
MinimumAttackRange = 100.0

DamageType = ARMOR_PIERCING
DeathType = NORMAL
WeaponSpeed = 400 ; dist/sec
WeaponRecoil = 5 ; angle to deflect the model when firing
ProjectileObject = Generic
FireFX = WeaponFX_GenericTankGunNoTracerSmall
ProjectileDetonationFX = WeaponFX_GenericTankShellDetonation
FireSound = ScorpionTankWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 0
ClipSize = 1
ClipReloadTime = 1000
ProjectileCollidesWith = STRUCTURES WALLS
End



After you have done this go to the unit INI file, go to it's weaponset and put "ShareWeaponReloadTime = Yes" (to prevent the unit from firing more than one of it's weapons at a time).
It should look like this:

WeaponSet
Conditions = None
Weapon = PRIMARY Weapon1
Weapon = SECONDARY Weapon2
Weapon = TERTIARY Weapon3
ShareWeaponReloadTime = Yes
End

And that's it!

The only down side is that the unit can only have one weapon, as all three weapon slots are used for the range based damage.

This method is untested but should work.
Reply any problems you have and I'll do my best to help you.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)