OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: myke13021 on 20 Aug 2007, 02:24:06

Title: Dead Body and object remover (DELETED)
Post by: myke13021 on 20 Aug 2007, 02:24:06
Retiring all works from public. Has nothing to do with OFPEC nor with any member of OFPEC.
Title: Re: Dead Body and object remover
Post by: Mandoble on 20 Aug 2007, 10:14:38
At first glance there is a limitation there, as it seems to work only with units already present on the map when the init script is executed. That means that the script will ignore all dynamically created units.
Title: Re: Dead Body and object remover
Post by: myke13021 on 20 Aug 2007, 14:10:15
indeed, it is but i've got already plans to remove this limitation. Thought too late on this issue.
Reworked. Check first post.


Myke out
Title: Re: Dead Body and object remover
Post by: Mandoble on 21 Aug 2007, 01:49:29
You may create the trigger inside your script this way:
Code: [Select]
   _trigger = createTrigger ["EmptyDetector", _position];
   _trigger setTriggerActivation ["ANY", "PRESENT", false];
   _trigger setTriggerArea [_maxrange, _maxrange, 0, false];
   _trigger setTriggerType "NONE";
   _trigger setTriggerStatements ["this", "", ""];
   _trigger setTriggerTimeout [0, 0, 0, false ];

Then you may check
Code: [Select]
list _trigger every desired time period, the list of the trigger will keep updated all the time until you delete the trigger.
Title: Re: Dead Body and object remover
Post by: myke13021 on 21 Aug 2007, 02:07:52
hmmm...you mean create a trigger that already covers the whole island? Indeed, but i think this way it keeps flexible whenever new Islands come out (whenever BIS releases the tools for) to be used on them also. I don't think to place the trigger/s manually is a great downgrade. But let me reflect on this a while....btw, is there a way of detecting actual map/island size? As you might see, the trigger needs another size on Rahmadi than on Sahrani.
Title: Re: Dead Body and object remover
Post by: Mandoble on 21 Aug 2007, 02:25:22
How about a trigger with 100Km radious, would that be big enough to cover any future island?  ;)
Title: Re: Dead Body and object remover
Post by: myke13021 on 21 Aug 2007, 02:32:46
Quote
How about a trigger with 100Km radious, would that be big enough to cover any future island?
rofl...any future island...let first fill out my lottery as i want to be rich asap. But i guess it will be big enough. But another question: will performance not be affected by the size of a trigger? As it has a bigger area to check for units? Hmmm...probably one single giant trigger wouldn't be noticeable. OMG, already answering my own questions...got to visit my psycho-dad...erm, meant psycho-doc  ;)

I think i'll give it a go...tomorrow :D
Title: Re: Dead Body and object remover
Post by: Mr.Peanut on 21 Aug 2007, 16:25:47
It should be possible to get the world size from the config. Perhaps hoz or Planck knows how to do this.
Title: Re: Dead Body and object remover
Post by: hoz on 21 Aug 2007, 16:51:32
I don't think you can get the exact size from the config, but you can return the lat, long, size of landgrid and maybe do some math to calculate that.

Code: [Select]
_cfg =(configFile >> "cfgWorlds" >> worldName);
_Lat = getNumber (_cfg  >> "latitude");
_Lng = getNumber (_cfg  >> "longitude");
_LandG = getNumber (_cfg  >> "landGrid");


For sara landGrid = 40;
Title: Re: Dead Body and object remover
Post by: Mandoble on 21 Aug 2007, 17:24:48
You dont need the exact size, you only need a trigger big enough to cover any island. The size of a trigger does not affect the performance.
Title: Re: Dead Body and object remover
Post by: Mr.Peanut on 21 Aug 2007, 19:21:52
Are latitude and longitude single values i.e. center of grid, or arrays with two values? And what exactly is landGrid?

Approximate formulae:
(lat2-lat1)*111.111 = approx distance between two lats in km.
(lon2-lon1)*111.111*cos((lat2+lat1)/2) = approx distance between two lons in km.

Formula are only accurate for small distances (< 1000 km) and at points away from the poles (70S>lat<70N).

A trigger's size may affect performance depending on the complexity of the trigger condition.
Title: Re: Dead Body and object remover
Post by: hoz on 21 Aug 2007, 20:20:15
  longitude = -40.02;
  latitude = -39.95;

Not sure what land grid is I through that in there for confusion and see it worked. :D
Title: Re: Dead Body and object remover
Post by: Planck on 21 Aug 2007, 20:44:05
landGrid is the smallest terrain cell size for a particular island .wrp file.

For the old OFP islands it was 50, which means the grid was 50m X 50m
Each grid square was occupied by one texture. (OFP only)

As each smallest grid was this size and you needed 256 X 256 of them to cover the whole map, which is of course 65,536 grid squares, giving a map size of 12.8km X 12.8km. (163.84 sq km)

Sara on the other hand has a grid of 40 which means 40m X 40m

Needing 512 X 512 to cover the whole map and giving a map size of 20+km X 20+km. (400+ sq km)

Or so...


Planck

Title: Re: Dead Body and object remover
Post by: myke13021 on 02 Sep 2007, 20:12:35
Indeed, this could really work but at some stage i think it would be too much taken out of the hand of missions creator, even if it's customizable. I don't think it's too much downgrade to ask a missiondesigner to plant one single trigger.

Surplus, i finished a "coop essentials" package which contains the DGC:r, the Body removal system and an ambush/reinforcement system.
Therefor i think the Body & Object remover is good as is.

Tell me if you have a completely another opinion.


Myke out
Title: Re: Dead Body and object remover (TESTING)
Post by: Mandoble on 29 Sep 2007, 11:56:29
There are several main issues:.
Case 1: You have a "repeatedly" trigger covering an area with a group of units inside and the units get their corresponding event handlers. But the group moves away of the triggers area pursuing some enemies and the trigger deactivates. Then the remaining units return inside trigger's area, the trigger activates again and each unit gain a new added event handler. And so on as long as the group leaves the trigger's area and enters the trigger's area again.

Case 2: You set a trigger (repeatedly or not) covering the desired area without units inside the area. And a group moves inside the trigger's area, but all the units of the group are not teleported inside trigger's area at once. When the very first unit of the group enter's the area, the trigger activates, and the trigger's list contains that single unit (which receives the event handler). The rest of the group doesnt get any event as the trigger will not activate again unless deactivated if not units are present again.

Case 3: You set a trigger covering the desired area without units inside. The trigger is activated by their presence and each unit gets its event handler. Now a second group enters the area, but the triggers has not been deactivated, so the presence condition is still true and the activation action is not executed. As a result, none of the new units gets the corresponding event handler.


In case this remove dead bodies method is used in "coop essentials", the same problems would be present there.
Title: Re: Dead Body and object remover (TESTING)
Post by: Spooner on 29 Sep 2007, 12:23:53
You can find out the centre of the map quite easily, which is the best place to put your "universal-trigger":
Code: [Select]
_centre = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
Title: Re: Dead Body and object remover (TESTING)
Post by: D007 on 08 Aug 2008, 05:58:01
Having a lot of trouble with this body remover script.. Maybe I'm just not using it right.. I copied your triggers though from the body remover1 example mission you made and put them into our mission.  My brother and I beta test in mulltiplayer before we release anything. we find that at least 5 of his men will not be removed but all of mine will be.. I don't get it..

We have tried all kinds of methods, but nothing seems to work reliably.. could you please help me figure out how to do this correctly?
We'd really appreciate any insight to this.
Also when we try to use this on the server nothing happens at all.
when I use it on Lan only the hosts body will disappear but not any other players bodies. AI bodies will delete fine, but not player bodies. (except the hosts)
 I'd like to use this script so please if you can, get back to me.. thanks a bunch.
Title: Re: Dead Body and object remover (TESTING)
Post by: Spooner on 09 Aug 2008, 09:44:49
To make this script work properly in MP games, edit dynbr/dynbr_init.sqf and remove the line:
Code: [Select]
if (! isServer) exitwith {};

What you are seeing is that objects cannot be deleted/hidden when they are not local to the script performing the action. If the script is only run on the server, as it is by default, then only server-local objects will be deleted (players, and player-controlled AI and vehicles, are local to their respective client machines).

I haven't tested this myself, but I'm 98% sure this is the issue based on your description of the fault.
Title: Re: Dead Body and object remover (TESTING)
Post by: D007 on 17 Sep 2008, 10:16:19
Ahh.. I've been digging for this... ty Spon.
that worked for it's purpose.

Still wouldn't delete on the server after creation though.

Code: [Select]
_XXXX addeventhandler ["killed", {_this execVM "DynBr\DynBr_remove.sqf"}];

Example:
Code: [Select]
If (not(_itemclass iskindof "man"))then {_veh = _itemClass createVehicle (getPos player);_veh addeventhandler ["killed", {_this execVM "DynBr\DynBr_remove.sqf"}];_veh reveal player;clearWeaponCargo _veh;clearmagazinecargo _veh;player reveal _veh;_veh addaction ["[Lock\Unlock]", "Locker.sqf"];_veh addaction ["[Vehicle stats]", "vehicle_stats.sqf"];};

even that doesnt work..
Works on Pc though..  ug..