Chris Death 0 Posted November 14, 2002 I ran into a problem, using deletevehicle _x, to delete a whole group. I've had a group, named: hosta (two resistance soldiers) Because i was using guard wayoints for the enemy troops, i did not want to confuse by having unnecessary tropps on the battlefield. So after the two resistance soldier's job was done, i used the onActivation field of their last wayoint to delete them: "deleteVehicle _x" forEach units hosta Unfortunately at exactly this point of the mission, the game crashed everytime. So i had to investigate this problem, since the syntax of the command i've been using was correct. After having a look into a mission, where i also have been using this command (and it did not crash the game there), i found a little difference. I've executed the same command, but i've been using a trigger in this mission. After changing the delete procedure in my other mission from waypoint to trigger, it worked there aswell Summary: If you want to delete a whole group by using deletevehicle _x, you MUST NOT use a wayoint of this group for that !!!!! this causes your game to crash !!!!! After thinking a little bit about it, i totally understand this problem now, because of deleting the group, also the waypoint will be deleted, and so the whole procedure gets deleted, while executing it. hope this is some useful information for you guys ~S~ CD Share this post Link to post Share on other sites
BaronVonRed 0 Posted November 14, 2002 Thanks for that. Share this post Link to post Share on other sites
Balschoiw 0 Posted November 14, 2002 I use an alternative solution to this. I set up a huge trigger covering the region I want to clear. There can be waypoints, groups or whatever in this trigger area. Set the activation of the trigger to anybody. and the condition to false. Name the trigger clearzone. Now setup a second trigger to fire a script. The trigger could be loacted at point where player leaves an area and enters a new one without turning back to first area (mission objective). the fired script should look like this: Code: "deletevehicle _x" foreach list ClearZone This way you will get rid of all units within clearzone trigger radius. No crashing here. Share this post Link to post Share on other sites
Chris Death 0 Posted November 14, 2002 This i already knew Balschoiw, but what i did not know before was: that using the command out of the onactivation field in a waypoint of the group which has to be deleted. Using your method would really not have been necessary in the mission, where i found that problem. It was only this two men group, to be deleted. ~S~ CD Share this post Link to post Share on other sites
Balschoiw 0 Posted November 14, 2002 thought it might help. anyway hopefully some others will be glad to know Share this post Link to post Share on other sites
bn880 5 Posted November 14, 2002 Never mind, I have to check this out... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">After thinking a little bit about it, i totally understand this problem now, because of deleting the group, also the waypoint will be deleted, and so the whole procedure gets deleted, while executing it. <span id='postcolor'> Yes it causes a problem because _x is accessed from local space (local to waypt activation), and the waypt is deleted. It should happen with waypoints other than last also. Good find... Share this post Link to post Share on other sites
bn880 5 Posted November 14, 2002 Another solution is create a scripted waypoint right after the one you wanted to delete in. There just execute a tiny script (like del.sqs) that has the line </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"deleteVehicle _x" forEach units grp1;<span id='postcolor'> inside. It works well. Share this post Link to post Share on other sites
Chris Death 0 Posted November 14, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">just execute a tiny script <span id='postcolor'> Yeah bn880, doing it out of a script will work aswell. As we both understood that thing the same way, you can do it however you want, except: out of a wayoint of the group, which has to be deleted. Waypoints of other units or groups shouldn't matter, since they won't get deleted during this procedure. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Good find... <span id='postcolor'> cheers, but i wish i could say, that there would not have been the need to find this ~S~ CD Share this post Link to post Share on other sites