Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| tmf:garrison [2017/07/16 10:39] – snippers | tmf:garrison [2025/08/03 14:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| The garrison module can be used to spawn units inside buildings in a garrisoned state (will remain standing and not leave their post). The positions are chosen randomly at mission start (or trigger activation if a trigger is synced). Building positions will be selected inside the area of the module. If you would like to add further areas you can syncronize [[: | The garrison module can be used to spawn units inside buildings in a garrisoned state (will remain standing and not leave their post). The positions are chosen randomly at mission start (or trigger activation if a trigger is synced). Building positions will be selected inside the area of the module. If you would like to add further areas you can syncronize [[: | ||
| - | Each unit [[: | + | Each unit [[: |
| ===== Usage ===== | ===== Usage ===== | ||
| + | Put down the module and adjust the module area to contain buildings you intend the AI to spawn in. | ||
| + | {{: | ||
| - | {{: | + | Configure the module options to set the number of AI to spawn inside buildings and whether the AI should hold their position. |
| + | |||
| + | {{: | ||
| + | |||
| + | Example of the spawned AI: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You can also sync TMF Area modules to the Garrison module to expand the area of building selection. | ||
| + | |||
| + | {{: | ||
| ===== Trigger support ===== | ===== Trigger support ===== | ||
| Line 23: | Line 35: | ||
| The module will spawn the units on the [[: | The module will spawn the units on the [[: | ||
| + | ===== API - retrieve spawned units ===== | ||
| + | |||
| + | The units spawned by the garrison module can be retrieved with the following code: | ||
| + | <code cpp> | ||
| + | module getVariable " | ||
| + | </ | ||
| + | |||
| + | Example usage: Re-enabling the movement of the AI. | ||
| + | |||
| + | //This code can be placed in a trigger on activation to enable the units to move again (assumes the garrison module is called garrison_1).// | ||
| + | <code cpp> | ||
| + | {_x enableAI " | ||
| + | </ | ||