Jump to content

SetImmortal

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: SetImmortal
Function Description: Sets the "immortal" state of a Group AI Controller. If Immortal is omitted it defaults to true. The function verifies that the supplied controller is valid via CMM.IsController; if not, it logs an error and exits.
File Location: cmm.DCSFunctions.lua
Syntax: CMM.SetImmortal( boolean Ctrllr , boolean or nil Immortal )
Return Value:
Parameters: Name Description
CtrllrThe Group AI Controller to modify (must pass IsController check).
ImmortalDesired immortal state; defaults to true if omitted.
Example: local ctrl = unit:getGroup():getController(); CMM.SetImmortal(ctrl, false) -- make the group mortal
Example Description: Demonstrates retrieving a controller from a unit and setting its immortal flag to false (i.e., making it mortal).
Related Functions:
Notes: