Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: Map contains invalid custom rules." hides the linter error #14030

Closed
Mailaender opened this issue Sep 16, 2017 · 5 comments
Closed

"Error: Map contains invalid custom rules." hides the linter error #14030

Mailaender opened this issue Sep 16, 2017 · 5 comments
Assignees

Comments

@Mailaender
Copy link
Member

It only says OpenRA.Utility(1,1): Error: Map contains invalid custom rules. instead of pointing to what actually failed. I first really noticed it during #13934, where Monster Tank Madness just gave this not helpful at all error, because a required field (IntoActor) wasn't set for 5tnk.husk. I believe it is also one of the reasons for bad performance of the lint checks. The ones during ruleset loading are at least conflicting and probably even duplicating the effort making it way too expensive.

@WsevoL0D
Copy link

WsevoL0D commented Oct 22, 2017

I get this error even if I have incorrect syntax in my yaml files.
Is this due to regression?
I don't know how it was working earlier, but I expected Utility to return error details (e.g. row, column).

@Mailaender
Copy link
Member Author

I get this error even if I have incorrect syntax in my yaml files.

Can you upload your files?

@WsevoL0D
Copy link

WsevoL0D commented Oct 23, 2017

Not sure if other files are relevant, this is settings.yaml. In map.yaml I've got:

...
Rules: rules/settings.yaml

If I have extra/no tab or unwanted spaces in this file(for instance no tab before "Name" property of the pallete).

World:
	WeatherOverlay:
		ChangingWindLevel: true
		WindLevels: -2, 0, 2#-7, -5, 5, 7
		WindTick: 150, 550
		InstantWindChanges: false
		UseSquares: true
		ScatterDirection: 0, 0
		ParticleSize: 0, 1
		Gravity: 1.00, 1.00
		SwingOffset: 1, 1.001
		SwingSpeed: 0.001, 0.0015
		SwingAmplitude: 1, 1.015
		ParticleColors: D5C200, D5A100, D87F00, C6B700
	GlobalLightingPaletteEffect:
		ExcludePalettes: cursor, chrome, colorpicker, fog, shroud, alpha
		Red: 1.05
		Green: 1.05
		Blue: 1
		Ambient: 1.15

^Palettes:
	PaletteFromFile@ra_units:
		Name: ra_units
		Filename: ratemp.pal
		ShadowIndex: 4
		RemapIndex: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95

then I get the many messages like:
OpenRA.Utility(1,1): Error: Actor <custom_actor> is not defined by any rule.
followed by the above-mentioned message.

Maybe I'm not getting the point of this thread, but I thought it should throw error on incorrect syntax and stop further map check.

Also I found that if I'm trying to pass anything but absolute path(all possible relative paths) to map as a parameter for --check-yaml I get this:

OpenRA.Utility(1,1): Error: Failed with exception: System.NullReferenceException: Object reference not set to an instance of an object
  at OpenRA.Map..ctor (OpenRA.ModData modData, OpenRA.FileSystem.IReadOnlyPackage package) [0x00053] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Mods.Common.UtilityCommands.CheckYaml.OpenRA.IUtilityCommand.Run (OpenRA.Utility utility, System.String[] args) [0x00216] in <3deaf9d94b2f400b8afbb2c9cedb1118>:0 

@abcdefg30
Copy link
Member

When you start the game and try to select your map, it says "Not compatible with this version of OpenRA", right? If it does that you could look into debug.log and see if it gave a different error there.

@WsevoL0D
Copy link

WsevoL0D commented Oct 23, 2017

No, it just crashes and gives me option to view logs, and there is the same message in logs as I saw during the map check, at least part of it:

OpenRA engine version release-20171014
Tiberian Dawn mod version release-20171014
on map 4822944615dd8e05e19c0e084f24d4ba67e42158 (canyon_playtest by Jay).
Date: 2017-10-23 20:04:26Z
Operating System: OSX (Unix 15.6.0.0)
Runtime Version: Mono 4.6.0 (mono-4.6.0-branch/746756c) CLR 4.0.30319.42000
Exception of type `System.IO.InvalidDataException`: Actor Actor69 of unknown type
  at OpenRA.Mods.Common.Traits.EditorActorPreview..ctor (OpenRA.Graphics.WorldRenderer worldRenderer, System.String id, OpenRA.ActorReference actor, OpenRA.PlayerReference owner) [0x0033c] in /home/travis/build/OpenRA/OpenRA/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs:93 
  at OpenRA.Mods.Common.Traits.EditorActorLayer.Add (System.String id, OpenRA.ActorReference reference, System.Boolean initialSetup) [0x0002b] in /home/travis/build/OpenRA/OpenRA/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs:107 
  at OpenRA.Mods.Common.Traits.EditorActorLayer.WorldLoaded (OpenRA.World world, OpenRA.Graphics.WorldRenderer wr) [0x0011b] in /home/travis/build/OpenRA/OpenRA/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs:75 
  at OpenRA.World.LoadComplete (OpenRA.Graphics.WorldRenderer wr) [0x00080] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Game.StartGame (System.String mapUID, OpenRA.WorldType type) [0x000be] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Game.LoadEditor (System.String mapUid) [0x00001] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Mods.Common.Widgets.Logic.MainMenuLogic+<LoadMapIntoEditor>c__AnonStorey3.<>m__0 () [0x00001] in /home/travis/build/OpenRA/OpenRA/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs:331 
  at OpenRA.Mods.Common.Widgets.Logic.ConnectionLogic.ConnectionStateChanged (OpenRA.Network.OrderManager om) [0x0001f] in /home/travis/build/OpenRA/OpenRA/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs:29 
  at (wrapper delegate-invoke) System.Action`1[OpenRA.Network.OrderManager]:invoke_void_T (OpenRA.Network.OrderManager)
  at OpenRA.Game.LogicTick () [0x00040] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Game.Loop () [0x000d6] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Game.Run () [0x00042] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Program.Run (System.String[] args) [0x00011] in <adccc5d07c144774863d73ace7658d93>:0 
  at OpenRA.Program.Main (System.String[] args) [0x0004f] in <adccc5d07c144774863d73ace7658d93>:0 

this part is not most useful IMO as not found actors are just consequence of syntax error.

I must add that this happens when I'm trying to open map in editor. If I load it in game the Start game button is greyed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants