Jump to content
Sign in to follow this  
toadeater

Deletevehicle = painful death

Recommended Posts

I've tried using the deletevehicle command, but instead of deleting the object it causes OFP to crash. What do you have to do to get it to work?

Share this post


Link to post
Share on other sites

I have always just used

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">deletevehicle <unit><span id='postcolor'>

where unit is the name you have assigned to the unit you would like to delete.  

See if your trying to delete the editor name of the unit like deletevehicle "SoldierEB", these are the names that OFP uses in the createvehicle command, but your name you have given to the unit is used when deleteing vehicles.  For example, I can create an east soldier like this:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierEB" createunit [getpos spawneast, tangodef3, "EastSol1 = this", 1, "PRIVATE"]<span id='postcolor'>

where SoldierEB is the editor name of the unit, spawneast is the name of the game logic where you would like the unit to appear, tangodef3 is the name I used for the group this soldier was being added to, and  EastSol1 is the name I have assigned to the unit.  If I wanted to delete this unit I would use:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">deletevehicle EastSol1<span id='postcolor'>

Hope this helps, I'm not the best at explaining this stuff.

Edit: Can't type

Share this post


Link to post
Share on other sites

This topic might help you.

DeleteVehicle seems to crash when used in the waypoint of units that are being deleted. You need to use it from a trigger or a script instead.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Feb. 28 2003,08:22)</td></tr><tr><td id="QUOTE">DeleteVehicle seems to crash when used in the waypoint of units that are being deleted. You need to use it from a trigger or a script instead.<span id='postcolor'>

I have never experienced that, deletes the unit without any problems, im running 1.91.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Hovmand @ Feb. 28 2003,10:05)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Feb. 28 2003,08:22)</td></tr><tr><td id="QUOTE">DeleteVehicle seems to crash when used in the waypoint of units that are being deleted. You need to use it from a trigger or a script instead.<span id='postcolor'>

I have never experienced that, deletes the unit without any problems, im running 1.91.<span id='postcolor'>

Suma talks about putting deletevehicle <unitname> in a waypoint's onactivation belonging to the waypoint for a to-be-deleted unit will crash. smile.gif

Share this post


Link to post
Share on other sites

Thats what i did, placed a jeep on the map, named it j1, gave it a waypoint and in the on activation field i wrote deletevehicle j1, watched the jeep drive in to the waypoint and got deleted, and ofp didnt crash.

Is it this what supossedly makes ofp crash? Or am i just making a fool of myself? smile.gif

Share this post


Link to post
Share on other sites

I've never used the deletetvehicle command in a waypoint, I've always called it from a script.  Thanks Suma for explaining whats's up.   smile.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Feb. 28 2003,08:22)</td></tr><tr><td id="QUOTE">This topic might help you.

DeleteVehicle seems to crash when used in the waypoint of units that are being deleted. You need to use it from a trigger or a script instead.<span id='postcolor'>

Ah, yes, so that's why it crashed at my system. Use the trigger, not the waypoint, yes, yes. By the way, I'm using 1.90

Maybe it's only restricted to 1.75-1.90 ?

Share this post


Link to post
Share on other sites

I have made two missions with the Deletevehicle command in waypoints, and none of them has ever crashed, i have played them both on 1.75 - 1.90 confused.gif

Share this post


Link to post
Share on other sites

Okay Hovmand, did you use foreach _x to delete a whole group? And did you launch a script from the waypt or just write the command in the activation field? smile.gif

Anyway don't worry if you don't get errors.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Feb. 28 2003,16:58)</td></tr><tr><td id="QUOTE">Anyway don't worry if you don't get errors.<span id='postcolor'>

Hmm... I wonder how that sentence looks like taken out of the context. Sounds a bit like a slogan for Microsoft products wink.gif

Anyway, I tried using deleteVehicle on waypoints, too, and it never crashed.

Share this post


Link to post
Share on other sites

biggrin.gif Except I don't make any money off OFP... so it's different than MS.

I'm telling you though, if your deleteVehicle is fine for one vehicle in a waypt without using local variable space, run with it, it won't crash on other peoples machines either. smile.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Feb. 28 2003,15:58)</td></tr><tr><td id="QUOTE">Okay Hovmand, did you use foreach _x to delete a whole group?  And did you launch a script from the waypt or just write the command in the activation field?  smile.gif

Anyway don't worry if you don't get errors.<span id='postcolor'>

I just used the command in the activation field, and it was just one vehicle not a whole group.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Hovmand @ Feb. 28 2003,16:23)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Feb. 28 2003,15:58)</td></tr><tr><td id="QUOTE">Okay Hovmand, did you use foreach _x to delete a whole group?  And did you launch a script from the waypt or just write the command in the activation field?  smile.gif

Anyway don't worry if you don't get errors.<span id='postcolor'>

I just used the command in the activation field, and it was just one vehicle not a whole group.<span id='postcolor'>

That's what I did, and when I do that, OFP disappears in a flash and I am left staring at my desktop. I dunno what you're doing, but it doesn't work here.

Share this post


Link to post
Share on other sites

I forgot to say that Ofp crashed when I used it on a waypoint of an infantry unit. U have used the deletevehicle command with a trigger on vehicles and that caused no problems so far. I have yet to test it out on a vehicles waypoint though.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×