Home   Help Search Login Register  

Author Topic: Removing bodies...  (Read 2914 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Removing bodies...
« on: 22 Sep 2008, 08:22:13 »
I have an amphibious landing mission with lot of fighting units in both side. Those units are generated. And dead units will be removed in every 60 seconds. There are two array for both side for the generated units and I checked the whole arrays and if an element not alive, deleteVehicle the element. It's worked.

But!

This is an amphibious landing and most infantry land by boats. If boat damaged, the infantry eject and swim. And if infantry not in the boat, the remove (deleteVehicle) script works. But if the infantry units are IN the boat, and somebody destroy the boat with a RPG, the infantry cannot deleted from the wreck.
Is it possible remove dead bodeis from a destroyed vehicle?
Fix bayonet!

Offline Odin

  • Members
  • *
Re: Removing bodies...
« Reply #1 on: 22 Sep 2008, 09:39:16 »
You more than liklely may be using this allready, for removing the dead from the vehicles, but I thought I would try, just to check.

Code: [Select]
_dead = _this select 0;
#remove
{deleteVehicle _x} forEach crew _dead;deleteVehicle _dead;

Odin

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Removing bodies...
« Reply #2 on: 22 Sep 2008, 12:12:31 »
Once a vehicle is destroyed, the crew members are all deleted, but that doesn't mean that the "crew proxies" are deleted. You see, when you get into a vehicle, the thing you see inside the vehicle isn't the same object as you are when you are running around, but rather a proxy, which isn't a proper "object" so can't be deleted (well, not a good explanation, but I hope you get the gist).

Once destroyed, a vehicle always returns [] for crew anyway, so you can't do anything anyway. You might try deleting all crew objects inside a KILLED event handler on the landing boat. They may still be "real" at that point.
« Last Edit: 22 Sep 2008, 18:09:40 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Removing bodies...
« Reply #3 on: 22 Sep 2008, 12:37:40 »
Just tested in OFP.

M113 named tank.
Radio Alpha trigger, on activation = tankD setpos getpos player.
Blow up the tank, wait a moment, activate radio. Body appears next to player.

EDIT - waiting more than a moment seemingly allows the driver to be forgotten...

EDIT 2 - popping tankD into an array seems to allow him to be remembered indefinitely.

EDIT 3 - bollocks, the array makes no difference.  :confused:
« Last Edit: 22 Sep 2008, 12:48:05 by bedges »

Offline i0n0s

  • Former Staff
  • ****
Re: Removing bodies...
« Reply #4 on: 22 Sep 2008, 14:15:45 »
Once destroyed, a vehicle always returns [] for crew anyway, so you can't do anything anyway. You might try deleting all crew objects inside a KILLED event handler on the landing boat. They may still be "real" at that point.
Sorry to say, but that is wrong. "crew" will return the crew, when you delete them, they don't show up after deleting the vehicle.
But there may be one point: It may be, that the crew at that point is local on every clients and that that script is required to run on every computer.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Removing bodies...
« Reply #5 on: 22 Sep 2008, 14:27:40 »
With OFP I remember that you had to delete the crew before deleting the vehicle. If there is no cargo I would use the built-in crew variables i.e. dVehicleName, gVehicleName, cVehicleName.
Strike that. I missed the fact that you had a cargo full of infantry.
« Last Edit: 22 Sep 2008, 17:21:35 by Mr.Peanut »
urp!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Removing bodies...
« Reply #6 on: 22 Sep 2008, 14:58:31 »
Errrr.... maybe you didn't understand. I don't want delete a crew! I want delete every dead soldiers... if crew or not!

I have an array with the all soldiers.... and I create new soldiers if the array size lower then a constant. But I don't creat new soldiers if size is large.
And the main problem is.... in the middle game (after 10-20 minutes) players got LAG. But there are no more soldiers.... Well I through those "dead bodies" in the vehicles cause lag, because the engine have to draw them... but they are not in the array... and my script generate more soldiers and engine have to draw (and count) more soldiers then the constant.
I want to reduce the LAG. This is the main objective.... And I hope I can reduce, if I can delete the dead soldiers everywhere, not just in the field, but in the vehicles too.


@Spooner: I understand what did you say. But it's mean: I cannot delete those proxies, I have to deleteVehicle the destroyed vehicle, and then the bodies (proxies) will delete too...? There is no other way to remove the dead bodies from the vehicle...?
« Last Edit: 22 Sep 2008, 15:01:56 by bardosy »
Fix bayonet!

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Removing bodies...
« Reply #7 on: 22 Sep 2008, 18:28:39 »
@Ionos and Bardosy: Sorry, my previous reply was very wrong in general but, still, the comment regarding proxies is relevant. You can delete someone inside a destroyed vehicle (still in crew), but the proxy model seems to remain visible. In further testing, the crew seemed to still contain the same people after they had been deleted, so I'm not entirely sure what is going on. I suspect the only answer would be to delete the vehicle in its entirety, but hopefully someone can shed some light on the matter.

There are numerous reasons why you might be getting lag after 10-20 minutes; unless you are killing ridiculous numbers of men, I can't see the odd man or two left in a burning vehicle causing significant lag in that time.
« Last Edit: 22 Sep 2008, 18:31:35 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Removing bodies...
« Reply #8 on: 23 Sep 2008, 12:26:17 »
Ok, Spoon, thanks for the answer... I don't know neither what case the lag, but I wanted a try...

Maybe I have to remove the burning, smoking destroyed boats (lot of them sink near the shore and they didn't shown anyway, but maybe the engine count them...) and this is an automatic generate script, and it check the number (count) of soldiers, but don't check the destroyed boats... It also could case lag. Maybe I have to delete the destroyed boats over a constant (if I delete all destroyed boats, it's reduce the mood...)

Can I check somehow if a boat is under the water?
Fix bayonet!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Removing bodies...
« Reply #9 on: 23 Sep 2008, 13:20:57 »
1 metre below sea level:
Code: [Select]
(myBoat getPosASL select 2) < -1
urp!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Removing bodies...
« Reply #10 on: 26 Sep 2008, 09:13:20 »
Thanks guys! I did it: I colleceted the destroyed ships to an array and if this array's size greater then 5, I deleted one...

But I found something else...

My boat and crew (driver and transported squad) generate script created by motivation of Mandoble's air support scripts.
And that script transport the squad until the driver is not ready. And when he is ready (in normal situation when he arrive to target position) he drop off the transported squad.
But in fighting situation, if our soldiers shoot to the ship, the driver will be ready :) and drop off the squad into the water. It's not a problem, it's VERY realistic. D-day's mood RULEZ! :D
But the soldiers in the water loose their weapons...
Sometimes I remove the unarmed soldiers, to keep up the fight. But the weapons still there in the water (or under the water - I don't know) .... But if I check the map - ingame - I saw a hundred "weapon crate" in the water. Is this could case LAG? And if yes, how can I delete those weapons in the water?
Fix bayonet!

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Re: Removing bodies...
« Reply #11 on: 26 Sep 2008, 12:44:13 »
I'm pretty sure these weapons are the only cause for the lag.
They remind me of the limited weaponcargo of vehicles, introduced in an OFP patch. Whenever a mission designer overloaded them, especially in multi player and the players interacted with the cargo, weapons and magazines were spilled on the ground and caused lag.

Remove the weapons already from the soldiers when they're ejected into the sea. Rearm them when they reach the beach.
Or disable the ejection into the sea.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Removing bodies...
« Reply #12 on: 26 Sep 2008, 12:51:30 »
Thanks!!!!  :good:

I cannot disable to reject them into the sea... I tried it.  :confused:
BUT... can I create a trigger in the sea and every 60 seconds I check a "thislist" array and if the object is a weapon, deleteVehicle _x. Is it possible? It could remove the weapons from the sea...


Is it possible? = How?  :whistle:
Fix bayonet!

Offline i0n0s

  • Former Staff
  • ****
Re: Removing bodies...
« Reply #13 on: 26 Sep 2008, 15:36:06 »
"WeaponHolder" is the class name of those drops.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Removing bodies...
« Reply #14 on: 26 Sep 2008, 16:08:56 »
And they ("WeaponHolder") wouldn't be detected by trigger, but you could search for them with nearestObject.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)