Home   Help Search Login Register  

Author Topic: erasing dead enemy units  (Read 1419 times)

0 Members and 1 Guest are viewing this topic.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
erasing dead enemy units
« on: 29 Oct 2004, 23:10:49 »
I found a script on this website designed for getting rid of the dead. I did as the readme said, but it kept saying "eraser.sqs not found. I triple checked to see if the script was indeed there and it was. I even left the game and restarted it, but with the same results. any ideas as to why?

This is what I put in the units init field:

this addeventhandler ["killed", {_this exec "erase.sqs"}]

this is the actual .sqs file:

; Select the Unit
_unit = _this select 0
;-Delay the delete after death
~10

;  delete the unit
deletevehicle _unit
exit


I'm am at a loss as to why the error keeps coming up.


Regards,
Trash Can Man

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:erasing dead enemy units
« Reply #1 on: 29 Oct 2004, 23:14:42 »
Maybe:

this addeventhandler ["killed", {_this exec "erase.sqs"}]


Should be:

this addeventhandler ["killed", {_this exec "eraser.sqs"}]


Planck
I know a little about a lot, and a lot about a little.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:erasing dead enemy units
« Reply #2 on: 29 Oct 2004, 23:58:22 »
I tried that....and the result is the same
 :(

Dubieman

  • Guest
Re:erasing dead enemy units
« Reply #3 on: 30 Oct 2004, 05:51:38 »
Hmm, I have the same script in my Dday mission...

Same errors too. And I made a copy of eraser.sqs (or whatever the original script name was) and renamed the copy erase.sqs to check if that was a problem...

But no that didn't work either and all my units are using eraser.sqs...
I've found that the error goes for my first dead guy, not sure if he dissapears or not, but all the other dudes with the script dissapear without incident. :-\ :P

EDIT: Oh yea, by now I've gotten rid of the copy script and everyone is usin the eraser.sqs, to clear up any confusion...
« Last Edit: 30 Oct 2004, 05:52:59 by GuiltyRoachKillar »

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:erasing dead enemy units
« Reply #4 on: 01 Nov 2004, 02:25:09 »
can you send me a copy of the script you are using?


Regards,
Trash Can Man

Dubieman

  • Guest
Re:erasing dead enemy units
« Reply #5 on: 01 Nov 2004, 03:07:34 »
 ???
Huh? The script I'm using doesn't work either, well, it works after the error message.

Code: [Select]
; Select the Unit
_unit = _this select 0
;-Delay the delete after death
~30

;  delete the unit
deletevehicle _unit
exit


With the eventhandler: this addeventhandler ["killed", {_this exec "erase.sqs"}]

But I musta put "eraser.sqs" in some eventhandlers and "erase.sqs" in others. I thought I could remedy it with both scripts in there... :P

Wish the error wouldn't show. Its rather weird that it works after and I can't consider removing it from a large dday like mission. :-\ :P

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:erasing dead enemy units
« Reply #6 on: 01 Nov 2004, 03:41:22 »
what does the error message say?

Offline ryankaplan

  • Members
  • *
  • yeah...
Re:erasing dead enemy units
« Reply #7 on: 01 Nov 2004, 22:23:58 »
just to save you time, you don't have to put this addeventhandler ["killed", {_this exec "erase.sqs"}] in every single units init field. make a big trigger covering everyone you want to delete when dead, set the condition to true and put this in on activation filed
 
{_x addeventhandler ["killed", {_this exec "erase.sqs"}]} foreach thislist

not sure if i wrote everything right.
it works for me...

Dubieman

  • Guest
Re:erasing dead enemy units
« Reply #8 on: 02 Nov 2004, 01:12:17 »
The error is the one where you have to click ok.
Its:
erase.sqs not found


And ryankaplan, I can't do that, do you know how funny that'd look on my dday beach, one moment 15 guys get an arty shell into the thick of them and bodies are strewn on the beach, 30 secs later after staying behind your rock due to MG fire, the bodies are not there and the beach is squeaky clean? :P

Plus once you run out of ammo, there'd be nothing to scavenge from. :)

But it still works, just that weird error... :P

m21man

  • Guest
Re:erasing dead enemy units
« Reply #9 on: 02 Nov 2004, 01:20:08 »
Quote
this addeventhandler ["killed", {_this exec "eraser.sqs"}]

Maybe this addeventhandler ["killed", {_this exec {eraser.sqs}}]

Dubieman

  • Guest
Re:erasing dead enemy units
« Reply #10 on: 02 Nov 2004, 01:27:21 »
Wait soz ryan, thought you meant all units, I take back my prior comment to you. Although that would be rather weird.

And M21man, maybe that'll work, gotta see. I've deleted many more units in my mission so it may not matter if I delete the remaining... :P

CrashnBurn

  • Guest
Re:erasing dead enemy units
« Reply #11 on: 02 Nov 2004, 03:42:54 »
M21man has the right syntax. It should fix the error you're getting. Also, you may want to consider not deleting all units as others have said. If you have a large enough scale of a mission to require deleting units in the first place, you should be using createunit command to fill in your battle(s). Adding the eventhandler to the created units and deleting them works fine, and the bodies from the original groups you placed in the editor will still be there to keep appearances proper,and scavenge items from. It's a good compromise I find works well. Here's the eventhandler I use for deleting units:
;---------------------------------------------
_unit = _this select 0
~15 + (random 30)
_unit removealleventhandlers "killed"
deletevehicle _unit
;---------------------------------------------

Just for kicks, here's my latest createunit script if you want it.

;simple create script by -CrashnBurn-.
;randomizes unit type, skill and rank.
;-------------------------------------
#TOP
_pos = _this select 0
_grp = _this select 1
_units = units _grp
;-----------------------------------------------------------------------------
_typeArray = ["SoldierEB","SoldierEG","SoldierELAW","SoldierEMedic","SoldierEB","SoldierEMG","SoldierEB","SoldierEG","OfficerE"]
_type = _typeArray select (random 8)
;---------------------------------------------------
_skillArray = [1.0, 0.9, 0.7, 1.0, 0.8, 0.9]
_skill = _skillArray select (random 5)
;---------------------------------------------------
_rankArray = ["SERGEANT","CORPORAL","PRIVATE"]
_rank = _rankArray select (random 2)
;-------------------------------------------------------------------------------
_type createunit [_pos,_grp,"this setunitpos {UP}; this allowfleeing 0; this addeventhandler [{killed},{_this exec {rid.sqs}}]",_skill,_rank]
;-----------------------------------------------------------------------------
~1 + (random 3)
_count = ({alive _x} count _units)
? (_count < 12): goto "TOP"
;Hint format ["%1 units were created", _count]
exit
« Last Edit: 02 Nov 2004, 04:29:24 by CrashnBurn »

Dubieman

  • Guest
Re:erasing dead enemy units
« Reply #12 on: 02 Nov 2004, 04:25:07 »
Looks useful. But I think I've gotten the troop numbers down enough from when I started, originally there were full 63 groups on both sides!, now its much less after some beta tests. Sooo many ppl on one beach, kinda gruesome, plus the mission was a pain in the ass. :)

Well I'll stop highjacking your thread now Trash Can Man. ;D

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:erasing dead enemy units
« Reply #13 on: 02 Nov 2004, 22:17:30 »
are you kidding???? Keep going!!! this is actually how I learn!!  HaHa. I love all the info you guys are sharing!! keep up the great work!

P.S.
So, is there an actual script I can use? after reading all that is posted, I became confused ???


Regards,
Trash Can Man
« Last Edit: 02 Nov 2004, 22:23:34 by Trash Can Man »

Northener-PNE

  • Guest
Re:erasing dead enemy units
« Reply #14 on: 09 Nov 2004, 21:15:23 »
This is what i use in my DM Ruins II mission:

erase.sqs

_body = _this select 0
;-Delay the delete after death
~30
deletevehicle _body
exit

and this in a players init line

this addeventhandler ["killed", {_this exec "erase.sqs"}]


Works fine for me. Here's my mission, rip it apart if ya like.  ;D
« Last Edit: 09 Nov 2004, 21:18:23 by Northener-PNE »