Custom Palette

Information and discussion for custom maps and mods.
Post Reply
User avatar
Chronosfera
Posts: 2
Joined: Thu Aug 29, 2002 4:42 am

Custom Palette

Post by Chronosfera »

Hi all, I just returned to the community after having modded RA2 a while back and was looking at how to mod OpenRA. I have a question I wonder if anyone could help answer regarding putting in a custom unit with a custom palette.

I have this shp from an RA2 mod I was working on that I was trying to insert, and I think it inserted fine except that the palette was different. So I wanted to specify in vehicles.yaml for the unit graphics to use a custom palette we made the shp with (gdi.pal) and I put in the code:

Code: Select all

	RenderUnit:
	    Palette: gdi
And then not knowing any better I just put in the following in world.yaml

Code: Select all

	PaletteFromFile@gdit:
		Name: gdi
		Filename: gdi.pal
		ShadowIndex: 4
And the game crashed at launch with this exception:

Code: Select all

Exception of type `OpenRA.YamlException`: Bad indent in miniyaml at mods/ar3/rules/vehicles.yaml:101
  at OpenRA.MiniYaml.FromLines &#40;System.String&#91;&#93; lines, System.String filename&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.MiniYaml.FromFile &#40;System.String path&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.RulesetCache.<LoadYamlRules`1>m__A3&#91;ActorInfo&#93; &#40;System.String s&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2&#91;System.String,System.Collections.Generic.List`1&#91;OpenRA.MiniYamlNode&#93;&#93;.MoveNext &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at System.Linq.Enumerable.Aggregate&#91;List`1,List`1&#93; &#40;IEnumerable`1 source, System.Collections.Generic.List`1 seed, System.Func`3 func&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.RulesetCache.LoadYamlRules&#91;ActorInfo&#93; &#40;System.Collections.Generic.Dictionary`2 itemCache, System.String&#91;&#93; files, System.Collections.Generic.List`1 nodes, System.Func`3 f&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.RulesetCache.LoadMapRules &#40;OpenRA.Map map&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.Map.<PostInit>m__19A &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at System.Lazy`1&#91;OpenRA.Ruleset&#93;.InitValue &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
 
My question is: is this a scripting problem and whether there are additional strings I should have specified in the yaml files, or is there something wrong with my files:

e.g., are RA2 shp not supported? (I did manage to unwrap the shp into pngs with gdi.pal using OpenRA.Utility and re-made the shp in the program).
Or, are RA2 pal different from RA1 pal, and whether there is a specific place I must put the .pal file (I put it in the bits folder)?

Thanks!

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

The first line of the exception message tells you what went wrong:

Code: Select all

Bad indent in miniyaml at mods/ar3/rules/vehicles.yaml&#58;101 
Your text editor will have replaced the tab indentation with spaces, which is an invalid thing to do. The indentation is not just cosmetic - it tells the game whether a given line defines an actor, a trait, or a trait property.

OpenRA supports the RA2 shp, palette, and voxel formats. Here's a screenshot from a test I did early last year:

Image

User avatar
Chronosfera
Posts: 2
Joined: Thu Aug 29, 2002 4:42 am

Post by Chronosfera »

Thanks, that fixed the problem.

PS, is there any way to get the OpenRA.Utility functions working on OS X?

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Open a terminal in the OpenRA directory and type

Code: Select all

mono --debug OpenRA.Utility.exe

Post Reply