Adding New Infantry Crashes The Game

Information and discussion for custom maps and mods.
Post Reply
MalkSticks
Posts: 4
Joined: Mon May 02, 2011 5:51 pm

Adding New Infantry Crashes The Game

Post by MalkSticks »

Following a few of the tutorials here, I was successfully able to implement another side into the game (as of now a differently-named clone of the Allies), which went mostly without a hitch. However, trying to add a new unit for this new size ("new" meaning a slightly modified unit from the other sides) crashes the game upon loading a map [gets into the menu fine].

I created the unit by simply adding an entry to the infantry.yaml file, is there something I'm missing perhaps?

EDIT: I also tried copying the strings in sequence.yaml for the unit graphic I was using, E1 in this case, and renaming it accordingly, to no avail. In fact, that made the game crash upon execution...

Thanks in advance for any help I may recieve.

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Shalom,

you also need a shp file.

Use XCC-Mixer to get the shp of the original unit you copied. Afterwards, rename it and put it in this folder. => mods/cnc/bits

(you also need to copy and rename an icon (also from some .mix file in /documents/openra/content)

By example your original unit was E1 and you want E9 you should get E1.shp and E1icon.shp (or something similar) and rename it to E9.shp and E9icon.shp

Hope i was able to help.

Edit:

drop by at #openra to get help from people who really know what they are talking about (so not me, heh)

Edit 2:

This should help best
http://www.sleipnirstuff.com/forum/view ... 83&t=14951

MalkSticks
Posts: 4
Joined: Mon May 02, 2011 5:51 pm

Post by MalkSticks »

Ah, brilliant, didn't realize it was impossible to have two units use the same graphic.

I'll be sure to drop into the IRC next time something crops up, as well. Thanks.

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

Post by Sleipnir »

Sequences define the mapping between animation names used in the code and the shp files. OpenRA expects that each sequence definition corresponds to a shp with the same name. There is one exception: you can specify an alternate shp after the animation name (e.g. muzzle: minigun) but this should not be used for cloning sequences.

The correct method for using another actor's sequences is to override the Image property on the actor's Render* trait:

Code: Select all

e9: 
	... (other trait definitions) ...
	RenderInfantryProne:
		Image: e1

MalkSticks
Posts: 4
Joined: Mon May 02, 2011 5:51 pm

Post by MalkSticks »

Sleipnir wrote: Sequences define the mapping between animation names used in the code and the shp files. OpenRA expects that each sequence definition corresponds to a shp with the same name. There is one exception: you can specify an alternate shp after the animation name (e.g. muzzle: minigun) but this should not be used for cloning sequences.

The correct method for using another actor's sequences is to override the Image property on the actor's Render* trait:

Code: Select all

e9: 
	... (other trait definitions) ...
	RenderInfantryProne:
		Image: e1
Oh, thanks! That saves me a lot of trouble. Is there a way to do a similar thing for vehicles/aircraft and/or structures?
I know, I'm rather crap at this, but it's sort of... masochistically satisfying, so far.

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

Post by Sleipnir »

Yes; add the Image: property to RenderUnit/RenderUnitTurreted/RenderBuilding/etc.

Post Reply