The background info: I am designing an Elementals race. There is a group of four buildings, each associated with Fire, Air, Water, or Earth; and there is an advanced building that requires you to have at least two of those four in order to build it.
Here's my first attempt at the trigger that governs this. I'm using an upgrade research for the requirement. It's not working, and I'm not sure what's wrong. Also, this feels cumbersome, is there a more efficient way to do this?
Here's my first attempt at the trigger that governs this. I'm using an upgrade research for the requirement. It's not working, and I'm not sure what's wrong. Also, this feels cumbersome, is there a more efficient way to do this?
-
Two Elemental Shrines
-
Events
-
Unit - A unit Finishes construction
-
Unit - A unit Dies
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Fire Temple
-
(Unit-type of (Triggering unit)) Equal to Spire of Clouds
-
(Unit-type of (Triggering unit)) Equal to Scrying Pool
-
(Unit-type of (Triggering unit)) Equal to Earthen Dome
-
-
-
-
Actions
-
-------- Initialize --------
-
Set FireShrines = 0
-
Set AirShrines = 0
-
Set WaterShrines = 0
-
Set EarthShrines = 0
-
Set ElementalShrines = 0
-
Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Picked unit) is A structure) Equal to True)) and do (Actions)
-
Loop - Actions
-
-------- Check for Fire Shrine --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to Fire Temple
-
-
Then - Actions
-
Set FireShrines = 1
-
-
Else - Actions
-
-
-------- Check for Air Shrine --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to Spire of Clouds
-
-
Then - Actions
-
Set AirShrines = 1
-
-
Else - Actions
-
-
-------- Check for Water Shrine --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to Scrying Pool
-
-
Then - Actions
-
Set WaterShrines = 1
-
-
Else - Actions
-
-
-------- Check for Earth Shrine --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to Earthen Dome
-
-
Then - Actions
-
Set EarthShrines = 1
-
-
Else - Actions
-
-
-
-
-------- Total Count --------
-
Set ElementalShrines = (ElementalShrines + FireShrines)
-
Set ElementalShrines = (ElementalShrines + AirShrines)
-
Set ElementalShrines = (ElementalShrines + WaterShrines)
-
Set ElementalShrines = (ElementalShrines + EarthShrines)
-
-------- Set Research Level --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ElementalShrines Greater than or equal to 2
-
-
Then - Actions
-
Player - Set the current research level of At least two of Fire Shrine Spire of Clouds, Scrying Pool, or Earthen Dome (Upgrade 1) to 1 for (Owner of (Triggering unit))
-
-
Else - Actions
-
Player - Set the current research level of At least two of Fire Shrine Spire of Clouds, Scrying Pool, or Earthen Dome (Upgrade 1) to 0 for (Owner of (Triggering unit))
-
-
-
-