Adding new structures possible?

Just causes OpenRA to crash on launch...

Information and discussion for custom maps and mods.
Post Reply
User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Adding new structures possible?

Post by BaronOfStuff »

I thought this would have been as simple as adding vehicles, but apparently not.

I can't figure out what I've got wrong; I tried adding a simple Ore Silo-type structure that would also act as a cashtrickler, but I can't even reach the shellmap before ORA stops working. I've placed the relevant SHP files in the 'bits' subfolder (prfr, prfrmake, prfricon), so it's more than likely some text-based shenanigans going on.

Here are my defs, with the SHP files as an attachment:

Sequences:

Code: Select all

prfr:
	idle:
		Start: 0
		Length: 5
	damaged-idle:
		Start: 5
		Length: 5
	make: prfrmake
		Start: 0
		Length: *
Structures:

Code: Select all

PRFR:
	Inherits: ^Building
	Buildable:
		Queue: Building
		BuildPaletteOrder: 50
		Prerequisites: proc,dome
		Owner: allies,soviet
	Valued:
		Cost: 450
	Tooltip:
		Name: Ore Purifier
		Description: Holds and further refines mined\n ore, increasing its value.
	Building:
		Power: -25
		BaseNormal: no
	Health:
		HP: 450
	Armor:
		Type: Wood
	RevealsShroud:
		Range: 4
	RenderBuildingOre:
	CashTrickler:
		Amount: 35
	Building:
		Footprint: x
		Dimensions: 1,1
	StoresOre:
		PipCount: 5
		Capacity: 1500
	IronCurtainable:
	-RenderBuilding:
	-EmitInfantryOnSell:
Have I overlooked something completely in another .yaml altogether, or is the problem is staring me in the face?
Attachments
Purifier.zip
(5.03 KiB) Downloaded 408 times

User avatar
hamb
Posts: 112
Joined: Mon Oct 18, 2010 4:57 pm

Post by hamb »

If the game ever crashes, exception.log (Windows: You\Documents\OpenRA\logs) reveals some pretty good information

Trying your yaml & crashing the game, I got this in my exception.log: System.IO.InvalidDataException: Duplicate key `Building' in MiniYaml

This means you have the Building: trait showing up twice in your definition for PRFR. Here's the changes. If you have the proper SHPs like prfricon, etc. this will work

Code: Select all

PRFR:
	Inherits: ^Building
	Buildable:
		Queue: Building
		BuildPaletteOrder: 50
		Prerequisites: proc,dome
		Owner: allies,soviet
	Valued:
		Cost: 450
	Tooltip:
		Name: Ore Purifier
		Description: Holds and further refines mined\n ore, increasing its value.
	Building:
		Power: -25
		BaseNormal: no
		Footprint: x
		Dimensions: 1,1
	Health:
		HP: 450
	Armor:
		Type: Wood
	RevealsShroud:
		Range: 4
	RenderBuildingOre:
	CashTrickler:
		Amount: 35
	StoresOre:
		PipCount: 5
		Capacity: 1500
	IronCurtainable:
	-RenderBuilding:
	-EmitInfantryOnSell: 

User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Post by BaronOfStuff »

Oh wow, now I feel stupid for missing that. Thanks!

Edit: Derp. Now I feel even more of an idiot, I was hammering the spacebar instead of using tab for indents... still, it's working now.

Post Reply