How to add a new Country/Side to OpenRa

quick tutorial

Information and discussion for custom maps and mods.
Post Reply
raminator
Posts: 106
Joined: Tue Mar 15, 2005 6:31 pm
Location: Stuttgart

How to add a new Country/Side to OpenRa

Post by raminator »

For this lil Test i simply made a copy of the "cnc" folder (found at "OpenRA\mods\") and named this copy "cncx". There´s another way, but i´ll explain it like this coz it is easier to understand for the beginning ;).

The new Country will be a copy of Nod called POD and use GDI-UI.

don´t just copy and paste the code i show you here :P. i use quote instead of code coz i can highlight stuff this way...

01) First thing to do is editing the mod.yaml.
In this case i just changed every "mods/cnc" to "mods/cncx".
I left

Code: Select all

Assemblies:
	mods/ra/OpenRA.Mods.RA.dll
	mods/cnc/OpenRA.Mods.Cnc.dll
as it is.
Save your file.

02) Next thing i usually do is editing chrome.xml (found at "OpenRA\mods\cncx\")
In this case you just copy the GDI-Entries and place them under the Nod-Entries.
It would look something like this. Dots are here only for saving space :P
<chrome>
<collection name="chrome-gdi" src="chrome-gdi.png">
<image name="specialbin-top" x="0" y="0" width="30" height="51" />
<image name="specialbin-middle" x="0" y="51" width="30" height="51" />
<image name="specialbin-bottom" x="0" y="153" width="30" height="39" />
<image name="moneybin" x="192" y="0" width="320" height="32" />
<image name="tooltip-bg" x="0" y="288" width="272" height="136" />
</collection>
..........
<collection name="digits-nod" src="chrome-nod.png">
<image name="0" x="32" y="0" width="13" height="17" />
<image name="1" x="45" y="0" width="13" height="17" />
<image name="2" x="58" y="0" width="13" height="17" />
<image name="3" x="71" y="0" width="13" height="17" />
<image name="4" x="84" y="0" width="13" height="17" />
<image name="5" x="97" y="0" width="13" height="17" />
<image name="6" x="110" y="0" width="13" height="17" />
<image name="7" x="123" y="0" width="13" height="17" />
<image name="8" x="136" y="0" width="13" height="17" />
<image name="9" x="149" y="0" width="13" height="17" />
</collection>
<collection name="chrome-pod" src="chrome-gdi.png">
<image name="specialbin-top" x="0" y="0" width="30" height="51" />
<image name="specialbin-middle" x="0" y="51" width="30" height="51" />
<image name="specialbin-bottom" x="0" y="153" width="30" height="39" />
<image name="moneybin" x="192" y="0" width="320" height="32" />
<image name="tooltip-bg" x="0" y="288" width="272" height="136" />
</collection>
<collection name="radar-pod" src="chrome-gdi.png">
<image name="left" x="297" y="31" width="9" height="192" />
<image name="right" x="498" y="31" width="9" height="192" />
<image name="bottom" x="297" y="223" width="210" height="30" />
<image name="bg" x="306" y="31" width="192" height="192" />
<image name="power-indicator" x="187" y="4" width="4" height="7" />
</collection>
<collection name="power-pod" src="chrome-gdi.png">
<image name="power-indicator" x="187" y="4" width="4" height="7" />
</collection>
<collection name="palette-pod" src="chrome-gdi.png">
<image name="top" x="297" y="288" width="201" height="9" />
<image name="dock-top" x="498" y="274" width="14" height="23" />
<image name="bottom" x="297" y="489" width="201" height="9" />
<image name="dock-bottom" x="498" y="489" width="14" height="23" />
<image name="bg-0" x="297" y="297" width="201" height="48" />
<image name="dock-0" x="498" y="297" width="14" height="48" />
<image name="bg-1" x="297" y="345" width="201" height="48" />
<image name="dock-1" x="498" y="345" width="14" height="48" />
<image name="bg-2" x="297" y="393" width="201" height="48" />
<image name="dock-2" x="498" y="393" width="14" height="48" />
<image name="bg-3" x="297" y="441" width="201" height="48" />
<image name="dock-3" x="498" y="441" width="14" height="48" />
</collection>
<collection name="digits-pod" src="chrome-gdi.png">
<image name="0" x="32" y="0" width="13" height="17" />
<image name="1" x="45" y="0" width="13" height="17" />
<image name="2" x="58" y="0" width="13" height="17" />
<image name="3" x="71" y="0" width="13" height="17" />
<image name="4" x="84" y="0" width="13" height="17" />
<image name="5" x="97" y="0" width="13" height="17" />
<image name="6" x="110" y="0" width="13" height="17" />
<image name="7" x="123" y="0" width="13" height="17" />
<image name="8" x="136" y="0" width="13" height="17" />
<image name="9" x="149" y="0" width="13" height="17" />
</collection>

<collection name="tabs-selected" src="tabs.png">
<image name="gdi-Building" x="0" y="0" width="27" height="41" />
<image name="gdi-Defense" x="0" y="40" width="27" height="41" />
<image name="gdi-Infantry" x="0" y="80" width="27" height="41" />
<image name="gdi-Vehicle" x="0" y="120" width="27" height="41" />
<image name="gdi-Plane" x="0" y="160" width="27" height="41" />
<image name="gdi-Ship" x="0" y="200" width="27" height="41" />
<image name="nod-Building" x="80" y="0" width="27" height="41" />
<image name="nod-Defense" x="80" y="40" width="27" height="41" />
<image name="nod-Infantry" x="80" y="80" width="27" height="41" />
<image name="nod-Vehicle" x="80" y="120" width="27" height="41" />
<image name="nod-Plane" x="80" y="160" width="27" height="41" />
<image name="nod-Ship" x="80" y="200" width="27" height="41" />
<image name="pod-Building" x="0" y="0" width="27" height="41" />
<image name="pod-Defense" x="0" y="40" width="27" height="41" />
<image name="pod-Infantry" x="0" y="80" width="27" height="41" />
<image name="pod-Vehicle" x="0" y="120" width="27" height="41" />
<image name="pod-Plane" x="0" y="160" width="27" height="41" />
<image name="pod-Ship" x="0" y="200" width="27" height="41" />

</collection>
..........
<collection name="flags" src="buttons.png">
<image name="gdi" x="30" y="84" width="30" height="15" />
<image name="nod" x="0" y="84" width="30" height="15" />
<image name="pod" x="30" y="84" width="30" height="15" />
<image name="random" x="60" y="84" width="30" height="15" />
</collection>
..........
Of course you can have your own chrome-pod.png. copy and paste chrome-gdi.png and name it chrome-pod.png. now you just need to edit this to your likings, but this isn´t part of this tutorial.

03) Now open voices.yaml (found at "OpenRA\mods\cncx\").
and make it look like this:
GenericVoice:
Variants:
nod: .v01,.v03
gdi: .v01,.v03
pod: .v01,.v03
Voices:
Select: await1,ready,report1,yessir1
Move: ackno,affirm1,noprob,ritaway,roger,ugotit
Die: nuyell1,nuyell3,nuyell4,nuyell5
DisableVariants: Die

VehicleVoice:
Variants:
nod: .v00,.v02
gdi: .v00,.v02
pod: .v00,.v02
Voices:
Select: vehic1,yessir1,report1,await1,unit1
Move: ackno,affirm1,movout1

CivilianMaleVoice:
Voices:
Select: guyyeah1
Move: guyokay1
Die: nuyell1,nuyell3,nuyell4,nuyell5

CivilianFemaleVoice:
Voices:
Select: girlyeah
Move: girlokay
Die: nuyell1,nuyell3,nuyell4,nuyell5

CommandoVoice:
Voices:
Select: rokroll1,yeah1,yes1,yo1
Move: cmon1,onit1,gotit1
Attack: keepem1,laugh1,bombit1,lefty1
Die: ramyell1
Bold Text shows what i changed from the original file.

04) now we start editing the rules.
open system.yaml (found at "OpenRA\mods\cncx\rules\").
search for "Country@" and add entries for POD

..........
Country@gdi:
Name: GDI
Race: gdi
Country@nod:
Name: Nod
Race: nod
Country@pod:
Name: P.O.D.
Race: pod

...........
next file is defaults.yaml

..........
CaptureNotification@GDI:
Race: gdi
Notification: gdicapt1.aud
CaptureNotification@NOD:
Race: nod
Notification: nodcapt1.aud
CaptureNotification@POD:
Race: pod
Notification: gdicapt1.aud

..........
now we need some units and buildings.
open infantry.yaml, structures.yaml and vehicles.yaml.
now replace every "nod" with "nod,pod" using "ctrl+h" and save the files.
now POD is able to build everything Nod is able to.

now we just need a new shortcut to start this little biotch...
create an shortcut from OpenRA.Game.exe. now view the properties and add Game.Mods=cncx after \OpenRA\OpenRA.Game.exe.

now you are ready to go...

gamefreak11221
Posts: 12
Joined: Fri Apr 15, 2011 8:56 am

Post by gamefreak11221 »

This is a really good example of a Tutorial for Beginners whose trying to make their own Mod for OpenRA!

I still don't know the reason why no one is replying in this topic, this is good, really good! :lol:

raminator
Posts: 106
Joined: Tue Mar 15, 2005 6:31 pm
Location: Stuttgart

Post by raminator »

maybe no one besides me was testing 3rd sides or more countries :P

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

Post by Sleipnir »

The tutorial is a bit outdated now - the image mappings have changed from xml to yaml, but the same idea applies.

gamefreak11221
Posts: 12
Joined: Fri Apr 15, 2011 8:56 am

Post by gamefreak11221 »

And its still working, xml > yaml doesn't change the previous language used for the files ;)

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

Post by Petrenko »

Heyho,

would you mind if i add this awesome tutorial to the wiki somehow?

After i tried it out.^^
Hail to the soviets!

raminator
Posts: 106
Joined: Tue Mar 15, 2005 6:31 pm
Location: Stuttgart

Post by raminator »

do it :P

Post Reply