SetImmortal
Appearance
| 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 |
| Ctrllr | The Group AI Controller to modify (must pass IsController check). | |
| Immortal | Desired 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: | ||