It does support multiple unit types, though, you just need to apply an ability to the units you want to have the effect.
* Or what you could do is a general food-regulator system.
It would allow the user to define custom food usages for any unit type. (in type: real, not integer)
This system would ensure the wanted food usage for all units of a type in game, and not only trained ones.
This sounds very interesting, I did recently do something with regards to income in my map that, through the use of modulo, increases your gold by a small trickle every 0.1 seconds, effectively emulating a real value
Alternatively I should be able to make the food usage flexible for each unit type, but what do you have in mind? I think I understand what you mean, but just for clarity, are you saying have it that instead of two units costing 1 food together, it would perhaps take into consideration the original food cost of the unit produced and have them cost that much together?
Like, for example, if you wanted to make a more beefy unit cost 1.5 food rather than 0.5? I'll look into it ^_^
UPDATE:
Turns out it was sooooo easy to do that, just had to change one thing and while I was at it I added a variable for the Dying unit so I'm not constantly referencing Triggering Unit.
-
Player - Set (Owner of ZerglingTrainedUnit) Food used to (((Owner of ZerglingTrainedUnit) Food used) + (Supply used by ZerglingTrainedUnit))
Okay, I've updated the map now but I think there is something else I want to do with it. For now, it demonstrates that only when a second unit dies you will lose the population - so if you lose on Hydralisk which is costing 3 Food at the moment, then you will not lose 1.5 Food.
I can fix this with the use of modulo I believe ^_^
UPDATE AGAIN:
I fixed this with the use of modulo.
Here is the new Zergling Dies trigger code:
-
Zergling Dies
-
Events
-
Conditions
-
(Level of Double Me Up (Captain) for (Triggering unit)) Greater than 0
-
Actions
-
Set ZerglingDyingUnit = (Triggering unit)
-
Set ZerglingCounter[(Player number of (Owner of ZerglingDyingUnit))] = (ZerglingCounter[(Player number of (Owner of ZerglingDyingUnit))] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Supply used by (Unit-type of ZerglingDyingUnit)) / 2) Greater than 0
-
Then - Actions
-
Player - Set (Owner of ZerglingDyingUnit) Food used to (((Owner of ZerglingDyingUnit) Food used) - ((Supply used by (Unit-type of ZerglingDyingUnit)) / 2))
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ZerglingCounter[(Player number of (Owner of ZerglingDyingUnit))] Greater than 1
-
Then - Actions
-
Set ZerglingCounter[(Player number of (Owner of ZerglingDyingUnit))] = 0
-
Player - Set (Owner of ZerglingDyingUnit) Food used to (((Owner of ZerglingDyingUnit) Food used) - ((Supply used by (Unit-type of ZerglingDyingUnit)) mod 2))
-
Else - Actions