Difference between revisions of "MIST respawnGroup"
From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.respawnGroup| |vNum = Mist 3.0 |desc= Respawns a group of the name groupName at its initial location as set in the mission editor. | |rtn...") |
(Fix missing single quote) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 62: | Line 62: | ||
|example= The following code will respawn a group if it has died. | |example= The following code will respawn a group if it has died. | ||
<code> | <code> | ||
| − | if | + | if mist.groupIsDead('groupName') == true then |
mist.respawnGroup('groupName', true) | mist.respawnGroup('groupName', true) | ||
end | end | ||
| Line 69: | Line 69: | ||
The following will respawn a group and send the group on its route as defined in the mission editor in 2 minutes (120 seconds) | The following will respawn a group and send the group on its route as defined in the mission editor in 2 minutes (120 seconds) | ||
<code> | <code> | ||
| − | if | + | if mist.groupIsDead('groupName') == true then |
mist.respawnGroup('groupName', 120) | mist.respawnGroup('groupName', 120) | ||
end | end | ||
| Line 76: | Line 76: | ||
The following will respawn a group in place. If it is an aircraft group, they will immediately RTB to the nearest friendly airbase | The following will respawn a group in place. If it is an aircraft group, they will immediately RTB to the nearest friendly airbase | ||
<code> | <code> | ||
| − | if | + | if mist.groupIsDead('groupName') == true then |
| − | mist.respawnGroup('groupName) | + | mist.respawnGroup('groupName') |
end | end | ||
</code> | </code> | ||
Latest revision as of 19:25, 13 May 2023
mist.respawnGroup
| Added with: Mist 3.0 |
| Description |
| Respawns a group of the name groupName at its initial location as set in the mission editor. |
| Syntax |
| string mist.respawnGroup(string groupName , boolean/number task/taskDelay ) |
| Valid Input Values: |
| groupName= name of the group that is to respawn
task= Optional variable that will re-assign the groups original route. If task is not provided group will remain stationary or RTB if an aircraft. Function returns a mission editor formatted table of the group. taskDelay= If this variable is a number it will re-assign the groups original route after the specified time in seconds |
| Return value: |
| string |
| Return example: |
| string of group's name |
| Usage Examples: |
| The following code will respawn a group if it has died.
if mist.groupIsDead('groupName') == true then
mist.respawnGroup('groupName', true)
end
The following will respawn a group and send the group on its route as defined in the mission editor in 2 minutes (120 seconds)
if mist.groupIsDead('groupName') == true then
mist.respawnGroup('groupName', 120)
end
The following will respawn a group in place. If it is an aircraft group, they will immediately RTB to the nearest friendly airbase
if mist.groupIsDead('groupName') == true then
mist.respawnGroup('groupName')
end
|
| Notes: |
| As of mist 3.3 this function supports the use of static objects. |
| Related Functions |
| dynAdd, dynAddStatic, groupTableCheck, getNextUnitId, getNextGroupId, respawnGroup, respawnInZone, cloneGroup, cloneInZone, teleportGroup, teleportInZone, teleportToPoint, spawnRandomizedGroup |
