Page 1 of 1

Adding New Infantry Crashes The Game

Posted: Tue Jun 28, 2011 4:50 pm
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.

Posted: Tue Jun 28, 2011 5:38 pm
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

Posted: Wed Jun 29, 2011 8:32 am
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.

Posted: Wed Jun 29, 2011 10:10 am
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

Posted: Wed Jun 29, 2011 4:41 pm
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.

Posted: Wed Jun 29, 2011 9:13 pm
by Sleipnir
Yes; add the Image: property to RenderUnit/RenderUnitTurreted/RenderBuilding/etc.