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`&#58; <no filename available>&#58;1676&#58;&#91;highlight=red&#93; Parent type `^Building` was already inherited by this yaml tree at <no filename available>&#58;1490 &#40;note&#58; may be from a derived tree&#41;&#91;/highlight&#93;
     at OpenRA.MiniYaml.ResolveInherits&#40;String key, MiniYaml node, Dictionary`2 tree, Dictionary`2 inherited&#41;
   at OpenRA.MiniYaml.Merge&#40;IEnumerable`1 sources&#41;
   at OpenRA.MiniYaml.Load&#40;IReadOnlyFileSystem fileSystem, IEnumerable`1 files, MiniYaml mapRules&#41;
   at OpenRA.Ruleset.MergeOrDefault&#91;T&#93;&#40;String name, IReadOnlyFileSystem fileSystem, IEnumerable`1 files, MiniYaml additional, IReadOnlyDictionary`2 defaults, Func`2 makeObject&#41;
   at OpenRA.Ruleset.<LoadDefaults>c__AnonStorey0.<>m__0&#40;&#41;
   at System.Threading.Tasks.Task.InnerInvoke&#40;&#41;
   at System.Threading.Tasks.Task.Execute&#40;&#41;
   at System.Threading.Tasks.Task.ThrowIfExceptional&#40;Boolean includeTaskCanceledExceptions&#41;
   at System.Threading.Tasks.Task.Wait&#40;Int32 millisecondsTimeout, CancellationToken cancellationToken&#41;
   at OpenRA.Ruleset.LoadDefaults&#40;ModData modData&#41;
   at OpenRA.ModData.<ModData>m__2&#40;&#41;
   at System.Lazy`1.CreateValue&#40;&#41;
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw&#40;&#41;
   at System.Lazy`1.get_Value&#40;&#41;
   at OpenRA.ModData.get_DefaultRules&#40;&#41;
   at OpenRA.Ruleset.LoadDefaultsForTileSet&#40;ModData modData, String tileSet&#41;
   at OpenRA.Map.PostInit&#40;&#41;
   at OpenRA.Map..ctor&#40;ModData modData, IReadOnlyPackage package&#41;
   at OpenRA.ModData.PrepareMap&#40;String uid&#41;
   at OpenRA.Game.StartGame&#40;String mapUID, WorldType type&#41;
   at OpenRA.Game.LoadShellMap&#40;&#41;
   at OpenRA.Mods.Common.LoadScreens.BlankLoadScreen.StartGame&#40;Arguments args&#41;
   at OpenRA.Game.InitializeMod&#40;String mod, Arguments args&#41;
   at OpenRA.Game.Initialize&#40;Arguments args&#41;
   at OpenRA.Program.Run&#40;String&#91;&#93; args&#41;
   at OpenRA.Program.Main&#40;String&#91;&#93; args&#41;
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