Unable to add new unit shp

Information and discussion for custom maps and mods.
Post Reply
zeroth
Posts: 9
Joined: Wed Nov 28, 2018 3:45 am

Unable to add new unit shp

Post by zeroth »

Hi guys, I am new to modding and this forum so any assistance is appreciated.

I am trying to add a new unit to my TD Openra mod. I have the hmlrs.shp, hmlrsicnh.shp and hmlrst.shp files of the hover mlrs in my bit folder.

I have added the sequence in the vehicle sequence folder:

Code: Select all

hmlrs:
	idle:
		Facings: 32
		UseClassicFacingFudge: True
	turret: hmlrst
		Facings: 32
		UseClassicFacingFudge: True
	icon: hmlrsicnh
	
hmlrs.destroyed:
	idle: hmlrs
		Facings: 32
		UseClassicFacingFudge: True
		ZOffset: -512
	turret: hmlrst
		Facings: 32
		UseClassicFacingFudge: True
		ZOffset: -512
Then I've added the following into the vehicles rules folder:

Code: Select all

HMLRS:
	Inherits: ^Tank
	Inherits@EXPERIENCE: ^GainsExperience
	Inherits@CLOAK: ^AcceptsCloakCrate
	Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove
	Valued:
		Cost: 1600
	RenderSprites:
		Image: HMLRS
	Tooltip:
		Name: Hover MLRS
	Buildable:
		BuildPaletteOrder: 130
		Prerequisites: anyhq, ~techlevel.medium
		Queue: Vehicle.GDI
		Description: Prototype Hover Multiple Launch Rocket System.\nLong-range guided artillery.\n  Strong vs Infantry, Vehicles and Buildings
	Mobile:
		Speed: 160
	Health:
		HP: 120000
	Armor:
		Type: Heavy
	RevealsShroud:
		Range: 5c0
	Turreted:
		TurnSpeed: 10
		Offset: -200,0,0
	Hovers:
		OffsetModifier: 35
	WithShadow:
		Offset: 43, 128, 0
		ZOffset: -129
	Armament@PRIMARY:
		Weapon: MammothMissiles
		LocalOffset: 213,128,0, 213,-128,0
		LocalYaw: 100, -100
		PauseOnCondition: disabled
	AttackTurreted:
		PauseOnCondition: disabled
	WithSpriteTurret:
When trying to launch the game, i get the following error:
OpenRA engine version release-20180923
Tiberian Dawn mod version release-20180923
on map cda847dca0c3256cb7d78e42fe0e4226d49b470a (Blank Shellmap by Paul Chote).
Date: 2018-11-28 03:40:18Z
Operating System: Windows (Microsoft Windows NT 6.2.9200.0)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.IO.InvalidDataException`: Resource sprites span multiple sheets. Try loading their sequences earlier.
at OpenRA.Mods.Common.Traits.ResourceLayer.WorldLoaded(World w, WorldRenderer wr)
at OpenRA.World.LoadComplete(WorldRenderer wr)
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.Game.InitializeAndRun(String[] args)
at OpenRA.WindowsLauncher.RunGame(String[] args)
I am running the latest release.

The odd thing was, this was working prior to the new update. I can't figure out what I've missed as I can't seem to add any new .shp as new units.

Please help! Thanks!

User avatar
MustaphaTR
Posts: 203
Joined: Mon Aug 04, 2014 6:38 am
Location: Kastamonu, Turkey

Re: Unable to add new unit shp

Post by MustaphaTR »

The reasource images should be in the first image sheet, in other words, they should be defined as early in the code as possible. Go to sequences/misc.yaml and move the resources: part to the beginning of the file.

zeroth
Posts: 9
Joined: Wed Nov 28, 2018 3:45 am

Re: Unable to add new unit shp

Post by zeroth »

I don't really understand the reason but your advice works! thanks MustaphaTR!

Post Reply