Jump to content

Photo
- - - - -

DMZ Delete [script]


  • Please log in to reply
31 replies to this topic
Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 15 July 2011 - 13:49 #1

DMZ Delete v 1.1
release v 1.1 - 16 July 2011

REQUIRES Arma2 OA
* Its a script wich cleans up any dead man, destroyed vehicle and empty groups (to save the 144 group limit for long missions).
* It works for men, land, air, sea vehicles and empty groups.
* it includes options to add other objects(ANY) or use custom timer/distance on any object.
* It uses no eventhandlers.
* options included: abondened vehicles, vehicles that cannot move due to damage, distance so players cannot see the "delete", timers.
* You can exclude 1 or several specific units, or even unit classnames or superclasses like all helicopters or combine with all above.
* It updates runtime so you can add and remove excluded units/vehicles on the go. v 1.1 also have a included part that can update same way.

Maybe someone find it useful.

Change log v 1.1
Spoiler


MP functionality:
Spoiler


Instructions:
Spoiler


DMZ_delete.sqf
Spoiler


direct download: Dirty Demo 4Shared:
hosted by ArmaHolic, cheers to Foxhound.

Edited by Demonized, 18 July 2011 - 20:52.
added armaholic link

My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

bigshotking
bigshotking

    Gunnery Sergeant

  • Members
  • 410 posts

Posted 15 July 2011 - 21:35 #2

Great script love it!

Just a quick suggestion it would be cool if the bodies went into the ground instead of being deleted instantly.
Like when you go to a dead body an in the action menu you have the option to "Hide Body".

Either way this script is fantastic thanks for the release!

-Bigshot

P.S. You should update your signature with your new scripts!

Edited by bigshotking, 15 July 2011 - 21:39.


katipo66
katipo66

    Warrant Officer

  • Members
  • 2589 posts

Posted 15 July 2011 - 21:38 #3

Another very useful script, thanks!

& +1 for the hide body option
:icon_eek: :popcornsmilie:

1para{god-father}
1para{god-father}

    Sergeant Major

  • Members
  • 1794 posts

Posted 15 July 2011 - 21:40 #4

Great script !

kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

Posted 15 July 2011 - 21:49 #5

Just add a:

hideBody _del;
sleep 5;

above the deleteVehicle _del; line.

bigshotking
bigshotking

    Gunnery Sergeant

  • Members
  • 410 posts

Posted 15 July 2011 - 22:07 #6

Thanks Kylania for the piece of code!

Unfortunately it seems this script does not work in MP. I tested it on a non-dedicated server hosted on my pc. (I already know that it states that it was made for SP).

-Bigshot

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 16 July 2011 - 00:46 #7

updated to v 1.1
Change log:
* men now uses hideBody and sinks into ground before deleted, as requested by forum members.
* new option, DMZ_include, include ANY object with optional custom timer and distance check. can also be used to have custom timer on a special car unit etc..

will look into MP compatibility of this, maybe all thats needed is a if (isServer) check at the top.

for those testing, try placing this at the very top of the script:
edit: have added the MP test option to the Demo mission file and posted file, has no impact on SP usage.

that should maybe make it work on dedis and hosted server.
it will not include units in player groups and vehicles driven by players afaik.
unless vehicles not used by players will revert to server side again after player is no longer in command of vehicle.
also im not sure on the locality of the allDead array wich is used to check for dead men.
im hoping it is a global array that includes any dead man unit no matter client.

Edited by Demonized, 16 July 2011 - 00:57.
added info and updated post.

My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

bigshotking
bigshotking

    Gunnery Sergeant

  • Members
  • 410 posts

Posted 16 July 2011 - 01:11 #8

I just tested the updated script on a locally made server hosted on my computer and this was the result:

http://i409.photobuc...18-08-44-71.png

-Bigshot

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 16 July 2011 - 01:39 #9

:D awsome picture.

will keep looking into this, im doing tests on my own MP hosted on LAN to see whats wrong, will update on progress.

---------- Post added at 03:39 AM ---------- Previous post was at 03:28 AM ----------

@bigshotking
I have updated the demo mission, there was an error in the init.sqf used.
i forgot to comment out the tests i did with the DMZ_include option, thos objects was not in the mission, and then caused error so nothing was deleted.

all got deleted now on my own locally hosted server, MP internet and lan and in SP.

PS: i changed script again:
no noticable changes, i removed publicvariable lines as they are not needed since script only runs on server side.
publicvariable increases lag on MP games afaik, maybe just a teeny tiny bit, but they are out anyway now.
1st post updated.

Edited by Demonized, 16 July 2011 - 01:58.

My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

bigshotking
bigshotking

    Gunnery Sergeant

  • Members
  • 410 posts

Posted 16 July 2011 - 02:42 #10

It works! Thanks for the awesome script man!

Oh and here is another screen shot (Fixed Version):

http://i409.photobuc...19-39-00-55.png

In the screen shot you will see fire burning in thin air, that is where the vehicles used to be, but when they are deleted they leave the fire behind.

Personally I could care less about it, but I know that someone will ask you about it in the future. Just pointing it out now!

-Bigshot

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 16 July 2011 - 03:02 #11

the fire is just particle effects from the burning wreck, they should disappear after a short while.
My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

bigshotking
bigshotking

    Gunnery Sergeant

  • Members
  • 410 posts

Posted 16 July 2011 - 03:20 #12

Yes it does, I was just pointing it out so that you know and that if someone needs perfection and doesn't want to see the fire when there is no vehicle there. :D

-Bigshot

sxp2high
sxp2high

    Master Sergeant

  • Members
  • 779 posts

Posted 17 July 2011 - 01:47 #13

Looks great, thanks for sharing demonized. :thumbsup:
Posted Image

kremator
kremator

    Major

  • Members
  • 7529 posts

Posted 18 July 2011 - 12:18 #14

Hey Demonized,

Loving this script. However, it only works on all dead objects that are spawned at the start of the mission. Is there a way to add checks in for objects spawned AFTER the mission has started. I'm talking about missions like VTS, where you can spawn objects on the fly.

I CAN get it to work if I manually restart the script again, but it's a little clunky having to call it when EVERY object is spawned.

Here is a thing - IF I have one copy of the script running, and I run another, does it override the original (and restart the counter) ?

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 18 July 2011 - 14:12 #15

Hey Demonized,

Loving this script. However, it only works on all dead objects that are spawned at the start of the mission. Is there a way to add checks in for objects spawned AFTER the mission has started. I'm talking about missions like VTS, where you can spawn objects on the fly.

I CAN get it to work if I manually restart the script again, but it's a little clunky having to call it when EVERY object is spawned.

Here is a thing - IF I have one copy of the script running, and I run another, does it override the original (and restart the counter) ?


thats strange, i had asumed that the VTS would work same way as any other spawned units.
in the demo mission you have a radio trigger where you can spawn a stryker group as many times you like, and they get deleted just as well as others.
Is this an MP issue?

the script rechecks the complete list of dead and every vehicles every 10 seconds.

if you run a paralell script of this, the 1st script will take precedence, and the second timer will simply exit since the object is null.
i dont think it will create any special lag running multiples of this as its small in CPU usage, but if you would run it after any spawns, that would be ridiculus and for sure screw things up with the excluded included parts.
My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

kremator
kremator

    Major

  • Members
  • 7529 posts

Posted 18 July 2011 - 17:36 #16

Hmmm will have a look again tonight. So in your mind a single call at the start of a mission will apply to every unit spawned after?

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 18 July 2011 - 18:43 #17

in my mind :D yes.
the script is not collecting all units at start, it checks the ingame arrays of all vehicles and all dead and if they are meeting the condition and have not been already processed by the script, the script processes them.
then sleeps 10 seconds, and rechecks and so on and so forth..

it also readds respawned units with same name as the dead ones to the check list so they will again get deleted upon meeting the condition.

---------- Post added at 08:43 PM ---------- Previous post was at 08:34 PM ----------

you can verify that its collecting the spawned units by placing this in init.sqf and run your VTS mission and see if numbers change to what you expect.
make sure you have function module placed in editor.
if (isServer) then {
	_null = [] spawn {
		waitUntil {!isNil ("BIS_MPF_InitDone")};
		while {true} do {
			_hint = format["all dead units is %1 \n all vehicles is %2",(count allDead),(count vehicles)];
			[nil,nil,rHINT,_hint] call RE;
			sleep 1;
		};
	};
};

My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

kremator
kremator

    Major

  • Members
  • 7529 posts

Posted 18 July 2011 - 19:04 #18

Cheers mate .. will try this tonight !

EDIT: Retested again this evening, and it seems that it is working perfectly. I THINK I must have been too close to the dead enemy (I had set it to 300m!) and therefore the script didnt trigger!

Edited by Kremator, 18 July 2011 - 20:14.


foxhound
foxhound

    Retired Moderator

  • Members
  • 11374 posts

Posted 18 July 2011 - 20:41 #19

Release frontpaged on the Armaholic homepage.

Posted Image
DMZ Delete v1.1


Visit Armaholic.com | Visit Carriercommandaholic.com
Posted Image
Public FTP available, just check the Armaholic.com FAQ.

HMM........wonder what it is huh?

Thread Starter
Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

Posted 18 July 2011 - 20:54 #20

EDIT: Retested again this evening, and it seems that it is working perfectly. I THINK I must have been too close to the dead enemy (I had set it to 300m!) and therefore the script didnt trigger!

Just to clarify, the timer runs no matter the distance, but the delete waits for the distance check to be true.
i thought of resetting timer if player was to close, but figured the current would be the best way.

Release frontpaged on the Armaholic homepage.

Posted Image
DMZ Delete v1.1


cheers Foxhound.
My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.