Grant multiple prerequisites?

Information and discussion for custom maps and mods.
Post Reply
thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Grant multiple prerequisites?

Post by thebestwes »

Is it possible to make a building provide multiple prerequisites? Specifically I'm trying to make it so that the construction yard grants a prerequisite to the GDI race and another to the Nod race, thereby allowing me to use the same HQ building to give different airstrikes to the two races. Is this possible, and if not is there a better way to do it?

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

Re: Grant multiple prerequisites?

Post by abcdefg30 »

thebestwes wrote: Is it possible to make a building provide multiple prerequisites?
You can use

Code: Select all

ProvidesPrerequisite@one:
    Prerequisite: one
ProvidesPrerequisite@two:
    Prerequisite: two
...
thebestwes wrote: Specifically I'm trying to make it so that the construction yard grants a prerequisite to the GDI race and another to the Nod race, thereby allowing me to use the same HQ building to give different airstrikes to the two races. Is this possible, and if not is there a better way to do it?
You can use the "Race: nod/gdi" property on ProvidesPrerequisite (see https://github.com/OpenRA/OpenRA/wiki/T ... erequisite).

thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Post by thebestwes »

Thanks! I did that and it works perfectly for the GDI. The airstrike ability just doesn't show up for Nod, though.

Here's what I'm working with:

Code: Select all

FACT:
[snip]
	ProvidesPrerequisite@buildingname:
	ProvidesPrerequisite@gdiair:
		Prerequisite: gdiair
		Race: gdi
	ProvidesPrerequisite@nodair:
		Prerequisite: nodair
		Race: nod

[...]

HQ:
[...]
	AirstrikePower@GDI:
		Prerequisites: gdiair, ~techlevel.superweapons
		Icon: airstrike
		ChargeTime: 5 [this is just for ease of testing]
		SquadSize: 3
		QuantizedFacings: 8
		Cordon: 900
		Description: Gun Run
		LongDesc: Deploy an A-10 squad.\nFires a GAU-8 minigun and\ndrops MK-83 bombs along a line.
		EndChargeSound: airredy1.aud
		SelectTargetSound: select1.aud
		InsufficientPowerSound: nopower1.aud
		IncomingSound: enemya.aud
		UnitType: a10
		DisplayBeacon: True
		BeaconPoster: airstrike
		BeaconPosterPalette: beaconposter
		DisplayRadarPing: True
		CameraActor: camera
	AirstrikePower@Nod:
		Prerequisites: nodair, ~techlevel.superweapons
		Icon: airstrike
		ChargeTime: 5
		SquadSize: 3
		QuantizedFacings: 8
		Cordon: 2560
		Description: Air Strike
		LongDesc: Deploy a group of B-52 bombers against hard or soft\ntargets.
		EndChargeSound: airredy1.aud
		SelectTargetSound: select1.aud
		InsufficientPowerSound: nopower1.aud
		IncomingSound: enemya.aud
		UnitType: b52
		DisplayBeacon: True
		BeaconPoster: airstrike
		BeaconPosterPalette: beaconposter
		DisplayRadarPing: True
		CameraActor: camera

[...]


thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Post by thebestwes »

I took out the Race attribute, and it still only gives me the GDI airstrike ability. Is it just that you can't have a structure give more than one type of airstrike?

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

Post by Graion Dilach »

What does --check-yaml say about it?
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Post Reply