OutPictureForUnit
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | outPictureForUnit | |
| Function Description: | Shows an image on the screen of a specific unit (identified by its UnitID). The picture is displayed in the same way as CMM.outPicture, but it is rendered only for the chosen unit’s perspective, allowing mission designers to give individual players or AI units visual cues. | |
| File Location: | cmm.DCSFunctions.lua | |
| Syntax: | CMM.outPictureForUnit( string UnitID , string fileName , number or nil durationSeconds , boolean or nil clearView , number or nil startDelay , number or nil horizontalAlign ,number or nil verticalAlign , number or nil size , number or nil sizeUnits ) | |
| Return Value: | nil | |
| Parameters: | Name | Description |
| UnitID | The Unit.getID() of the target unit (e.g., "unit_123"). | |
| fileName | Name of the image file located in l10n\DEFAULT of the mission. | |
| durationSeconds | How long, in seconds, the picture remains visible. If omitted or nil, it stays until cleared by another call. | |
| clearView | When true, removes all other images currently displayed for that unit before showing this one. | |
| startDelay | Seconds to wait after calling before the image appears (useful for sequencing). | |
| horizontalAlign | 0 = left, 1 = center, 2 = right. Defaults to 1 (center). | |
| verticalAlign | 0 = top, 1 = middle, 2 = bottom. Defaults to 1 (middle). | |
| size | Scale factor relative to screen width; 100 makes the image fill the screen. Default is 100. | |
| sizeUnits | Units for the size parameter (normally leave as 1). | |
| Example: | CMM.outPictureForUnit("unit_42", "target.png", 20, true, 0, 1, 1, 80) | |
| Example Description: | Displays "target.png" for 20 s on unit #42’s screen, clearing any other images first | |
| Related Functions: | ||
| Notes: | FILENAMES NEED TO BE IN THE mapResource file under l10n\DEFAULT in the mission file | |