Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
tmf:garrison [2017/07/16 10:39] snippers |
tmf:garrison [2017/07/16 12:08] (current) snippers |
||
---|---|---|---|
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 [[:tmf:area|area]] modules to provide extra areas to be searched for building positions. | 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 [[:tmf:area|area]] modules to provide extra areas to be searched for building positions. | ||
- | Each unit [[:tmf:sync|synced]] to the garrison module will become possible unit to be spawned inside the area. If you want to increase the chance of a certain unit to spawn, [[:tmf:sync|sync]] several versions of it. Note the module will also apply TMF loadouts or arsenal loadouts that are applied to the synced units. | + | Each unit [[:tmf:sync|synced]] to the garrison module will become a possible unit to be spawned inside the area. If you want to increase the chance of a certain unit to spawn, [[:tmf:sync|sync]] several versions of it. Note the module will also apply TMF loadouts or arsenal loadouts that are applied to the synced units. |
===== Usage ===== | ===== Usage ===== | ||
+ | Put down the module and adjust the module area to contain buildings you intend the AI to spawn in. | ||
+ | {{:tmf:garrison1.jpg?800}} | ||
- | {{:tmf:tmf_garrison_usage.png}} | + | Configure the module options to set the number of AI to spawn inside buildings and whether the AI should hold their position. |
+ | |||
+ | {{:tmf:garrison2.jpg?800}} | ||
+ | |||
+ | Example of the spawned AI: | ||
+ | |||
+ | {{:tmf:garrison3.jpg?800}} | ||
+ | |||
+ | You can also sync TMF Area modules to the Garrison module to expand the area of building selection. | ||
+ | |||
+ | {{:tmf:tmf_garrison_usage.png?800}} | ||
===== Trigger support ===== | ===== Trigger support ===== | ||
Line 23: | Line 35: | ||
The module will spawn the units on the [[:tmf:headlessclient|HC]] instead. | The module will spawn the units on the [[:tmf:headlessclient|HC]] instead. | ||
+ | ===== API - retrieve spawned units ===== | ||
+ | |||
+ | The units spawned by the garrison module can be retrieved with the following code: | ||
+ | <code cpp> | ||
+ | module getVariable "spawned_units" | ||
+ | </code> | ||
+ | |||
+ | 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 "PATH"} forEach (garrison_1 getVariable "spawned_units") | ||
+ | </code> | ||