Tech levels and Prerequisites
Clone this wiki locally
This is a guide that will show you what you can do with all the new changes made to the tech system in OpenRA.
First lets have a look at the feature that touches every last point in this guide. Prerequisites.
Prerequisites have existed for a while, they are added to actors and it makes you unable to make/build them unless you have fulfilled the prerequisite.
Prerequisites could be fulfilled in two ways:
- Using the name of another actor (in lowercase letters) as a prerequisite, that makes you unable to build your actor unless you already own the other actor.
- Use the
ProvidesCustomPrerequisite, this trait allows you to "provide" a prerequisite that other actors can require to be built.
This allows for a basic tiered system, have to build this before you can build this and so on.
Now lets get to the juicy part, the new stuff (more coming soon).
The first change is a new symbol (~) which has been added to the old one (!), the old one made it possible to disable something if you fulfilled the prerequisite. You could for example if you had !barracks on the refinery disable the ability to build a refinery as soon as you own a barracks.
The new symbol adds the ability to hide an actor from the build queue if you dont fulfill the prerequisite, so you dont see it grayed out anymore it has just disappeared, ~barracks if we want to hide something until we own a barracks.
These symbols also work together so you can hide an actor if a prerequisite is fulfilled, ~!barracks in the example above (beware it has to be in this order ~! otherwise you will get wierd stuff happening).
There has been added a new prerequisite provider named ProvidesTechPrerequisite.
You add it to the player actor and when you come into the lobby of a game you will see a new option under tech levels which allow you to select between different providers, this would allow you to make a only infantry tech level or anything you really want.
The only thing you would need to add an infantry only tech level is add this to the player.yaml
ProvidesTechPrerequisite: Name: Infantry Only Prerequisites: infonly
and add ~!infonly to everything you are not supposed to be able to build, this will disable and hide the actor that has it as long as you have infonly, and that will be provided by the Tech provider.
Inherits: ^Vehicle Buildable: Queue: Vehicle BuildPaletteOrder: 40 Prerequisites: dome, ~!infonly Owner: soviet Hotkey: v Valued: Cost: 900
There is a much better way to do this but this is basically how the provider works.