ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Weapons"

From ModEnc
Jump to: navigation, search
(rw)
(Appendix - Listing Applicable INI flags)
Line 45: Line 45:
  
 
Now, add the HeatMissileWH to the [Warheads] list. I haven't seen anything wrong when I don't put it there, but since the list exists, it can be necessary for something.
 
Now, add the HeatMissileWH to the [Warheads] list. I haven't seen anything wrong when I don't put it there, but since the list exists, it can be necessary for something.
 +
 +
== Applicable INI Flags ==
 +
 +
{{Applicable INI Flags}}
 +
 +
{{:AbstractTypes}}
 +
<onlyinclude>
 +
{{Applicable INI Flags Header|WeaponType}}
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|AmbientDamage}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsSonic}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Spawner}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|LimboLaunch}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DecloakToFire}}  || boolean || 1 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|CellRangefinding}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|FireOnce}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|NeverUse}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|RevealOnFire}}  || boolean || 1 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|TerrainFire}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|SabotageCursor}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|MigAttackCursor}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DisguiseFireOnly}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|InfiniteMindControl}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|FireWhileMoving}}  || boolean || 1 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DrainWeapon}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|FireInTransport}}  || boolean || 1 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DisguiseFakeBlinkTime}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Suicide}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Supress}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Burst}}  || int || 1 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Damage}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Speed}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|ROF}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Range}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|MinimumRange}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Report}}  || vector<Sound> || {} ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DownReport}}  || vector<Sound> || {} ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Anim}}  || vector<Animation> || {} || +
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|AssaultAnim}}  || Animation || 0 || +
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|OccupantAnim}}  || Animation || 0 || +
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|OpenToppedAnim}}  || Animation || 0 || +
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Camera}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsLaser}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DiskLaser}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsLine}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsHouseColor}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Charges}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|TurboBoost}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|UseFireParticles}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|UseSparkParticles}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|OmniFire}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DistributedWeaponFire}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsRailgun}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Lobber}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|LaserInnerColor}}  || Color || {0;0;0} ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|LaserOuterColor}}  || Color || {0;0;0} ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|LaserOuterSpread}}  || XYZ || {0;0;0} ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|LaserDuration}}  || int || 10 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsBigLaser}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Bright}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IonSensitive}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|AreaFire}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsElectricBolt}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|DrawBoltAsLaser}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsAlternateColor}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsRadBeam}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsRadEruption}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|RadLevel}}  || int || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|IsMagBeam}}  || boolean || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|AttachedParticleSystem}}  || ParticleSystem || 0 ||
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Warhead}}  || WarheadType || 0 || +
 +
|-
 +
| {{Ini|Rules}} || Object's ID || {{TTL|Projectile}}  || ProjectileType || 0 || +
 +
|}
 +
</onlyinclude>
  
 
[[Category:General_Editing_Information]]
 
[[Category:General_Editing_Information]]
 
[[Category:General Tutorials]]
 
[[Category:General Tutorials]]

Revision as of 14:32, 13 April 2008

Weapons are essential to CnC, even more than harvesting. A Weapon is a combination of Weapon-specific data, warhead, and projectile.

If a weapon gets fired, the game first checks for the animation & sound set in the weapon to display them;
The warhead is then delivered to it's target by the projectile;
On impact, the game reads the rules for the impact from the warhead, and then calculates the damage inflicted, basing on the Damage= value supplied in the weapon.

Making new weapons (by DCoder)

New weapons are easy to create, as long as you know these facts:

When a unit is ordered to fire, it moves towards the target until it is in Range=, then fires the weapon. It travels through the air (directed by the Projectile=), impacts and deals a certain % of weapon's Damage= (directed by the Warhead=).

Enough theory, let's make a new weapon, projectile and warhead to replace the Destroyer's cannon with a RA1 style missile launcher. So set [DEST] Primary=OldMissile, then create this section:

[OldMissile]
Damage=60 ;how much damage points to deliver
ROF=60 ;how often (in frames) to fire
Range=8 ;how far (in cells) can the weapon fly?
Projectile=HeatSeekingMissile ;our new projectile
Warhead=HeatMissileWH ;our new warhead
Speed=25 ; how fast does the weapon fly?

Report=AegisAttack ;the sound of aegis missile launcher
But the [HeatSeekingMissile] does not exist yet. So create it:

[HeatSeekingMissile]
High=yes ;fly in an arc (IFV missile like) instead of straight (cannon like)
Shadow=no ;don't draw shadow on the ground (the missile is too small)
AA=yes ;can it hit air targets?
AG=yes ;can it hit ground targets?
Image=MEDUSA ;this is the image that Aegis missile uses
ROT=20 ;(not zero means it can 'home in' on the target)
SubjectToCliffs=no ;can cliffs mess up the targeting (we're in the water, no cliffs here)
SubjectToElevation=no ;does the weapon get a range bonus if fired from a high place downwards?

SubjectToWalls=no ;can the walls stop it?
The [HeatMissileWH] also doesn't exist. So we need to create it as well:

[HeatMissileWH]
CellSpread=.3 ;in map cells, how far can you still feel the impact
PercentAtMax=1 ;at the edge of the area effected (determined by cellspread) this is the percent of damage done.
Verses=100%,100%,100%,100%,100%,100%,0%,0%,0%,100%,100% ;(see armor types tutorial)
InfDeath=3 ;which infantry death to use when infantry is killed by this weapon?
AnimList=EXPLOSML ;what animations to play at impact point?

ProneDamage=100% ;% damage to deal to infantry that is prone (deployed counts as prone)

Now, add the HeatMissileWH to the [Warheads] list. I haven't seen anything wrong when I don't put it there, but since the list exists, it can be necessary for something.

Applicable INI Flags

These tables show all INI flags applicable1 to Weapons. The flags are grouped by the internal classes the flags are inherited from, and then listed in the order they are read in by the game. You can re-sort the rows by column values by clicking the arrow icons in the column headings. Each flag can be clicked to visit its page for detailed information.

Please note that this section is accurate only for Yuri's Revenge. All other C&C games use different sets of flags.

1 "Applicable" in this context means "read from the INI files". Certain flags listed here don't have any effect ingame , but they are read and in certain cases cause a crash if not present. Again, refer to each flag's individual page for detailed information.


AbstractTypes
INI File Section Key Value Type Default Value Adds to list
Rules(md).ini Object's ID Name string(48 symbols) ID
Rules(md).ini Object's ID UIName string(31 symbol) ""


WeaponType
INI File Section Key Value Type Default Value Adds to list
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 1
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 1
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 1
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 1
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL int 1
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL vector<Sound> {}
Rules(md).ini Object's ID Template:TTL vector<Sound> {}
Rules(md).ini Object's ID Template:TTL vector<Animation> {} +
Rules(md).ini Object's ID Template:TTL Animation 0 +
Rules(md).ini Object's ID Template:TTL Animation 0 +
Rules(md).ini Object's ID Template:TTL Animation 0 +
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL Color {0;0;0}
Rules(md).ini Object's ID Template:TTL Color {0;0;0}
Rules(md).ini Object's ID Template:TTL XYZ {0;0;0}
Rules(md).ini Object's ID Template:TTL int 10
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL int 0
Rules(md).ini Object's ID Template:TTL boolean 0
Rules(md).ini Object's ID Template:TTL ParticleSystem 0
Rules(md).ini Object's ID Template:TTL WarheadType 0 +
Rules(md).ini Object's ID Template:TTL ProjectileType 0 +