deleteVehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(moved crew removal discussion to Talk page)
Line 11: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Delete an object. Note that only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units can't be removed. |= Description
| Deletes an object.<br>
Only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units cannot be removed. <br>
Deleting a vehicle, which is still being accessed by a running script, can result in a CTD.|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 21: Line 23:
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <pre>deleteVehicle _house1</pre>
|x1= <pre>deleteVehicle _house1</pre> |= Example 1
 
Attention Deleting a vehicle, which is still being accessed by a running script, can result in a CTD. |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 36: Line 36:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on August 3, 2006 - 14:30</dd>
<dt class="note">'''[[User:Hardrock|hardrock]]'''</dt>
<dd class="note">''Notes from before the conversion:''
If you run deleteVehicle for every playable soldier, the AI units will be removed.
<code>deleteVehicle unit1</code>
will result in some very strange, and unwelcome, things happening.
A safer way to delete unit1 if it is, or might be, inside a vehicle is:
<code>[[unassignVehicle]] unit1<br/>
unit1 [[setPos]] [0,0,0]<br/>
deleteVehicle unit1</code>
''This is because you cannot call deleteVehicle on a unit (soldier) who's currently inside a Vehicle.''
The line below works just fine for units that have been deleted.
<code>[[if]] ([[alive]] unit1) [[then]] {[[hint]]"He is alive"} [[else]] {[[hint]]"Oh no he's not"}</code>
</dd>
<dd class="notedate">Posted on January 14, 2009 - 12:35</dd>
<dt class="note">'''[[User:Kronzky|Kronzky]]'''</dt>
<dd class="note">''Units in vehicles cannot be deleted''.<br>
It doesn't matter whether it's the default crew (e.g. {driver car1}), or a unit that has been placed into a vehicle (e.g. {unit1 moveInCargo car1; deleteVehicle unit1}). In either case the unit will stay alive and visible in its position.<br>
To circumvent this limitation, [[Armed_Assault:_Actions_List#Eject|eject]] the unit first, before deleting it.
</dd>
<dd class="notedate">Posted on August 6, 2009 - 11:30</dd>
<dt class="note">'''[[User:Shuko|Shuko]]'''</dt>
<dd class="note">In Arma 2 deleting units in vehicles work. Trigger with the code below will remove APC, crew and the group that is moveincargo'd.
<code>{deletevehicle _x} foreach crew (thislist select 0);
deletevehicle (thislist select 0);</code>
</dd>
<dd class="notedate">Posted on April 6, 2010</dd>
<dt class="note">'''[[User:galzohar|galzohar]]'''</dt>
<dd class="note">Deleting a vehicle that has units in it can (but not always will) cause some weird bugs, for example "locking" the unit in freelook mode making it unable to turn or use the action menu, or leave "ghosts" of vehicle crew members if those were deleted after the vehicle deletion (deleting the crew before the vehicle works, as in the above example).
</dd>
<dd class="notedate">Posted on July 20, 2010</dd>
<dt class="note">'''[[User:Cobra4v320|Cobra4v320]]'''</dt>
<dd class="note">Here is a shorter and easier method of deleting a vehicle and its crew at the same time. You can place it into the vehicles ending waypoint or a trigger.
<code>{deleteVehicle _X} forEach (crew vehiclename)+[vehiclename]</code>
</dd>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 14:13, 21 July 2010

Hover & click on the images for description

Description

Description:
Deletes an object.
Only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units cannot be removed.
Deleting a vehicle, which is still being accessed by a running script, can result in a CTD.
Multiplayer:
A deleted player unit will stay visible until that player has disconnected.
Groups:
Uncategorised

Syntax

Syntax:
deleteVehicle object
Parameters:
object: Object
Return Value:
Nothing

Examples

Example 1:
deleteVehicle _house1

Additional Information

See also:
createUnitcreateUnit arraycreateVehicle arraycreateVehicleLocalcreateVehicle

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section