Defining Correct Prerequisites

kaneCVR edited this page Dec 26, 2014 · 13 revisions
Clone this wiki locally

Defining Correct Prerequisites

It may happen that while modding, you give the ability for one team to make the units for another team. For example, Allies do not have an airfield, but you want to give them an airfield. When you do that, the Allies will get possibility of making the Yak aircraft. What if you do not want the Allies to make the Yak aircraft? How will you go about doing this?

The way you do this is to tell the building, which is airfield in this case, to provide custom prerequisites.

To do that, first of all go into the "rules" folder and open structures.yaml

Search for the War factory entry which should be WEAP in this case.

In this entry search for the following code and copy it

        Race: soviet
        Prerequisite: vehicles.soviet

Now search for the airfield, which should be AFLD and paste this code in there. Change vehicles.soviet to aircrafts.soviet

        Race: soviet
        Prerequisite: aircrafts.soviet

Now, open the aircrafts.yaml and find the YAK entry. Its prerequisites might say this:

Prerequisites: afld, ~techlevel.medium

change that to

Prerequisites: afld, ~techlevel.medium, ~aircrafts.soviet

and save

Now the Yak aircraft should only appear for the soviets.

  • made by Umair Azfar Khan