View Single Post
Old 06-06-2004, 01:25 PM   #4 (permalink)
CodeCat
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

That's a gap generator, not a radar jammer. Besides, DZ already wrote a tutorial about that. But while we're on the subject, here's


Making a unit that disables only stuff of a certain type
Zero Hour only

It's possible to make a Radar Jammer like in Red Alert, but you'll have to sacrifice the SUBDUAL_MISSILE, SUBDUAL_VEHICLE or SUBDUAL_BUILDING DamageType for it. So it's not really useful unless you're making a total conversion, or a mod that changes/removes the Microwave Tank or ECM Tank. Also, this particular jammer will completely disable every building that is affected by it. So if you let it jam Command Centers, you won't be able to build Dozers with them either. But this trick can be easily applied to any other building, so if you want to make a unit that specifically disables all production facilities, that's very possible.

So imagine we want to make a unit that disables every production facility within its range. First you copy the ECM Tank's secondary weapon (the one it uses to jam missiles), and adjust it so it looks like this:
Code:
Weapon JammerWeapon
  PrimaryDamage = 1000.0
  PrimaryDamageRadius = 500.0
  AttackRange = 1.0
  DamageType = SUBDUAL_BUILDING
  DeathType = NORMAL
  WeaponSpeed = 999999                     ;  dist/sec 
  RadiusDamageAffects = ENEMIES NEUTRALS
  DelayBetweenShots = 250                ; time between shots, msec
End
Adjust the damage and radius to suit your likings. The radius is the range at which it can disable things. The damage adjusts how long it takes (relative to an object's hitpoints) to completely disable something. Remember that you should change the DamageType depending on which one you want to use for this.
Next, add this to your unit:
Code:
Behavior = FireWeaponUpdate Whatever
  Weapon = JammerWeapon
End
This will get your unit to automatically disable anything that gets near it, without having to target it.

Then there's one last thing to do. You need to make a copy of the armour type (in Armor.ini) of each building you're going to make disableable. So for StructureArmor you make StructureArmorDisableable (if any of the things that can be disabled have StructureArmor), for TankArmor you could make TankArmorDisableable, etc. Now, you must set whatever DamageType you used for this to do 100% damage to these new armour types, and 0% to all other types. This ensures that nothing other than these specific types will be disabled. So then just give whatever can be disabled one of these new armour types. You also need to include something like
Code:
SubdualDamageCap = 2000
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 500
on the "Body" module for the objects that can be disabled. This makes the units actually disableable. Their armour type controls whether a particular weapon is capable of disabling them.
CodeCat is offline   Reply With Quote