Getting a strange Exception Error

Modding for Red Alert- using the ~!definition

Information and discussion for custom maps and mods.
Post Reply
sajwang
Posts: 11
Joined: Fri Jul 10, 2015 1:20 am

Getting a strange Exception Error

Post by sajwang »

I'm specifically trying to target this area in my structures.yaml file:

Code: Select all

SAM:
Inherits: ^Defense
Buildable:
Queue: Defense
BuildPaletteOrder: 100
Prerequisites: dome, ~structures.soviet,~!structures.cuba, ~techlevel.medium
Valued:
Cost: 750
Tooltip:
Name: SAM Site
Description: Anti-Air base defense.\nRequires power to operate.\nCan detect cloaked units.\n Strong vs Aircraft\n Weak vs Ground units
Building:
Footprint: xx
Dimensions: 2,1
RequiresPower:
CanPowerDown:
DisabledOverlay:
Health:
HP: 400
Armor:
Type: Heavy
RevealsShroud:
Range: 5c0
Bib:
HasMinibib: Yes
Turreted:
TurnSpeed: 30
InitialFacing: 0
-WithSpriteBody:
WithTurretedSpriteBody:
Armament:
Weapon: Nike
MuzzleSequence: muzzle
AttackTurreted:
WithMuzzleOverlay:
RenderRangeCircle:
RangeCircleType: aa
Power:
Amount: -40
DetectCloaked:
Range: 5c0
BodyOrientation:
UseClassicFacingFudge: True

SAM.Cuba:
Inherits: SAM
Buildable:
Queue: Defense
BuildPaletteOrder: 100
Prerequisites: dome, ~structures.cuba, ~techlevel.medium
Valued:
Cost: 750
Tooltip:
Name: Cuban SAM Site
Description: Slightly more powerful than normal SAM sites. \nRequires power to operate.\nCan detect cloaked units.\n Strong vs Aircraft\n Weak vs Ground units
Building:
Footprint: xx
Dimensions: 2,1
RequiresPower:
CanPowerDown:
DisabledOverlay:
Health:
HP: 400
Armor:
Type: Heavy
RevealsShroud:
Range: 5c0
Bib:
HasMinibib: Yes
Turreted:
TurnSpeed: 30
InitialFacing: 0
WithTurretedSpriteBody:
Armament:
Weapon: NikeCuba
MuzzleSequence: muzzle
AttackTurreted:
WithMuzzleOverlay:
RenderRangeCircle:
RangeCircleType: aa
Power:
Amount: -40
DetectCloaked:
Range: 5c0
BodyOrientation:
UseClassicFacingFudge: True
RenderSprites:
Image: SAM
However, not only can I not remove SAM.cuba and ~!structures.cuba (it results in an exception), it seems that any tampering of this file at all generates the exception too.

The exception is listed here:

Code: Select all

Red Alert- World at War Mod at Version V1.1
Operating System: Windows (Microsoft Windows NT 6.2.9200.0)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.AggregateException`: One or more errors occurred.
Inner Exception of type `OpenRA.YamlException`: <no filename available>:1676:[highlight=red] Parent type `^Building` was already inherited by this yaml tree at <no filename available>:1490 (note: may be from a derived tree)[/highlight]
     at OpenRA.MiniYaml.ResolveInherits(String key, MiniYaml node, Dictionary`2 tree, Dictionary`2 inherited)
   at OpenRA.MiniYaml.Merge(IEnumerable`1 sources)
   at OpenRA.MiniYaml.Load(IReadOnlyFileSystem fileSystem, IEnumerable`1 files, MiniYaml mapRules)
   at OpenRA.Ruleset.MergeOrDefault[T](String name, IReadOnlyFileSystem fileSystem, IEnumerable`1 files, MiniYaml additional, IReadOnlyDictionary`2 defaults, Func`2 makeObject)
   at OpenRA.Ruleset.<LoadDefaults>c__AnonStorey0.<>m__0()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at OpenRA.Ruleset.LoadDefaults(ModData modData)
   at OpenRA.ModData.<ModData>m__2()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at OpenRA.ModData.get_DefaultRules()
   at OpenRA.Ruleset.LoadDefaultsForTileSet(ModData modData, String tileSet)
   at OpenRA.Map.PostInit()
   at OpenRA.Map..ctor(ModData modData, IReadOnlyPackage package)
   at OpenRA.ModData.PrepareMap(String uid)
   at OpenRA.Game.StartGame(String mapUID, WorldType type)
   at OpenRA.Game.LoadShellMap()
   at OpenRA.Mods.Common.LoadScreens.BlankLoadScreen.StartGame(Arguments args)
   at OpenRA.Game.InitializeMod(String mod, Arguments args)
   at OpenRA.Game.Initialize(Arguments args)
   at OpenRA.Program.Run(String[] args)
   at OpenRA.Program.Main(String[] args)
Has anyone been in this situation before? I'm afraid to even modify any particular numbers now that this error started popping up.

Any help is appreciated!
User avatar
Blackened
Posts: 353
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Shouldn't Cuba Sam inherit defense not sam? Inheriting SAM would duplicate everything.
sajwang
Posts: 11
Joined: Fri Jul 10, 2015 1:20 am

Post by sajwang »

Well the spy and its British counterpart use this same pattern. It works as is. The only problem is altering and deleting this pattern, and it seems to be a problem when I touch the rest of the file as well.
Post Reply