From fe60f5a77f9b3359da2d18a45e8c78e4a3dfc682 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 14 Jan 2016 23:32:12 +0000 Subject: [PATCH 1/4] Introduce Turreted.WorldOrientation. --- OpenRA.Mods.Common/Traits/Armament.cs | 13 ++++++++----- .../Traits/Render/WithSpriteBarrel.cs | 6 +++--- .../Traits/Render/WithSpriteTurret.cs | 5 ++--- OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs | 10 +++++----- OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs | 2 +- OpenRA.Mods.Common/Traits/Turreted.cs | 10 +++++----- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index 5bf642ef11..6ff6f34fa1 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -253,7 +253,10 @@ namespace OpenRA.Mods.Common.Traits var localOffset = b.Offset + new WVec(-Recoil, WDist.Zero, WDist.Zero); if (turret != null) { - var turretOrientation = coords.QuantizeOrientation(self, turret.LocalOrientation(self)); + // WorldOrientation is quantized to satisfy the *Fudges. + // Need to then convert back to a pseudo-local coordinate space, apply offsets, + // then rotate back at the end + var turretOrientation = turret.WorldOrientation(self) - bodyOrientation; localOffset = localOffset.Rotate(turretOrientation); localOffset += turret.Offset; } @@ -263,10 +266,10 @@ namespace OpenRA.Mods.Common.Traits public WRot MuzzleOrientation(Actor self, Barrel b) { - var orientation = self.Orientation + WRot.FromYaw(b.Yaw); - if (turret != null) - orientation += turret.LocalOrientation(self); - return orientation; + var orientation = turret != null ? turret.WorldOrientation(self) : + coords.QuantizeOrientation(self, self.Orientation); + + return orientation + WRot.FromYaw(b.Yaw); } public Actor Actor { get { return self; } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBarrel.cs index ca507a8549..75f37f22be 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBarrel.cs @@ -90,9 +90,9 @@ namespace OpenRA.Mods.Common.Traits { var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero); var turretOffset = turreted != null ? turreted.Position(self) : WVec.Zero; - var turretOrientation = turreted != null ? turreted.LocalOrientation(self) : WRot.Zero; - var quantizedBody = body.QuantizeOrientation(self, self.Orientation); + var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - quantizedBody : WRot.Zero; + var quantizedTurret = body.QuantizeOrientation(self, turretOrientation); return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody)); } @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits { var b = self.Orientation; var qb = body.QuantizeOrientation(self, b); - yield return turreted.LocalOrientation(self) + WRot.FromYaw(b.Yaw - qb.Yaw); + yield return turreted.WorldOrientation(self) - qb + WRot.FromYaw(b.Yaw - qb.Yaw); yield return qb; } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs index fe48517623..e65dd9d92f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs @@ -98,9 +98,8 @@ namespace OpenRA.Mods.Common.Traits var recoil = arms.Aggregate(WDist.Zero, (a, b) => a + b.Recoil); var localOffset = new WVec(-recoil, WDist.Zero, WDist.Zero); - var bodyOrientation = body.QuantizeOrientation(self, self.Orientation); - var turretOrientation = body.QuantizeOrientation(self, t.LocalOrientation(self)); - return t.Position(self) + body.LocalToWorld(localOffset.Rotate(turretOrientation).Rotate(bodyOrientation)); + var quantizedWorldTurret = t.WorldOrientation(self); + return t.Position(self) + body.LocalToWorld(localOffset.Rotate(quantizedWorldTurret)); } public string NormalizeSequence(Actor self, string sequence) diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs index 5be2a84bed..958d795471 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs @@ -84,20 +84,20 @@ namespace OpenRA.Mods.Common.Traits WVec BarrelOffset() { + var b = self.Orientation; + var qb = body.QuantizeOrientation(self, b); var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero); var turretLocalOffset = turreted != null ? turreted.Offset : WVec.Zero; - var turretOrientation = turreted != null ? turreted.LocalOrientation(self) : WRot.Zero; + var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - b + WRot.FromYaw(b.Yaw - qb.Yaw) : WRot.Zero; - var quantizedBody = body.QuantizeOrientation(self, self.Orientation); - var quantizedTurret = body.QuantizeOrientation(self, turretOrientation); - return body.LocalToWorld((turretLocalOffset + localOffset.Rotate(quantizedTurret)).Rotate(quantizedBody)); + return body.LocalToWorld((turretLocalOffset + localOffset.Rotate(turretOrientation)).Rotate(qb)); } IEnumerable BarrelRotation() { var b = self.Orientation; var qb = body.QuantizeOrientation(self, b); - yield return turreted.LocalOrientation(self) + WRot.FromYaw(b.Yaw - qb.Yaw); + yield return turreted.WorldOrientation(self) - b + WRot.FromYaw(b.Yaw - qb.Yaw); yield return qb; } diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs index e8ca5f1fd0..27d95225e8 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs @@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits { var b = self.Orientation; var qb = body.QuantizeOrientation(self, b); - yield return turreted.LocalOrientation(self) + WRot.FromYaw(b.Yaw - qb.Yaw); + yield return turreted.WorldOrientation(self) - b + WRot.FromYaw(b.Yaw - qb.Yaw); yield return qb; } diff --git a/OpenRA.Mods.Common/Traits/Turreted.cs b/OpenRA.Mods.Common/Traits/Turreted.cs index 246da505e2..60d1f698b7 100644 --- a/OpenRA.Mods.Common/Traits/Turreted.cs +++ b/OpenRA.Mods.Common/Traits/Turreted.cs @@ -122,18 +122,18 @@ namespace OpenRA.Mods.Common.Traits return body.LocalToWorld(Offset.Rotate(bodyOrientation)); } - // Orientation in unit-space - public WRot LocalOrientation(Actor self) + // Orientation in world-space + public WRot WorldOrientation(Actor self) { // Hack: turretFacing is relative to the world, so subtract the body yaw - var local = WRot.FromYaw(WAngle.FromFacing(TurretFacing) - self.Orientation.Yaw); + var world = WRot.FromYaw(WAngle.FromFacing(TurretFacing)); if (QuantizedFacings == 0) - return local; + return world; // Quantize orientation to match a rendered sprite // Implies no pitch or yaw - var facing = body.QuantizeFacing(local.Yaw.Angle / 4, QuantizedFacings); + var facing = body.QuantizeFacing(world.Yaw.Angle / 4, QuantizedFacings); return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)); } From 608b5d167449f4c445fe5eafe9d991a80b9d9723 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 14 Jan 2016 19:46:54 +0000 Subject: [PATCH 2/4] Add UseClassicFacingFudge flag for TD/RA. --- .../Graphics/DefaultSpriteSequence.cs | 12 +++++++--- OpenRA.Mods.Common/Traits/BodyOrientation.cs | 5 +++- OpenRA.Mods.Common/Util.cs | 24 +++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index 024d25ae86..97657a15dc 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Graphics { static readonly WDist DefaultShadowSpriteZOffset = new WDist(-5); readonly Sprite[] sprites; - readonly bool reverseFacings, transpose; + readonly bool reverseFacings, transpose, useClassicFacingFudge; protected readonly ISpriteSequenceLoader Loader; @@ -129,6 +129,8 @@ namespace OpenRA.Mods.Common.Graphics Tick = LoadField(d, "Tick", 40); transpose = LoadField(d, "Transpose", false); Frames = LoadField(d, "Frames", null); + useClassicFacingFudge = LoadField(d, "UseClassicFacingFudge", false); + var flipX = LoadField(d, "FlipX", false); var flipY = LoadField(d, "FlipY", false); @@ -139,6 +141,11 @@ namespace OpenRA.Mods.Common.Graphics Facings = -Facings; } + if (useClassicFacingFudge && Facings != 32) + throw new InvalidOperationException( + "{0}: Sequence {1}.{2}: UseClassicFacingFudge is only valid for 32 facings" + .F(info.Nodes[0].Location, sequence, animation)); + var offset = LoadField(d, "Offset", float2.Zero); var blendMode = LoadField(d, "BlendMode", BlendMode.Alpha); @@ -237,8 +244,7 @@ namespace OpenRA.Mods.Common.Graphics protected virtual Sprite GetSprite(int start, int frame, int facing) { - var f = Util.QuantizeFacing(facing, Facings); - + var f = Util.QuantizeFacing(facing, Facings, useClassicFacingFudge); if (reverseFacings) f = (Facings - f) % Facings; diff --git a/OpenRA.Mods.Common/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs index 3418f4362f..5a1b3b47f9 100644 --- a/OpenRA.Mods.Common/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Fudge the coordinate system angles like the early games.")] public readonly bool UseClassicPerspectiveFudge = true; + [Desc("Fudge the coordinate system angles like the early games.")] + public readonly bool UseClassicFacingFudge = false; + public WVec LocalToWorld(WVec vec) { // Rotate by 90 degrees @@ -50,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits public int QuantizeFacing(int facing, int facings) { - return Util.QuantizeFacing(facing, facings) * (256 / facings); + return Util.QuantizeFacing(facing, facings, UseClassicFacingFudge) * (256 / facings); } public object Create(ActorInitializer init) { return new BodyOrientation(init, this); } diff --git a/OpenRA.Mods.Common/Util.cs b/OpenRA.Mods.Common/Util.cs index 032772049d..ecc31f5920 100644 --- a/OpenRA.Mods.Common/Util.cs +++ b/OpenRA.Mods.Common/Util.cs @@ -48,6 +48,30 @@ namespace OpenRA.Mods.Common return a / step; } + public static int QuantizeFacing(int facing, int numFrames, bool useClassicFacingFudge) + { + if (!useClassicFacingFudge || numFrames != 32) + return Util.QuantizeFacing(facing, numFrames); + + // TD and RA divided the facing artwork into 3 frames from (north|south) to (north|south)-(east|west) + // and then 5 frames from (north|south)-(east|west) to (east|west) + var quadrant = ((facing + 31) & 0xFF) / 64; + if (quadrant == 0 || quadrant == 2) + { + var frame = Util.QuantizeFacing(facing, 24); + if (frame > 18) + return frame + 6; + if (frame > 4) + return frame + 3; + return frame; + } + else + { + var frame = Util.QuantizeFacing(facing, 40); + return frame < 20 ? frame - 3 : frame - 8; + } + } + public static WPos BetweenCells(World w, CPos from, CPos to) { return WPos.Lerp(w.Map.CenterOfCell(from), w.Map.CenterOfCell(to), 1, 2); From 2d9bbd9405bf26a94e5550b55d1cde552c60d70f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 14 Jan 2016 22:32:51 +0000 Subject: [PATCH 3/4] Enable ClassicFacingFudge in TD. --- mods/cnc/rules/aircraft.yaml | 4 ++- mods/cnc/rules/defaults.yaml | 8 +++++ mods/cnc/rules/structures.yaml | 6 +++- mods/cnc/sequences/aircraft.yaml | 5 ++++ mods/cnc/sequences/structures.yaml | 6 ++++ mods/cnc/sequences/vehicles.yaml | 48 ++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 2 deletions(-) diff --git a/mods/cnc/rules/aircraft.yaml b/mods/cnc/rules/aircraft.yaml index 8bc0274882..a8a753d997 100644 --- a/mods/cnc/rules/aircraft.yaml +++ b/mods/cnc/rules/aircraft.yaml @@ -13,7 +13,7 @@ TRAN: LandWhenIdle: true ROT: 5 Speed: 140 - InitialFacing: 0 + InitialFacing: 224 LandableTerrainTypes: Clear,Rough,Road,Ore,Beach,Tiberium,BlueTiberium AltitudeVelocity: 0c100 Health: @@ -54,6 +54,7 @@ HELI: Queue: Aircraft.Nod Aircraft: RearmBuildings: hpad + InitialFacing: 224 ROT: 4 Speed: 186 Health: @@ -105,6 +106,7 @@ ORCA: Queue: Aircraft.GDI Aircraft: RearmBuildings: hpad + InitialFacing: 224 ROT: 4 Speed: 186 Health: diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 74f867e27b..192e1496e4 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -98,6 +98,8 @@ MustBeDestroyed: Voiced: VoiceSet: VehicleVoice + BodyOrientation: + UseClassicFacingFudge: True ^Tank: Inherits: ^Vehicle @@ -157,6 +159,8 @@ MustBeDestroyed: Voiced: VoiceSet: VehicleVoice + BodyOrientation: + UseClassicFacingFudge: True ^Infantry: Inherits@1: ^ExistsInWorld @@ -674,6 +678,8 @@ Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall + BodyOrientation: + UseClassicFacingFudge: True ^HelicopterHusk: Inherits: ^CommonHuskDefaults @@ -687,6 +693,8 @@ Explosion: HeliCrash Tooltip: GenericName: Destroyed Helicopter + BodyOrientation: + UseClassicFacingFudge: True ^Bridge: AlwaysVisible: diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 6540d9d31a..c7a9d9a7df 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -658,7 +658,7 @@ GUN: HasMinibib: Yes Turreted: ROT: 12 - InitialFacing: 50 + InitialFacing: 56 -WithSpriteBody: WithTurretedSpriteBody: Armament: @@ -672,6 +672,8 @@ GUN: Range: 3c0 Power: Amount: -20 + BodyOrientation: + UseClassicFacingFudge: True SAM: Inherits: ^Defense @@ -712,6 +714,8 @@ SAM: -RenderDetectionCircle: Power: Amount: -20 + BodyOrientation: + UseClassicFacingFudge: True OBLI: Inherits: ^Defense diff --git a/mods/cnc/sequences/aircraft.yaml b/mods/cnc/sequences/aircraft.yaml index 0f6e718e4c..7ef851a8a7 100644 --- a/mods/cnc/sequences/aircraft.yaml +++ b/mods/cnc/sequences/aircraft.yaml @@ -1,11 +1,13 @@ c17: idle: Facings: 32 + UseClassicFacingFudge: True icon: c17icnh tran: idle: Facings: 32 + UseClassicFacingFudge: True rotor: lrotor Length: 4 rotor2: rrotor @@ -27,6 +29,7 @@ tran: heli: idle: Facings: 32 + UseClassicFacingFudge: True rotor: lrotor Length: 4 slow-rotor: lrotor @@ -41,6 +44,7 @@ heli: orca: idle: Facings: 32 + UseClassicFacingFudge: True move: Start: 32 Facings: 32 @@ -50,6 +54,7 @@ orca: a10: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: minigun Length: 6 Facings: 8 diff --git a/mods/cnc/sequences/structures.yaml b/mods/cnc/sequences/structures.yaml index c87466add5..407addeb30 100644 --- a/mods/cnc/sequences/structures.yaml +++ b/mods/cnc/sequences/structures.yaml @@ -414,15 +414,19 @@ wood: gun: idle: Facings: 32 + UseClassicFacingFudge: True recoil: Start: 32 Facings: 32 + UseClassicFacingFudge: True damaged-idle: Start: 64 Facings: 32 + UseClassicFacingFudge: True damaged-recoil: Start: 96 Facings: 32 + UseClassicFacingFudge: True make: gunmake Length: * Tick: 80 @@ -449,6 +453,7 @@ sam: idle: Start: 17 Facings: 32 + UseClassicFacingFudge: True closing: Start: 50 Length: 14 @@ -462,6 +467,7 @@ sam: damaged-idle: Start: 81 Facings: 32 + UseClassicFacingFudge: True damaged-closing: Start: 114 Length: 14 diff --git a/mods/cnc/sequences/vehicles.yaml b/mods/cnc/sequences/vehicles.yaml index 7b6cd1a98a..63a0ae64ba 100644 --- a/mods/cnc/sequences/vehicles.yaml +++ b/mods/cnc/sequences/vehicles.yaml @@ -1,17 +1,20 @@ mcv: idle: Facings: 32 + UseClassicFacingFudge: True icon: mcvicnh.tem AddExtension: False mcv.destroyed: idle: mcv Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 harv: idle: Facings: 32 + UseClassicFacingFudge: True harvest: Start: 32 Length: 4 @@ -27,14 +30,17 @@ harv: harv.destroyed: idle: harv Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 bggy: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: minigun Length: 6 Facings: 8 @@ -44,18 +50,22 @@ bggy: bggy.destroyed: idle: bggy Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: bggy Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 mtnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: * icon: mtnkicnh.tem @@ -64,18 +74,22 @@ mtnk: mtnk.destroyed: idle: mtnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: mtnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 ltnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: * icon: ltnkicnh.tem @@ -84,18 +98,22 @@ ltnk: ltnk.destroyed: idle: ltnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: ltnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 htnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: * icon: htnkicnh.tem @@ -104,18 +122,22 @@ htnk: htnk.destroyed: idle: htnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: htnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 jeep: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: minigun Length: 6 Facings: 8 @@ -125,26 +147,31 @@ jeep: jeep.destroyed: idle: jeep Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: jeep Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 bike: idle: Facings: 32 + UseClassicFacingFudge: True icon: bikeicnh.tem AddExtension: False bike.destroyed: idle: bike Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 ftnk: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: Combine: flame-n: @@ -179,11 +206,13 @@ ftnk: ftnk.destroyed: idle: ftnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 mhq: idle: Facings: 32 + UseClassicFacingFudge: True spinner: Start: 32 Length: 32 @@ -192,68 +221,84 @@ mhq: msam: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True empty-aim: Start: 64 Facings: 32 + UseClassicFacingFudge: True aim: Start: 64 Facings: 32 + UseClassicFacingFudge: True icon: msamicnh.tem AddExtension: False msam.destroyed: idle: msam Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: msam Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 mlrs: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True turret2: Start: 32 Facings: 32 + UseClassicFacingFudge: True turret1: Start: 64 Facings: 32 + UseClassicFacingFudge: True turret0: Start: 96 Facings: 32 + UseClassicFacingFudge: True icon: mlrsicnh.tem AddExtension: False mlrs.destroyed: idle: mlrs Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: mlrs Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 stnk: idle: Facings: 32 + UseClassicFacingFudge: True icon: stnkicnh.tem AddExtension: False stnk.destroyed: idle: stnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 arty: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: * icon: artyicnh.tem @@ -262,11 +307,13 @@ arty: arty.destroyed: idle: arty Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 apc: idle: Facings: 32 + UseClassicFacingFudge: True turret: apctur Facings: 32 muzzle: apcmuz @@ -284,6 +331,7 @@ apc: apc.destroyed: idle: apc Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: apctur Facings: 32 From 66df822412a640cf0a5b659506e4ed24884fe496 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 15 Jan 2016 17:44:36 +0000 Subject: [PATCH 4/4] Enable ClassicFacingFudge in RA. --- mods/ra/rules/aircraft.yaml | 6 ++--- mods/ra/rules/defaults.yaml | 8 ++++++ mods/ra/rules/structures.yaml | 9 ++++++- mods/ra/sequences/aircraft.yaml | 3 +++ mods/ra/sequences/structures.yaml | 10 +++++++ mods/ra/sequences/vehicles.yaml | 43 +++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 4 deletions(-) diff --git a/mods/ra/rules/aircraft.yaml b/mods/ra/rules/aircraft.yaml index e661b8662a..921b2112a1 100644 --- a/mods/ra/rules/aircraft.yaml +++ b/mods/ra/rules/aircraft.yaml @@ -207,7 +207,7 @@ TRAN: Range: 10c0 Type: CenterPosition Aircraft: - InitialFacing: 0 + InitialFacing: 224 ROT: 5 Speed: 112 LandableTerrainTypes: Clear,Rough,Road,Ore,Beach @@ -256,7 +256,7 @@ HELI: FacingTolerance: 20 Aircraft: LandWhenIdle: false - InitialFacing: 20 + InitialFacing: 224 ROT: 4 Speed: 149 AutoTarget: @@ -307,7 +307,7 @@ HIND: FacingTolerance: 20 Aircraft: LandWhenIdle: false - InitialFacing: 20 + InitialFacing: 224 ROT: 4 Speed: 112 AutoTarget: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index d5cd53210c..d9fc3f019c 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -139,6 +139,8 @@ Sequence: idle OpeningSequence: open Offset: 0,0,200 + BodyOrientation: + UseClassicFacingFudge: True ^Tank: Inherits: ^Vehicle @@ -401,6 +403,8 @@ Hovers@CRUISING: UpgradeTypes: cruising UpgradeMinEnabledLevel: 1 + BodyOrientation: + UseClassicFacingFudge: True ^BasicBuilding: Inherits@1: ^ExistsInWorld @@ -626,6 +630,8 @@ Chronoshiftable: Tooltip: GenericName: Destroyed Vehicle + BodyOrientation: + UseClassicFacingFudge: True ^PlaneHusk: Inherits: ^BasicHusk @@ -650,6 +656,8 @@ CruisingUpgrades: cruising CanHover: True FallsToEarth: + BodyOrientation: + UseClassicFacingFudge: True ^Bridge: AlwaysVisible: diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index f9b3631491..25880777b7 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -493,6 +493,8 @@ AGUN: Range: 6c0 WithBuildingExplosion: Sequences: building, building_napalm, large_explosion, self_destruct + BodyOrientation: + UseClassicFacingFudge: True DOME: Inherits: ^Building @@ -646,7 +648,7 @@ GUN: HasMinibib: Yes Turreted: ROT: 12 - InitialFacing: 50 + InitialFacing: 56 -WithSpriteBody: WithTurretedSpriteBody: Armament: @@ -661,6 +663,8 @@ GUN: Range: 7c0 WithBuildingExplosion: Sequences: building, building_napalm, large_explosion, self_destruct + BodyOrientation: + UseClassicFacingFudge: True FTUR: Inherits: ^Defense @@ -741,6 +745,8 @@ SAM: Amount: -40 DetectCloaked: Range: 5c0 + BodyOrientation: + UseClassicFacingFudge: True ATEK: Inherits: ^ScienceBuilding @@ -1066,6 +1072,7 @@ HPAD: SpawnOffset: 0,-256,0 ExitCell: 0,0 MoveIntoWorld: false + Facing: 224 RallyPoint: Production: Produces: Aircraft, Helicopter diff --git a/mods/ra/sequences/aircraft.yaml b/mods/ra/sequences/aircraft.yaml index 12bda8f73b..2aaccb1730 100644 --- a/mods/ra/sequences/aircraft.yaml +++ b/mods/ra/sequences/aircraft.yaml @@ -14,6 +14,7 @@ yak: heli: idle: Facings: 32 + UseClassicFacingFudge: True rotor: lrotor Length: 4 slow-rotor: lrotor @@ -24,6 +25,7 @@ heli: hind: idle: Facings: 32 + UseClassicFacingFudge: True rotor: lrotorlg Length: 4 slow-rotor: lrotorlg @@ -37,6 +39,7 @@ hind: tran: idle: tran2 Facings: 32 + UseClassicFacingFudge: True rotor: lrotor Length: 4 rotor2: rrotor diff --git a/mods/ra/sequences/structures.yaml b/mods/ra/sequences/structures.yaml index 55753c9ab1..8c28ed9a1a 100644 --- a/mods/ra/sequences/structures.yaml +++ b/mods/ra/sequences/structures.yaml @@ -344,17 +344,21 @@ fix: gun: idle: Facings: 32 + UseClassicFacingFudge: True recoil: Start: 32 Facings: 32 + UseClassicFacingFudge: True make: gunmake Length: * damaged-idle: Start: 64 Facings: 32 + UseClassicFacingFudge: True damaged-recoil: Start: 96 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 bib: mbGUN @@ -366,10 +370,12 @@ gun: agun: idle: Facings: 32 + UseClassicFacingFudge: True Offset: 0,-1 recoil: Start: 32 Facings: 32 + UseClassicFacingFudge: True Offset: 0,-1 make: agunmake Length: * @@ -377,10 +383,12 @@ agun: damaged-idle: Start: 64 Facings: 32 + UseClassicFacingFudge: True Offset: 0,-1 damaged-recoil: Start: 96 Facings: 32 + UseClassicFacingFudge: True Offset: 0,-1 muzzle: gunfire2 Start: 1 @@ -394,10 +402,12 @@ agun: sam: idle: sam2 Facings: 32 + UseClassicFacingFudge: True Offset: -2,-2 damaged-idle: sam2 Start: 34 Facings: 32 + UseClassicFacingFudge: True Offset: -2,-2 make: sammake Length: * diff --git a/mods/ra/sequences/vehicles.yaml b/mods/ra/sequences/vehicles.yaml index 464060a5e9..0221a720a2 100644 --- a/mods/ra/sequences/vehicles.yaml +++ b/mods/ra/sequences/vehicles.yaml @@ -1,39 +1,46 @@ mcv: idle: Facings: 32 + UseClassicFacingFudge: True icon: mcvicon mcvhusk: idle: Facings: 32 + UseClassicFacingFudge: True ZOffset: -1023 truk: idle: Facings: 32 + UseClassicFacingFudge: True icon: trukicon harv: idle: harvempty Facings: 32 + UseClassicFacingFudge: True harvest: harvempty Start: 32 Length: 8 Facings: 8 empty-idle: harvempty Facings: 32 + UseClassicFacingFudge: True empty-harvest: harvempty Start: 32 Length: 8 Facings: 8 half-idle: harvhalf Facings: 32 + UseClassicFacingFudge: True half-harvest: harvhalf Start: 32 Length: 8 Facings: 8 full-idle: Facings: 32 + UseClassicFacingFudge: True full-harvest: Start: 32 Length: 8 @@ -50,19 +57,23 @@ harv: hhusk: idle: Facings: 32 + UseClassicFacingFudge: True ZOffset: -1023 hhusk2: idle: Facings: 32 + UseClassicFacingFudge: True ZOffset: -1023 1tnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 2 icon: 1tnkicon @@ -70,18 +81,22 @@ hhusk2: 1tnk.destroyed: idle: 1tnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: 1tnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 2tnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 icon: 2tnkicon @@ -89,18 +104,22 @@ hhusk2: 2tnk.destroyed: idle: 2tnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: 2tnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 3tnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 icon: 3tnkicon @@ -108,18 +127,22 @@ hhusk2: 3tnk.destroyed: idle: 3tnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: 3tnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 4tnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 icon: 4tnkicon @@ -127,18 +150,22 @@ hhusk2: 4tnk.destroyed: idle: 4tnk Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 turret: 4tnk Start: 32 Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 v2rl: idle: Facings: 32 + UseClassicFacingFudge: True empty-idle: Start: 32 Facings: 32 + UseClassicFacingFudge: True aim: Start: 64 Facings: 8 @@ -150,6 +177,7 @@ v2rl: arty: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 icon: artyicon @@ -157,19 +185,23 @@ arty: jeep: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: minigun Length: 6 Facings: 8 unload: Facings: 32 + UseClassicFacingFudge: True icon: jeepicon apc: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: minigun Length: 6 Facings: 8 @@ -183,11 +215,13 @@ apc: mnly: idle: Facings: 32 + UseClassicFacingFudge: True icon: mnlyicon mrj: idle: Facings: 32 + UseClassicFacingFudge: True spinner: Start: 32 Length: 32 @@ -196,6 +230,7 @@ mrj: mgg: idle: Facings: 32 + UseClassicFacingFudge: True spinner: Start: 32 Length: 8 @@ -207,6 +242,7 @@ mgg: mgg.destroyed: idle: mgg Facings: 32 + UseClassicFacingFudge: True ZOffset: -512 spinner: mgg Start: 32 @@ -218,6 +254,7 @@ mgg.destroyed: ttnk: idle: Facings: 32 + UseClassicFacingFudge: True spinner: Start: 32 Length: 32 @@ -226,9 +263,11 @@ ttnk: ftrk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 32 Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 2 icon: ftrkicon @@ -236,11 +275,13 @@ ftrk: dtrk: idle: Facings: 32 + UseClassicFacingFudge: True icon: dtrkicon ctnk: idle: Facings: 32 + UseClassicFacingFudge: True muzzle: gunfire2 Length: 5 icon: ctnkicon @@ -248,6 +289,7 @@ ctnk: qtnk: idle: Facings: 32 + UseClassicFacingFudge: True piston: Start: 32 Facings: 8 @@ -257,6 +299,7 @@ qtnk: stnk: idle: Facings: 32 + UseClassicFacingFudge: True turret: Start: 38 Facings: 32