Tutorial: Add a building and a unit

I'm an idiot and I need a step by step guide as introduction

Information and discussion for custom maps and mods.
Post Reply
ApornasPlanet
Posts: 24
Joined: Mon Sep 28, 2015 12:16 pm

Tutorial: Add a building and a unit

Post by ApornasPlanet »

I really wanna learn how to mod but I'm an idiot. So I need a thorough step-by-step walkthrough on how to add for example a building and/or a unit.

I thought that adding a soviet airfield to GDI and then add the soviet Mig could serve as a random example. How would I accomplish that?

Are there someone who could take the time to write a step-by-step tutorial? I think I would learn a lot by it and then be able to do stuff by myself.

User avatar
Inq
Posts: 95
Joined: Sun Sep 27, 2015 2:48 am

Re: Tutorial: Add a building and a unit

Post by Inq »

ApornasPlanet wrote: I really wanna learn how to mod but I'm an idiot. So I need a thorough step-by-step walkthrough on how to add for example a building and/or a unit.

I thought that adding a soviet airfield to GDI and then add the soviet Mig could serve as a random example. How would I accomplish that?

Are there someone who could take the time to write a step-by-step tutorial? I think I would learn a lot by it and then be able to do stuff by myself.
Check out https://github.com/OpenRA/OpenRA/wiki/C ... a-new-unit

A little out of date but the principles are the same.

User avatar
Norman_
Posts: 141
Joined: Wed Jan 30, 2013 1:39 pm
Location: TD Server

Post by Norman_ »

heres a code for the ra airfield in td and a nice interceptor unit. just add the weapon(s) to the SFIG: unit and it should work. check the weapons and rules folder. you could copy and edit the Maverick: from ra and add it to Weapons: and use it or create a new weapon for it.
also check other modmaps rules to see how some stuff works.

http://pastebin.com/WfaSnymX

( small fault: you have to use RenderSprites: instead of RenderUnit: )
Attachments
shps.zip
(16.35 KiB) Downloaded 300 times
Last edited by Norman_ on Sat Oct 03, 2015 9:21 pm, edited 1 time in total.

ApornasPlanet
Posts: 24
Joined: Mon Sep 28, 2015 12:16 pm

Post by ApornasPlanet »

Thanks!

However I decided to start with something more simple before I continue with the airfield. At least I thought so.

I tried to add a sniper unit to nod. But I can't get it to work.

How many documents do I have to edit? I have added it in 1) rules/infantry and 2) sequences/infantry. Is that enough?

But I'm also unsure of a lot. I don't know what most things mean. What is "BuildPaletteOrder" for example?

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

Depending on your version, you can use https://github.com/OpenRA/OpenRA/wiki/Traits for releases and https://github.com/OpenRA/OpenRA/wiki/T ... laytest%29 for playtests - just Ctrl-F on the trait you're looking for.

Keep in mind that this only applies to rules, the rest doesn't get such outputs although at sequences and weapons the results are straightforward enough imo.

What you did might be enough, but to tell more we need to see what you actually did.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

ApornasPlanet
Posts: 24
Joined: Mon Sep 28, 2015 12:16 pm

Post by ApornasPlanet »

Norman_ wrote: heres a code for the ra airfield in td and a nice interceptor unit. just add the weapon(s) to the SFIG: unit and it should work. check the weapons and rules folder. you could copy and edit the Maverick: from ra and add it to Weapons: and use it or create a new weapon for it.
also check other modmaps rules to see how some stuff works.

http://pastebin.com/WfaSnymX

( small fault: you have to use RenderSprites: instead of RenderUnit: and RenderBuilding: )
I did all this and added OrcaAGMissiles as both primary and secondary weapon to the SFIG but it doesn't seem to work. The new airfield doesn't show up in the buildings menu and not the SFIG either. Any ideas why?

I unpacked the shp:s into the "bits"-folder.

ApornasPlanet
Posts: 24
Joined: Mon Sep 28, 2015 12:16 pm

Post by ApornasPlanet »

Graion Dilach wrote: Depending on your version, you can use https://github.com/OpenRA/OpenRA/wiki/Traits for releases and https://github.com/OpenRA/OpenRA/wiki/T ... laytest%29 for playtests - just Ctrl-F on the trait you're looking for.

Keep in mind that this only applies to rules, the rest doesn't get such outputs although at sequences and weapons the results are straightforward enough imo.

What you did might be enough, but to tell more we need to see what you actually did.
I use the latest release.

First I copied the entire cnc-folder but renamed it cnce. So that I got a fourth mod folder. I dont wanna mess up the original TD-mod.

Then I just went into the rules folder, opened the infantry yaml-file and made a copy of RMBO but renamed it E7. Then I changed some of the stats like:

Name: Sniper
Prerequisites: anyhq, ~techlevel.medium
Queue: Infantry.Nod

Then I went into the sequences-folder, opened the infantry yaml-file and added the new E7-unit.

That's pretty much what I did but that didn't change anything.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

Ofcourse it didn't. When you duplicated the folder, you didn't set the mod to read your duplicated folder. Check out mod.yaml in your mod's main folder.

You don't really need to duplicate the whole thing in that case anyway, a mod can be done via linking every asset of another mod and just have a bunch of yamls itself which are only your additions.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

ApornasPlanet
Posts: 24
Joined: Mon Sep 28, 2015 12:16 pm

Post by ApornasPlanet »

Graion Dilach wrote: Ofcourse it didn't. When you duplicated the folder, you didn't set the mod to read your duplicated folder. Check out mod.yaml in your mod's main folder.

You don't really need to duplicate the whole thing in that case anyway, a mod can be done via linking every asset of another mod and just have a bunch of yamls itself which are only your additions.
Yeah I just realized! How stupid!

If I decide to copy the whole thing would it be sufficent to replace all occurences of "cnc" with "cnce" in the mod.yaml?

In some cases like this one:

Folders:
.
./mods/cnc
./mods/cnc/bits
./mods/cnc/bits/jungle
./mods/cnc/bits/ss
./mods/cnc/uibits
~^Content/cnc

Would it be sufficent to do like this:

Folders:
.
./mods/cnce
./mods/cnce/bits
./mods/cnce/bits/jungle
./mods/cnce/bits/ss
./mods/cnce/uibits
~^Content/cnce

And even that last one?

abcdefg30
Posts: 643
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

That should work, but you'll probably need to download the assets again (with the ingame dialogue), as there are no assets in ~^Content/cnce for obvious reasons.

Post Reply