You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a supplement for
#1695. With multiple
weapons being set, you can use `ForceWeapon` to enable them when
attacking different targets. This pull request is a basic one that
should be enough for many cases
- A series of tags can force specified weapons based on the target's
type.
- `ForceWeapon.Naval.Units` forces specified weapon to be used against
`Naval=yes` units. Taking priority to `ForceWeapon.Units`.
- If `ForceWeapon.Defenses` is enabled, it'll be used if the target is a
building with `BuildCat=Combat`. Otherwise it'll follow
`ForceWeapon.Buildings`, if enabled.
- `ForceWeapon.Infantry/Units/Aircraft` can be applied to both ground
and air target if `ForceAAWeapon.Infantry/Units/Aircraft` is not set.
- `ForceAAWeapon.Infantry/Units/Aircraft` do the same things but only
for air target. Taking priority to
`ForceWeapon.Infantry/Units/Naval.Units/Aircraft`, which means that they
can only be applied to ground target when they're both set.
In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
ForceWeapon.Buildings=-1 ; integer, -1 to disable
ForceWeapon.Defenses=-1 ; integer, -1 to disable
ForceWeapon.Infantry=-1 ; integer, -1 to disable
ForceWeapon.Naval.Units=-1 ; integer, -1 to disable
ForceWeapon.Units=-1 ; integer, -1 to disable
ForceWeapon.Aircraft=-1 ; integer, -1 to disable
ForceAAWeapon.Infantry=-1 ; integer, -1 to disable
ForceAAWeapon.Units=-1 ; integer, -1 to disable
ForceAAWeapon.Aircraft=-1 ; integer, -1 to disable
```
*Enemy behavior against EMP targets with `ForceWeapon.UnderEMP` in [C&C: Reloaded](https://www.moddb.com/mods/cncreloaded)*
1487
1487
1488
1488
- Can be used to override normal weapon selection logic to force specific weapons to use against certain targets. If multiple are set and target satisfies the conditions, the first one in listed order satisfied takes effect.
1489
-
-`ForceWeapon.Naval.Decloaked` forces specified weapon to be used against uncloaked naval targets. Useful if your naval unit has one weapon only for underwater and another weapon for surface targets.
1489
+
-`ForceWeapon.Naval.Decloaked` forces specified weapon to be used against uncloaked `Naval=yes` targets. Useful if your naval unit has one weapon only for underwater and another weapon for surface targets.
1490
1490
-`ForceWeapon.Cloaked` forces specified weapon to be used against any cloaked targets.
1491
1491
-`ForceWeapon.Disguised` forces specified weapon to be used against any disguised targets.
1492
1492
-`ForceWeapon.UnderEMP` forces specified weapon to be used if the target is under EMP effect.
1493
1493
-`ForceWeapon.InRange` forces specified a list of weapons to be used once the target is within their `Range`. If `ForceWeapon.InRange.TechnoOnly` set to true, it'll only be forced on TechnoTypes like other forced weapons, otherwise it'll also be forced when attacking empty grounds. The first weapon in the listed order satisfied will be selected. Can be applied to both ground and air target if `ForceAAWeapon.InRange` is not set.
1494
1494
-`ForceAAWeapon.InRange` does the same thing but only for air target. Taking priority to `ForceWeapon.InRange`, which means that it can only be applied to ground target when they're both set.
1495
1495
-`Force(AA)Weapon.InRange.Overrides` overrides the range when decides which weapon to use. Value from position matching the position from `Force(AA)Weapon.InRange` is used if found, or the weapon's own `Range` if not found or set to a value below 0.
1496
1496
- If `Force(AA)Weapon.InRange.ApplyRangeModifiers` is set to true, any applicable weapon range modifiers from the firer are applied to the decision range.
1497
+
- A series of tags can force specified weapons based on the target's type.
1498
+
-`ForceWeapon.Naval.Units` forces specified weapon to be used against `Naval=yes` units. Taking priority to `ForceWeapon.Units`.
1499
+
- If `ForceWeapon.Defenses` is enabled, it'll be used if the target is a building with `BuildCat=Combat`. Otherwise it'll follow `ForceWeapon.Buildings`, if enabled.
1500
+
-`ForceWeapon.Infantry/Units/Aircraft` can be applied to both ground and air target if `ForceAAWeapon.Infantry/Units/Aircraft` is not set.
1501
+
-`ForceAAWeapon.Infantry/Units/Aircraft` do the same things but only for air target. Taking priority to `ForceWeapon.Infantry/Units/Naval.Units/Aircraft`, which means that they can only be applied to ground target when they're both set.
1497
1502
1498
1503
In `rulesmd.ini`:
1499
1504
```ini
1500
1505
[SOMETECHNO]; TechnoType
1501
-
ForceWeapon.Naval.Decloaked=-1 ; integer. 0 for primary weapon, 1 for secondary weapon, -1 to disable
1502
-
ForceWeapon.Cloaked=-1 ; integer. 0 for primary weapon, 1 for secondary weapon, -1 to disable
1503
-
ForceWeapon.Disguised=-1 ; integer. 0 for primary weapon, 1 for secondary weapon, -1 to disable
1504
-
ForceWeapon.UnderEMP=-1 ; integer. 0 for primary weapon, 1 for secondary weapon, -1 to disable
1505
-
ForceWeapon.InRange= ; List of integers. 0 for primary weapon, 1 for secondary weapon, -1 to disable
1506
+
ForceWeapon.Naval.Decloaked=-1 ; integer, -1 to disable
1507
+
ForceWeapon.Cloaked=-1 ; integer, -1 to disable
1508
+
ForceWeapon.Disguised=-1 ; integer, -1 to disable
1509
+
ForceWeapon.UnderEMP=-1 ; integer, -1 to disable
1510
+
ForceWeapon.InRange= ; List of integers
1506
1511
ForceWeapon.InRange.Overrides= ; List of floating-point values
0 commit comments