Home   Help Search Login Register  

Author Topic: eraser script help  (Read 642 times)

0 Members and 2 Guests are viewing this topic.

Lazy Lays

  • Guest
eraser script help
« on: 20 Feb 2005, 20:45:15 »
Hey..
I need some help from you OFP experts

I am working on a mission where a US air field is under a attack for an enemy force,
I want the attack to be endless but with the maximum amount of 63 groups ? .... Nahhh we want more enemies to kill !!  
so I made some of the groups respawn

But now I have a field with a lot of corpses and they are slowing down my computer.
so I found this script  called eraser.sqs

The scripts readme ---->
eraser.sqs by shark attack
in the init field of unit you want to delete type the following codes

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

Now how do I add an init in a script ?
the soldier i want to delete is called eastgroup1m1
so how would the init line look like in a script ?

Sorry for my bad English

Please help...  
 

 

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:eraser script help
« Reply #1 on: 20 Feb 2005, 22:52:36 »
You are using createUnit, yes?   Check the example in the online comref in the Ed Depot.
Plenty of reviewed ArmA missions for you to play

Lazy Lays

  • Guest
Re:eraser script help
« Reply #2 on: 20 Feb 2005, 23:26:31 »
yes I'm using createUnit  :)
so my guess would be ---------->

"unittype" createunit [getpos position, groupname, "unitname = this", "init", skill, "rank"]

example:

"SoldierW" createunit [getpos Respawnpoint1, westgroup1, "macguba ( :) ) = this", "this addeventhandler ["killed", {_this exec "erase.sqs"}]", 0.5, "Private"]

offcause with out the smilie  ;)
Correct me if I'm  wrong

« Last Edit: 20 Feb 2005, 23:27:10 by Lazy Lays »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:eraser script help
« Reply #3 on: 20 Feb 2005, 23:32:48 »
 ;D

Nearly.  All the init stuff goes inside one string, with different bits separated by a semicolon ; as usual.    createUnit has no seperate field for name:  it just goes in the init line.   So you would have:-

"SoldierW" createunit [getpos Respawnpoint1, westgroup1, "macguba = this; this addeventhandler ["killed", {_this exec "erase.sqs"}]", 0.5, "Private"]

« Last Edit: 20 Feb 2005, 23:33:45 by macguba »
Plenty of reviewed ArmA missions for you to play

Lazy Lays

  • Guest
Re:eraser script help
« Reply #4 on: 21 Feb 2005, 16:34:12 »
Hmmmm error

This addeventhandler ["killed", {_this exec "erase.sqs"}]|#|", o.5, "Private": Error unknown operator

What to do ?

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:eraser script help
« Reply #5 on: 21 Feb 2005, 16:46:03 »
Might be the nested quotes in the init string; try:

"SoldierW" createunit [getpos Respawnpoint1, westgroup1, {macguba = this; this addeventhandler ["killed", {_this exec "erase.sqs"}]}, 0.5, "Private"]

Although "something" and {something} are supposed to be interchangeable, it's always better to put code strings in curly brackets because quotes around and in a string often conflict.

I say 'try' because I'm not able to!

Lazy Lays

  • Guest
Re:eraser script help
« Reply #6 on: 21 Feb 2005, 17:09:40 »
OMG it is working !      ;D
thanks alot for the help guys !      8)
Now I can complete my first mission !  :)
« Last Edit: 21 Feb 2005, 17:41:10 by Lazy Lays »