Production.BuildTeamFromTemplate allows the production of teams from a
list of
actor types, assigning a function to that team once it is complete.
A 'template' in this case looks like this:
template = { {factory, {list of units to build using aforementioned factory}} }
e.g. template = { {barracks, {"e1", "e1", "e1", "e3", "e3"}} }
You can also build teams using multiple factories like this:
template = { {barracks, {"e3", "e3", "e3"}}, {war_factory, {"3tnk", "3tnk"}} }
Before using Production.BTFT you need to call
Production.EventHandlers.Setup once.
- Fix the unloading subcell bug, letting us have units move to directly adjacent cells.
- Have the cursor change to a deploy-blocked cursor if the transport can't unload due to terrain type.
- Add RenderTransport for transport door opening.
- Remove turning/opening in general.
OpenRA.GetRandomInteger crashes when the supplied high value is less or
equal to the low value. A situation where this might occur is when you
try to get a random member of a dynamically generated array that
happens to have only a single member.
Besides fitting in better with the OpenRA coding style, this also gets
rid of some weird timing-related errors I have seen when creating teams
with a larger number (6+) of members. (The script would just print
'Error: function' in Team.AddActorEventHandlers. Adding a strategically
placed print statement fixed that. Replacing the original for loop with
Team.Do did as well)