Jump to content

OutPictureForUnit: Difference between revisions

From CMM Wiki
outPictureForUnit – created via PowerShell script (2025-11-11T21:12:08Z)
Tag: Recreated
 
m outPictureForUnit – created via PowerShell script (2026-06-24T22:26:39Z)
 
Line 1: Line 1:
{{Template:FunctionInfo|fName=          outPictureForUnit|fDescription=  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.|parentFile=    cmm.DCSFunctions.lua|syntax=        CMM.outPictureForUnit(<string>, <string>, <number|nil>, <boolean|nil>, <number|nil>, <number|nil>, <number|nil>, <number|nil>, <number|nil>)|return=        nil|returnDesc=    The function performs a side‑effect only and returns nothing.|example=        CMM.outPictureForUnit("unit_42", "target.png", 20, true, 0, 1, 1, 80)|exampleDesc=    Displays "target.png" for 20 s on unit #42’s screen, clearing any other images first|related=        |note=          FILENAMES NEED TO BE IN THE mapResource file under l10n\DEFAULT in the mission file|envType= CMM|par1=        string UnitID|reqType1=    string|reqName1=    UnitID|desc1=      The Unit.getID() of the target unit (e.g., "unit_123").|par2=        string fileName|reqType2=    string|reqName2=    fileName|desc2=      Name of the image file located in l10n\DEFAULT of the mission.|par3=        number or nil durationSeconds|optType3=    number or nil|optName3=    durationSeconds|desc3=      How long, in seconds, the picture remains visible.  If omitted or nil, it stays until cleared by another call.|par4=        boolean or nil clearView|optType4=    boolean or nil|optName4=    clearView|desc4=      When true, removes all other images currently displayed for that unit before showing this one.|par5=        number or nil startDelay|optType5=    number or nil|optName5=    startDelay|desc5=      Seconds to wait after calling before the image appears (useful for sequencing).|par6=        number or nil horizontalAlign|optType6=    number or nil|optName6=    horizontalAlign|desc6=      0 = left, 1 = center, 2 = right.  Defaults to 1 (center).|par7=        number or nil verticalAlign|optType7=    number or nil|optName7=    verticalAlign|desc7=      0 = top, 1 = middle, 2 = bottom.  Defaults to 1 (middle).|par8=        number or nil size|optType8=    number or nil|optName8=    size|desc8=      Scale factor relative to screen width; 100 makes the image fill the screen.  Default is 100.|par9=        number or nil sizeUnits|optType9=    number or nil|optName9=    sizeUnits|desc9=      Units for the size parameter (normally leave as 1).}}
{{Template:FunctionInfo|fName=          outPictureForUnit|fDescription=  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.|parentFile=    cmm.DCSFunctions.lua|syntax=        CMM.outPictureForUnit(<string>, <string>, <number|nil>, <boolean|nil>, <number|nil>, <number|nil>, <number|nil>, <number|nil>, <number|nil>)|return=        nil|returnDesc=    The function performs a side‑effect only and returns nothing.|example=        CMM.outPictureForUnit("unit_42", "target.png", 20, true, 0, 1, 1, 80)|exampleDesc=    Displays "target.png" for 20 s on unit #42’s screen, clearing any other images first|related=        |note=          FILENAMES NEED TO BE IN THE mapResource file under l10n\DEFAULT in the mission file|envType= CMM|par1=        string UnitID|reqType1=    string|reqName1=    UnitID|desc1=      The Unit.getID() of the target unit (e.g., "unit_123").|par2=        string fileName|reqType2=    string|reqName2=    fileName|desc2=      Name of the image file located in l10n\DEFAULT of the mission.|par3=        number or nil durationSeconds|optType3=    number or nil|optName3=    durationSeconds|desc3=      How long, in seconds, the picture remains visible.  If omitted or nil, it stays until cleared by another call.|par4=        boolean or nil clearView|optType4=    boolean or nil|optName4=    clearView|desc4=      When true, removes all other images currently displayed for that unit before showing this one.|par5=        number or nil startDelay|optType5=    number or nil|optName5=    startDelay|desc5=      Seconds to wait after calling before the image appears (useful for sequencing).|par6=        number or nil horizontalAlign|optType6=    number or nil|optName6=    horizontalAlign|desc6=      0 = left, 1 = center, 2 = right.  Defaults to 1 (center).|par7=        number or nil verticalAlign|optType7=    number or nil|optName7=    verticalAlign|desc7=      0 = top, 1 = middle, 2 = bottom.  Defaults to 0 (middle).|par8=        number or nil size|optType8=    number or nil|optName8=    size|desc8=      Scale factor relative to screen width; 100 makes the image fill the screen.  Default is 100.|par9=        number or nil sizeUnits|optType9=    number or nil|optName9=    sizeUnits|desc9=      Units for the size parameter (normally leave as 1).}}

Latest revision as of 12:26, 24 June 2026

Return to CMM Command Reference
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
UnitIDThe Unit.getID() of the target unit (e.g., "unit_123").
fileNameName of the image file located in l10n\DEFAULT of the mission.
durationSecondsHow long, in seconds, the picture remains visible. If omitted or nil, it stays until cleared by another call.
clearViewWhen true, removes all other images currently displayed for that unit before showing this one.
startDelaySeconds to wait after calling before the image appears (useful for sequencing).
horizontalAlign0 = left, 1 = center, 2 = right. Defaults to 1 (center).
verticalAlign0 = top, 1 = middle, 2 = bottom. Defaults to 0 (middle).
sizeScale factor relative to screen width; 100 makes the image fill the screen. Default is 100.
sizeUnitsUnits 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