Home   Help Search Login Register  

Author Topic: script to remove ( or hide ) dead infantry.  (Read 1075 times)

0 Members and 2 Guests are viewing this topic.

oneillcol

  • Guest
script to remove ( or hide ) dead infantry.
« on: 11 Sep 2002, 12:39:01 »
Anybody know of a script to remove ( or hide ) infantry bodies ( but not destroyed tanks or jeeps ) when the player has moved 500m away from the "battle area", without specifically naming each unit in the script.

zsa_zsa_rasputin

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #1 on: 11 Sep 2002, 13:05:19 »
you mean like the Spec. Ops. soldiers special ability to "Hide body"...?

Dan  ;D

oneillcol

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #2 on: 11 Sep 2002, 13:07:18 »
yep hiding them would do - but I'd like to find a way to remove them altogether.....

Respined

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #3 on: 15 Dec 2002, 14:23:23 »
You can try this but i bet this won't work

put your unit init field this syntax

this setaction "HIDEBODY" :'(

Respined

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #4 on: 15 Dec 2002, 14:25:39 »
 8) put this syntax to your man init field

i bet this wont work this setaction "hidebody"

Baphomet

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #5 on: 16 Dec 2002, 08:21:32 »
I'd like to see something similar to this as well. Something to just get rid of stuff once you've made it to a certain distance so that it isn't unnecessarily bogging down one's performance.

Then again I'd also like to see some kind of generic script that spawns enemies either during an interval or when triggered, which are then instructed to move to certain territories setting off a trigger that detects how many units in the squad are in the conquered territory and saves it to a value to be retrieved if the player gets too far away and deletes the units for to maintain performance. I would love to make a JA2 style mission, however the main problem resides in the fact that not everyone owns a 3.6ghz machine that can have 600+ (exaggeration?) units on the map at a time without performance taking a hit.

A logical step would be to spawn enemies when necessary and have the script intelligently handle how dead bodies are removed and when new soldiers should be spawned or removed and then spawned again if the player gets too far away and then returns. Come to think of it this has about as much likelihood of being made as the JA2 campaign that was started a while back and never heard of again. Still it'd be a good idea and it would have a lot of potential for large scale missions where it isn't necessary to have 200+ units in the game at the same time.

oneillcol

  • Guest
Re:script to remove ( or hide ) dead infantry.
« Reply #6 on: 16 Jan 2003, 15:20:11 »
HERE IT IS - Found the solution within the Editors Depot,
Here's to dreaming_adam. :D

http://www.ofpec.com/editors/browse.php?browsewhat=0&category=0_10

Or read below - Havent tried it out, but will tonight....

--------------------------------------------------

Lag Eliminator (DELETE DEAD BODIES)
by dreaming_adam

Tutorial complexity: 3 (Intermediate)

Recommended for OFP version 1.75 (OFP: Resistance).

Views: 562

   

The following will remove any objects that have been destroyed after a predetermined delay. That means, if you kill somebody on a MP map, the body will dissapear after x seconds - preventing lag created by a huge mass of useless objects. This script will work for ALL units that are not apart of the landscape. That means, if you blow up a tank, after x seconds the tank will be removed. I have tested this and it works for tanks, infantry, helos, planes, boats, and buildings that you place IN the editor using the object addon.

It is relatively easy to exclude objects from the script, so that a particular objects carcus will remain on the map.

STEP ONE:

Insert a trigger central on the map. Set the x and y axis fields to 99999, set the ACTIVATION to ANYBODY, and set it to REPEATEDLY.
Next set its name to EVERYUNIT.

STEP TWO:

Leave the editor and set up the following scripts.

clearcorpse.sqs

#loop
_eunit = list EVERYUNIT
"?(!alive _x):[_x] exec {delbody.sqs} foreach _eunit
goto "loop"
exit


delbody.sqs

_u = _this select 0
~60
_u setpos [0,0,99999]
deletevehicle _u
exit


In the delbody.sqs file, the ~60 is the delay before the body will be removed.

Place these scripts in your missions folder (usually c:\program files\codemasters\operation flashpont\users\yourname\mpmissions\yourmissionname\ ) and then put "[] exec {clearcorpse.sqs}" in any units init field, or in INIT.SQS.

VIOLA!!!

This script will work for units that are created runtime, and units do not have to be given names.
« Last Edit: 16 Jan 2003, 15:25:41 by oneillcol »

oneillcol

  • Guest