Page MenuHomeWildfire Games

Allow trigger scripts to spawn garrisoned units
ClosedPublic

Authored by mimo on Dec 12 2017, 9:26 PM.

Details

Summary

Currently, trigger scripts which want to spawn garrisoned units have first to spawn them around their garrisonHolder, and then order them to garrison (as done in danubius map for example). That's a lot of useless steps (finding some room for the units, and then moving them out of world), and is not always possible if we want to garrison inside a ship.
The patch allows to spawn units already garrisoned.

Test Plan

Check that it does what is expected.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mimo created this revision.Dec 12 2017, 9:26 PM
Vulcan added a subscriber: Vulcan.Dec 12 2017, 10:20 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Dec 17 2017, 6:18 PM
elexis added a subscriber: elexis.Dec 17 2017, 8:40 PM

first to spawn them around their garrisonHolder, and then order them to garrison (as done in danubius map for example

Useless correction: That's the case for the buildings, but not for the ships, since orders are processed one or two turns later, so units spawned on a nearby island weren't able to garrison the ship anymore after that had moved away in that time. Besides the footprint performance issue fixed by temple recently.
Someone motivated could use the new function on danubius to shorten the code and fix the missing Autogarrison to allow selecting garrisoned gaia heroes in observermode.