diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index ad5a320dcc..bb9a09f303 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -191,7 +191,6 @@ - diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index cb97e131c3..00526d6d00 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -308,22 +308,6 @@ namespace OpenRA.Traits public interface IPostRenderSelection { IEnumerable RenderAfterWorld(WorldRenderer wr); } - public interface IBodyOrientation - { - WAngle CameraPitch { get; } - int QuantizedFacings { get; } - WVec LocalToWorld(WVec vec); - WRot QuantizeOrientation(Actor self, WRot orientation); - } - - public interface IBodyOrientationInfo : ITraitInfo - { - WVec LocalToWorld(WVec vec); - WRot QuantizeOrientation(WRot orientation, int facings); - } - - public interface IQuantizeBodyOrientationInfo { int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction); } - public interface ITargetableInfo { string[] GetTargetTypes(); diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs index a03e44246e..41a162ac47 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs @@ -27,11 +27,6 @@ namespace OpenRA.Mods.Cnc.Traits [SequenceReference] public readonly string WakeRightSequence = "wake-right"; public override object Create(ActorInitializer init) { return new WithGunboatBody(init, this); } - - public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) - { - return 2; - } } class WithGunboatBody : WithSpriteBody, ITick diff --git a/OpenRA.Mods.Common/Effects/Contrail.cs b/OpenRA.Mods.Common/Effects/Contrail.cs index c5c54df60b..aba9a1d131 100644 --- a/OpenRA.Mods.Common/Effects/Contrail.cs +++ b/OpenRA.Mods.Common/Effects/Contrail.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Effects diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index c1452e132e..374ce1713f 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -399,6 +399,8 @@ + + diff --git a/OpenRA.Game/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs similarity index 83% rename from OpenRA.Game/Traits/BodyOrientation.cs rename to OpenRA.Mods.Common/Traits/BodyOrientation.cs index 54afb6dbd8..39c47652a3 100644 --- a/OpenRA.Game/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -9,8 +9,11 @@ #endregion using System; +using System.Collections.Generic; +using System.Linq; +using OpenRA.Traits; -namespace OpenRA.Traits +namespace OpenRA.Mods.Common.Traits { public class BodyOrientationInfo : ITraitInfo, IBodyOrientationInfo { @@ -70,8 +73,12 @@ namespace OpenRA.Traits return info.QuantizedFacings; var qboi = self.Info.Traits.GetOrDefault(); - if (qboi == null) - throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); + var isb = self.HasTrait(); + + // If a sprite actor has neither custom QuantizedFacings nor a trait implementing IQuantizeBodyOrientationInfo, throw + if (qboi == null && isb) + throw new InvalidOperationException("Actor" + self.Info.Name + "has a sprite body but no facing quantization." + + " Either add the QuantizeFacingsFromSequence trait or set custom QuantizedFacings on BodyOrientation."); return qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, faction); }); diff --git a/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs b/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs new file mode 100644 index 0000000000..93c10dab09 --- /dev/null +++ b/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs @@ -0,0 +1,43 @@ +#region Copyright & License Information +/* + * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using OpenRA.Graphics; +using OpenRA.Mods.Common.Graphics; +using OpenRA.Traits; + +namespace OpenRA.Mods.Common.Traits +{ + [Desc("Derive facings from sprite body sequence.")] + public class QuantizeFacingsFromSequenceInfo : UpgradableTraitInfo, IQuantizeBodyOrientationInfo, Requires + { + [Desc("Defines sequence to derive facings from."), SequenceReference] + public readonly string Sequence = "idle"; + + public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) + { + if (string.IsNullOrEmpty(Sequence)) + throw new InvalidOperationException("Actor " + ai.Name + " is missing sequence to quantize facings from."); + + var rsi = ai.Traits.Get(); + return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, race), Sequence).Facings; + } + + public override object Create(ActorInitializer init) { return new QuantizeFacingsFromSequence(this); } + } + + public class QuantizeFacingsFromSequence : UpgradableTrait + { + public QuantizeFacingsFromSequence(QuantizeFacingsFromSequenceInfo info) + : base(info) { } + } +} diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs b/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs index 311b4cf1e3..5bcdd33c73 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Basic render trait for immobile actors. Deprecated, use RenderSprites + WithSpriteBody instead.")] - public class RenderSimpleInfo : RenderSpritesInfo, IRenderActorPreviewSpritesInfo, IQuantizeBodyOrientationInfo, Requires + public class RenderSimpleInfo : RenderSpritesInfo, IRenderActorPreviewSpritesInfo, Requires { [SequenceReference] public readonly string Sequence = "idle"; @@ -33,11 +33,6 @@ namespace OpenRA.Mods.Common.Traits yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale); } - - public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) - { - return sequenceProvider.GetSequence(GetImage(ai, sequenceProvider, faction), Sequence).Facings; - } } public class RenderSimple : RenderSprites, IAutoSelectionSize diff --git a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs index 523f20e399..7f392a5365 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Renders crates with both water and land variants.")] - class WithCrateBodyInfo : ITraitInfo, Requires, IQuantizeBodyOrientationInfo, IRenderActorPreviewSpritesInfo + class WithCrateBodyInfo : ITraitInfo, Requires, IRenderActorPreviewSpritesInfo { [Desc("Easteregg sequences to use in december.")] public readonly string[] XmasImages = { }; @@ -35,8 +35,6 @@ namespace OpenRA.Mods.Common.Traits anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), IdleSequence)); yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 1; } } class WithCrateBody : INotifyParachuteLanded diff --git a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs index d1c9132d32..7f5f9e2dfb 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs @@ -30,12 +30,6 @@ namespace OpenRA.Mods.Common.Traits yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale); } - - public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) - { - var rsi = ai.Traits.Get(); - return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, faction), Sequence).Facings; - } } public class WithFacingSpriteBody : WithSpriteBody diff --git a/OpenRA.Mods.Common/Traits/Render/WithInfantryBody.cs b/OpenRA.Mods.Common/Traits/Render/WithInfantryBody.cs index 4ba38ac7d8..23d97a0b7b 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithInfantryBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithInfantryBody.cs @@ -16,8 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public class WithInfantryBodyInfo : UpgradableTraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewSpritesInfo, - Requires, Requires + public class WithInfantryBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires { public readonly int MinIdleWaitTicks = 30; public readonly int MaxIdleWaitTicks = 110; @@ -40,12 +39,6 @@ namespace OpenRA.Mods.Common.Traits anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), StandSequences.First())); yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) - { - var rsi = ai.Traits.Get(); - return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, faction), StandSequences.First()).Facings; - } } public class WithInfantryBody : UpgradableTrait, ITick, INotifyAttack, INotifyIdle, INotifyCreated diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs index 838b02faad..c4861111ce 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs @@ -17,8 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Default trait for rendering sprite-based actors.")] - public class WithSpriteBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, IQuantizeBodyOrientationInfo, - Requires + public class WithSpriteBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires { [Desc("Animation to play when the actor is created.")] [SequenceReference] public readonly string StartSequence = null; @@ -35,11 +34,6 @@ namespace OpenRA.Mods.Common.Traits yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale); } - - public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) - { - return 1; - } } public class WithSpriteBody : UpgradableTrait, ISpriteBody, INotifyDamageStateChanged diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs index 3926876452..7cd11fa474 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Also returns a default selection size that is calculated automatically from the voxel dimensions.")] - public class WithVoxelBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewVoxelsInfo, Requires + public class WithVoxelBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires { public readonly string Sequence = "idle"; @@ -33,8 +33,6 @@ namespace OpenRA.Mods.Common.Traits () => bodyOrientation, () => false, () => 0); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; } } public class WithVoxelBody : IAutoSelectionSize diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index b8918172d3..90de79ea57 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -25,6 +25,25 @@ namespace OpenRA.Mods.Common.Traits void PlayCustomAnimationBackwards(Actor self, string name, Action after); } + public interface IBodyOrientation + { + WAngle CameraPitch { get; } + int QuantizedFacings { get; } + WVec LocalToWorld(WVec vec); + WRot QuantizeOrientation(Actor self, WRot orientation); + } + + public interface IBodyOrientationInfo : ITraitInfo + { + WVec LocalToWorld(WVec vec); + WRot QuantizeOrientation(WRot orientation, int facings); + } + + public interface IQuantizeBodyOrientationInfo : ITraitInfo + { + int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race); + } + public interface INotifyResourceClaimLost { void OnNotifyResourceClaimLost(Actor self, ResourceClaim claim, Actor claimer); diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 281daa04d2..7ff22a81a2 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1782,6 +1782,34 @@ namespace OpenRA.Mods.Common.UtilityCommands node.Key = "ValidFactions"; } + if (engineVersion < 20150823) + { + // Introduce QuantizeFacingsFromSequence + // This will only do roughly the right thing and probably require the modder to do some manual cleanup + if (depth == 0) + { + var inftraits = node.Value.Nodes.FirstOrDefault(n => + n.Key.StartsWith("WithInfantryBody") + || n.Key.StartsWith("WithDisguisingInfantryBody")); + if (inftraits != null) + { + node.Value.Nodes.Add(new MiniYamlNode("QuantizeFacingsFromSequence", null, new List + { + new MiniYamlNode("Sequence", "stand"), + })); + } + + var other = node.Value.Nodes.FirstOrDefault(x => + x.Key.StartsWith("RenderBuilding") + || x.Key.StartsWith("RenderSimple") + || x.Key.StartsWith("WithCrateBody") + || x.Key.StartsWith("WithSpriteBody") + || x.Key.StartsWith("WithFacingSpriteBody")); + if (other != null) + node.Value.Nodes.Add(new MiniYamlNode("QuantizeFacingsFromSequence", "")); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs index 67610f4da5..0c4e8b14b3 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits { - public class WithVoxelUnloadBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewVoxelsInfo, Requires + public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires { [Desc("Voxel sequence name to use when docked to a refinery.")] public readonly string UnloadSequence = "unload"; @@ -36,8 +36,6 @@ namespace OpenRA.Mods.TS.Traits () => new[] { body.QuantizeOrientation(orientation, facings) }, () => false, () => 0); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; } } public class WithVoxelUnloadBody : IAutoSelectionSize diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs index e3e27e0a09..adb4682911 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs @@ -16,12 +16,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits { - public class WithVoxelWalkerBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, Requires, Requires + public class WithVoxelWalkerBodyInfo : ITraitInfo, Requires, Requires { public readonly int TickRate = 5; public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; } } public class WithVoxelWalkerBody : IAutoSelectionSize, ITick diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs index 387756235a..933e146cb3 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits { - public class WithVoxelWaterBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewVoxelsInfo, Requires + public class WithVoxelWaterBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires { public readonly string WaterSequence = "water"; public readonly string LandSequence = "idle"; @@ -41,8 +41,6 @@ namespace OpenRA.Mods.TS.Traits () => new[] { body.QuantizeOrientation(orientation, facings) }, () => false, () => 0); } - - public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; } } public class WithVoxelWaterBody : IAutoSelectionSize diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 41045156fa..46d7572e6d 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -74,9 +74,10 @@ AttackMove: DrawLineToTarget: WithSmoke: + RenderSprites: + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: - RenderSprites: Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall @@ -137,6 +138,7 @@ Guardable: Tooltip: GenericName: Helicopter + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: RenderSprites: @@ -173,6 +175,8 @@ TargetableUnit: TargetTypes: Ground, Infantry RenderSprites: + QuantizeFacingsFromSequence: + Sequence: stand WithInfantryBody: WithDeathAnimation: DeathTypes: @@ -301,6 +305,8 @@ TargetableUnit: TargetTypes: Ground HiddenUnderFog: + QuantizeFacingsFromSequence: + Sequence: stand WithInfantryBody: AttackSequence: attack WithDeathAnimation: @@ -359,7 +365,9 @@ MuzzleSplitFacings: 8 AttackFrontal: Voice: Attack - WithFacingSpriteBody: + BodyOrientation: + QuantizedFacings: 8 + WithSpriteBody: AutoSelectionSize: RenderSprites: WithMuzzleFlash: @@ -367,8 +375,6 @@ Guard: Voice: Move Guardable: - BodyOrientation: - QuantizedFacings: 8 PoisonedByTiberium: Weapon: Heal Voiced: @@ -383,6 +389,7 @@ ActorLostNotification: AttackMove: WithShadow: + QuantizeFacingsFromSequence: WithFacingSpriteBody: RenderSprites: AutoSelectionSize: @@ -424,6 +431,7 @@ SoundOnDamageTransition: DamagedSounds: xplos.aud DestroyedSounds: crumble.aud + QuantizeFacingsFromSequence: RenderBuilding: WithBuildingExplosion: Delay: 1 @@ -480,6 +488,7 @@ Building: Dimensions: 1,1 Footprint: x + QuantizeFacingsFromSequence: RenderBuilding: Tooltip: Name: Civilian Building (Destroyed) @@ -521,6 +530,7 @@ Name: Field (Destroyed) GenericVisibility: None BodyOrientation: + QuantizedFacings: 1 RenderSprites: Palette: terrain WithSpriteBody: @@ -548,6 +558,8 @@ NodeTypes: wall LineBuildNode: Types: wall + BodyOrientation: + QuantizedFacings: 1 RenderBuildingWall: Palette: staticterrain GivesExperience: @@ -555,13 +567,14 @@ Sellable: SellSounds: cashturn.aud Guardable: - BodyOrientation: FrozenUnderFog: ScriptTriggers: ^Tree: Tooltip: Name: Tree + BodyOrientation: + QuantizedFacings: 1 RenderSprites: Palette: staticterrain WithSpriteBody: @@ -577,7 +590,6 @@ Armor: Type: Wood AutoTargetIgnore: - BodyOrientation: FrozenUnderFog: StartsRevealed: true ScriptTriggers: @@ -585,6 +597,8 @@ ^TibTree: Tooltip: Name: Blossom Tree + BodyOrientation: + QuantizedFacings: 1 RenderBuilding: Palette: staticterrain Building: @@ -593,7 +607,6 @@ AppearsOnRadar: RadarColorFromTerrain: Terrain: Tiberium - BodyOrientation: FrozenUnderFog: StartsRevealed: true WithMakeAnimation: @@ -601,6 +614,8 @@ ^Rock: Tooltip: Name: Rock + BodyOrientation: + QuantizedFacings: 1 RenderSprites: Palette: staticterrain WithSpriteBody: @@ -611,7 +626,6 @@ AppearsOnRadar: RadarColorFromTerrain: Terrain: Tree - BodyOrientation: FrozenUnderFog: StartsRevealed: true ScriptTriggers: @@ -627,6 +641,7 @@ Type: CenterPosition AutoTargetIgnore: BodyOrientation: + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: RenderSprites: @@ -685,6 +700,7 @@ GenericName: Crate Crate: TerrainTypes: Clear, Rough, Road, Tiberium, BlueTiberium, Beach + QuantizeFacingsFromSequence: RenderSprites: Palette: effect Image: crate diff --git a/mods/cnc/rules/misc.yaml b/mods/cnc/rules/misc.yaml index 036e64a901..bb064e94e9 100644 --- a/mods/cnc/rules/misc.yaml +++ b/mods/cnc/rules/misc.yaml @@ -33,6 +33,7 @@ mpspawn: RenderSpritesEditorOnly: Palette: chrome BodyOrientation: + QuantizedFacings: 1 waypoint: AlwaysVisible: @@ -42,6 +43,7 @@ waypoint: RenderSpritesEditorOnly: Palette: chrome BodyOrientation: + QuantizedFacings: 1 ^fact.colorpicker: Inherits: FACT @@ -86,4 +88,5 @@ FLARE: Tooltip: Name: Flare BodyOrientation: + QuantizedFacings: 1 diff --git a/mods/cnc/rules/ships.yaml b/mods/cnc/rules/ships.yaml index 241184c76c..8e2881b686 100644 --- a/mods/cnc/rules/ships.yaml +++ b/mods/cnc/rules/ships.yaml @@ -23,6 +23,8 @@ BOAT: LocalOffset: 85,-85,0, 85,85,0 AttackTurreted: RenderSprites: + BodyOrientation: + QuantizedFacings: 2 WithGunboatBody: Sequence: left # Just a work-around to avoid crash Selectable: @@ -64,6 +66,7 @@ LST: Type: Heavy RevealsShroud: Range: 7c0 + QuantizeFacingsFromSequence: WithFacingSpriteBody: WithRoof: WithCargo: diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index b1c4bff5a2..c7a21c6f14 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -406,7 +406,6 @@ HTNK: MuzzleSequence: muzzle AttackTurreted: WithMuzzleFlash: - WithFacingSpriteBody: WithTurret: AutoTarget: SelfHealing: diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index ab4daf755c..00da36ee6f 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -79,6 +79,7 @@ Guard: Voice: Guard Guardable: + QuantizeFacingsFromSequence: WithFacingSpriteBody: Demolishable: TemporaryOwnerManager: @@ -118,6 +119,7 @@ BodyOrientation: AutoTargetIgnore: ScriptTriggers: + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: RenderSprites: @@ -191,6 +193,8 @@ UpgradeTypes: parachute UpgradeMaxEnabledLevel: 0 RenderSprites: + QuantizeFacingsFromSequence: + Sequence: stand WithInfantryBody: TakeCover: DamageModifiers: @@ -245,6 +249,7 @@ DrawLineToTarget: Voiced: VoiceSet: GenericVoice + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: RenderSprites: @@ -269,6 +274,7 @@ SoundOnDamageTransition: DamagedSounds: EXPLSML1.WAV DestroyedSounds: EXPLHG1.WAV + QuantizeFacingsFromSequence: RenderBuilding: WithBuildingExplosion: RepairableBuilding: diff --git a/mods/d2k/rules/misc.yaml b/mods/d2k/rules/misc.yaml index 3940ddafec..427f6c2da6 100644 --- a/mods/d2k/rules/misc.yaml +++ b/mods/d2k/rules/misc.yaml @@ -103,6 +103,7 @@ crate: SelectionShares: 0 NoBaseSelectionShares: 9001 Units: mcv + QuantizeFacingsFromSequence: RenderSprites: Palette: effect WithCrateBody: @@ -117,6 +118,7 @@ mpspawn: RenderSpritesEditorOnly: WithSpriteBody: BodyOrientation: + QuantizedFacings: 1 waypoint: AlwaysVisible: @@ -125,6 +127,7 @@ waypoint: RenderSpritesEditorOnly: WithSpriteBody: BodyOrientation: + QuantizedFacings: 1 ^carryall.colorpicker: Inherits: carryall @@ -152,6 +155,7 @@ wormspawner: RenderSpritesEditorOnly: WithSpriteBody: BodyOrientation: + QuantizedFacings: 1 WormSpawner: upgrade.conyard: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 159d18c9c1..14921451c6 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -123,6 +123,7 @@ Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall + QuantizeFacingsFromSequence: WithFacingSpriteBody: AutoSelectionSize: RenderSprites: @@ -184,6 +185,8 @@ TargetTypes: Ground, Infantry, Disguise UpgradeTypes: parachute UpgradeMaxEnabledLevel: 0 + QuantizeFacingsFromSequence: + Sequence: stand RenderSprites: WithInfantryBody: WithDeathAnimation: @@ -322,6 +325,7 @@ ExcludeTilesets: INTERIOR Voiced: VoiceSet: VehicleVoice + QuantizeFacingsFromSequence: AutoSelectionSize: RenderSprites: WithFacingSpriteBody: @@ -359,6 +363,7 @@ Tooltip: GenericName: Plane WithShadow: + QuantizeFacingsFromSequence: RenderSprites: WithFacingSpriteBody: AutoSelectionSize: @@ -390,6 +395,7 @@ SoundOnDamageTransition: DamagedSounds: kaboom1.aud DestroyedSounds: kaboom22.aud + QuantizeFacingsFromSequence: RenderBuilding: WithBuildingExplosion: CaptureNotification: @@ -466,6 +472,7 @@ SellSounds: cashturn.aud Guardable: BodyOrientation: + QuantizedFacings: 1 FrozenUnderFog: GpsRemoveFrozenActor: ScriptTriggers: @@ -551,6 +558,7 @@ Type: Wood AutoTargetIgnore: BodyOrientation: + QuantizedFacings: 1 FrozenUnderFog: StartsRevealed: true ScriptTriggers: @@ -564,6 +572,7 @@ Type: Heavy HiddenUnderFog: Type: CenterPosition + QuantizeFacingsFromSequence: BodyOrientation: AutoTargetIgnore: ScriptTriggers: @@ -645,6 +654,7 @@ ProximityCaptor: Types: Tree BodyOrientation: + QuantizedFacings: 1 FrozenUnderFog: StartsRevealed: true ScriptTriggers: @@ -689,4 +699,5 @@ ShadowSequence: idle UpgradeManager: BodyOrientation: + QuantizedFacings: 1 diff --git a/mods/ra/rules/misc.yaml b/mods/ra/rules/misc.yaml index c97d60822a..e0acacb67d 100644 --- a/mods/ra/rules/misc.yaml +++ b/mods/ra/rules/misc.yaml @@ -25,6 +25,7 @@ MINP: TargetableUnit: TargetTypes: Ground BodyOrientation: + QuantizedFacings: 1 Immobile: OccupiesSpace: true @@ -55,6 +56,7 @@ MINV: TargetableUnit: TargetTypes: Ground BodyOrientation: + QuantizedFacings: 1 Immobile: OccupiesSpace: true @@ -179,6 +181,7 @@ CAMERA: ProximityCaptor: Types: Camera BodyOrientation: + QuantizedFacings: 1 DetectCloaked: Range: 10 WithSpriteBody: @@ -227,6 +230,7 @@ FLARE: Name: Flare ShowOwnerRow: false BodyOrientation: + QuantizedFacings: 1 MINE: HiddenUnderShroud: @@ -244,6 +248,7 @@ MINE: Terrain: Ore AutoTargetIgnore: BodyOrientation: + QuantizedFacings: 1 SeedsResource: GMINE: @@ -262,6 +267,7 @@ GMINE: Terrain: Gems AutoTargetIgnore: BodyOrientation: + QuantizedFacings: 1 SeedsResource: ResourceType: Gems @@ -278,6 +284,7 @@ RAILMINE: Dimensions: 2,1 AutoTargetIgnore: BodyOrientation: + QuantizedFacings: 1 EditorTilesetFilter: ExcludeTilesets: INTERIOR @@ -293,6 +300,7 @@ QUEE: AutoSelectionSize: AppearsOnRadar: BodyOrientation: + QuantizedFacings: 1 EditorTilesetFilter: RequireTilesets: INTERIOR @@ -309,6 +317,7 @@ LAR1: AutoSelectionSize: AppearsOnRadar: BodyOrientation: + QuantizedFacings: 1 EditorTilesetFilter: RequireTilesets: INTERIOR @@ -325,6 +334,7 @@ LAR2: AutoSelectionSize: AppearsOnRadar: BodyOrientation: + QuantizedFacings: 1 EditorTilesetFilter: RequireTilesets: INTERIOR @@ -391,6 +401,7 @@ mpspawn: WithSpriteBody: RenderSpritesEditorOnly: BodyOrientation: + QuantizedFacings: 1 waypoint: AlwaysVisible: @@ -399,6 +410,7 @@ waypoint: WithSpriteBody: RenderSpritesEditorOnly: BodyOrientation: + QuantizedFacings: 1 ^fact.colorpicker: Inherits: FACT diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 46531ae3a7..d9217ca2c8 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -62,6 +62,7 @@ SoundOnDamageTransition: DamagedSounds: expnew01.aud DestroyedSounds: crmble2.aud + QuantizeFacingsFromSequence: RenderBuilding: WithBuildingExplosion: Sequences: building, large_bang, large_brnl, verylarge_clsn, large_tumu @@ -227,6 +228,7 @@ VoiceSet: Infantry TargetableUnit: TargetTypes: Ground, Infantry + QuantizeFacingsFromSequence: RenderSprites: WithInfantryBody: WithDeathAnimation@normal: @@ -419,11 +421,15 @@ ^VoxelVehicle: Inherits: ^Vehicle + BodyOrientation: + QuantizedFacings: 0 RenderVoxels: WithVoxelBody: ^VoxelTank: Inherits: ^Tank + BodyOrientation: + QuantizedFacings: 0 RenderVoxels: WithVoxelBody: @@ -452,6 +458,7 @@ Voice: Move ActorLostNotification: BodyOrientation: + QuantizedFacings: 0 CameraPitch: 90 Guard: Voice: Move @@ -511,6 +518,8 @@ PoisonedByTiberium: Weapon: TiberiumHeal Guardable: + BodyOrientation: + QuantizedFacings: 1 RenderSprites: WithSpriteBody: AutoSelectionSize: @@ -528,6 +537,7 @@ Terrain: Tiberium BodyOrientation: UseClassicPerspectiveFudge: False + QuantizedFacings: 1 FrozenUnderFog: StartsRevealed: true SeedsResource: @@ -537,6 +547,9 @@ ^Tree: HiddenUnderShroud: + BodyOrientation: + UseClassicPerspectiveFudge: False + QuantizedFacings: 1 RenderSprites: Palette: terraindecoration WithSpriteBody: @@ -547,13 +560,14 @@ AppearsOnRadar: RadarColorFromTerrain: Terrain: Tree - BodyOrientation: - UseClassicPerspectiveFudge: False Tooltip: Name: Tree ^Rock: HiddenUnderShroud: + BodyOrientation: + UseClassicPerspectiveFudge: False + QuantizedFacings: 1 RenderSprites: Palette: terraindecoration WithSpriteBody: @@ -564,8 +578,6 @@ AppearsOnRadar: RadarColorFromTerrain: Terrain: Rock - BodyOrientation: - UseClassicPerspectiveFudge: False Tooltip: Name: Rock diff --git a/mods/ts/rules/gdi-vehicles.yaml b/mods/ts/rules/gdi-vehicles.yaml index 29836bb85c..b6ec85197f 100644 --- a/mods/ts/rules/gdi-vehicles.yaml +++ b/mods/ts/rules/gdi-vehicles.yaml @@ -106,6 +106,8 @@ SMECH: Weapon: AssaultCannon Voiced: VoiceSet: Mech + QuantizeFacingsFromSequence: + Sequence: stand WithFacingSpriteBody: Sequence: stand WithAttackAnimation: @@ -136,6 +138,8 @@ MMCH: Type: Heavy RevealsShroud: Range: 8c0 + BodyOrientation: + QuantizedFacings: 32 WithInfantryBody: Turreted: ROT: 5 diff --git a/mods/ts/rules/misc.yaml b/mods/ts/rules/misc.yaml index b9f55ea833..720a23025a 100644 --- a/mods/ts/rules/misc.yaml +++ b/mods/ts/rules/misc.yaml @@ -5,6 +5,7 @@ mpspawn: RenderSpritesEditorOnly: WithSpriteBody: BodyOrientation: + QuantizedFacings: 1 waypoint: AlwaysVisible: @@ -13,6 +14,7 @@ waypoint: RenderSpritesEditorOnly: WithSpriteBody: BodyOrientation: + QuantizedFacings: 1 ^mmch.colorpicker: Inherits: MMCH