deleteVehicle – Talk

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


On another note, from the multiplayer side of things, it seems anyone can delete any vehicle regardless of locality. Can anyone confirm?
On another note, from the multiplayer side of things, it seems anyone can delete any vehicle regardless of locality. Can anyone confirm?
=Deleting Crew=
''(I have moved the discussion from main page here, so we can figure out what exactly is happening in the different versions, before we post it on the main page.)'' --[[User:Kronzky|Kronzky]] 15:11, 21 July 2010 (CEST)
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
unit1 [[setPos]] [0,0,0]
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>
August 3, 2006 - 14:30, [[User:Hardrock|hardrock]]
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.<br>
January 14, 2009 - 12:35, [[User:Kronzky|Kronzky]]
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>
August 6, 2009 - 11:30, [[User:Shuko|Shuko]]
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).<br>
April 6, 2010, [[User:galzohar|galzohar]]

Revision as of 14:11, 21 July 2010

If you deleteVehicle a vehicle that has been tagged as a respawnVehicle, the game will crash when it tries to garbage collect the vehicle it thinks is still there. --Doolittle 01:50, 16 July 2007 (CEST)

I have been able to run the 'deleteVehicle' command on a vehicle marked as 'respawnable' without issue. This command has not caused any CTD's for me when deleting either the 'alive' or 'dead' version of the given vehicle. Please explain your methodology precisely. --Sy 03:38, 16 July 2007 (CEST)

Arma 2: Deleting a unit local to the server (only) on the server seems to cause inconsistencies with clients (testing on a hosted server). Sometimes the units will get deleted properly for everyone and sometimes a "ghost" would remain on the clients but not the server - that is, they will still appear in game and on the map (in "regular" difficulty) but not do anything, and bullets will go through them. Can anyone explain why this is happening and why the inconsistency? This only happened to me with a tank crew that was first spawning a script (via execVM), that deletes them if a certain condition is met, and then was ordered to moveInX and assaingX to the vehicle (where X is commander, gunner and driver for each of the crewmen). Can upload the mission that causes this if needed.

Yes please upload the mission.
--ViperMaul 10:11, 9 August 2009 (CEST)

I found out the cause, by the way, just forgot about this post to update it. This seems to happen when you delete the vehicle without deleting the crew first. Not sure if it's still the case in 1.05, though, as it was a long time ago.

On another note, from the multiplayer side of things, it seems anyone can delete any vehicle regardless of locality. Can anyone confirm?

Deleting Crew

(I have moved the discussion from main page here, so we can figure out what exactly is happening in the different versions, before we post it on the main page.) --Kronzky 15:11, 21 July 2010 (CEST)


If you run deleteVehicle for every playable soldier, the AI units will be removed. deleteVehicle unit1 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:

unassignVehicle unit1 unit1 setPos [0,0,0] deleteVehicle unit1

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.

if (alive unit1) then {hint"He is alive"} else {hint"Oh no he's not"} August 3, 2006 - 14:30, hardrock


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.
To circumvent this limitation, eject the unit first, before deleting it.
January 14, 2009 - 12:35, Kronzky


In Arma 2 deleting units in vehicles work. Trigger with the code below will remove APC, crew and the group that is moveincargo'd. {deletevehicle _x} foreach crew (thislist select 0); deletevehicle (thislist select 0); August 6, 2009 - 11:30, Shuko


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).
April 6, 2010, galzohar