Home   Help Search Login Register  

Author Topic: hiding the dead  (Read 2789 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
hiding the dead
« on: 30 May 2007, 20:17:56 »
guys ..
im trying to include this  option in a mission ... ive seen it done using the  bas  editor  thing ... but cant get my head around it ...
havnt quite sussed  SQF

I know i need to add a killed event handler to units which are hideable and  call a script to hide the body   but  im unsure  how to do this  have  played  about  but  with   no  joy  ...

any example  of how to do this   would  be  greatly  appreciated !    :)

many thanx  guys



"HOLY SARDINE" - see Shark-Attack meet his match

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #1 on: 30 May 2007, 20:25:33 »
in unit init

Code: [Select]
this AddEventHandler ["killed",{this addaction ["Hide Body","hidebody.sqs"]}]
hidebody.sqs

Code: [Select]
_body = _this select 0
_act = _this select 2

_body removeaction _act

hideBody _body

exit

hope it works :D

LCD OUT
« Last Edit: 02 Jun 2007, 11:49:55 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline sharkattack

  • Former Staff
  • ****
Re: hiding the dead
« Reply #2 on: 30 May 2007, 21:13:17 »
hey  mate  ...  im sure it will ...   will update  and let you know...

if  youre  ever in  Northumberland  im  buying  the pints ...  :good:

many  thanx   mate !
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: hiding the dead
« Reply #3 on: 30 May 2007, 21:50:51 »
From memory of someone's OFP script:

bury.sqf
Code: [Select]
_this removeAllEventHandlers "KILLED";
hideBody _this;
sleep 5;
deleteVehicle _this;

And in the unit init:
Code: [Select]
this addEventHandler ["KILLED", {nul = (_this select 0) execVM "bury.sqf"}]

Edit: ack! new command hideBody! changed my code above after reading post below!
« Last Edit: 02 Jun 2007, 20:03:50 by Mr.Peanut »
urp!

Offline FreeBird

  • Members
  • *
Re: hiding the dead
« Reply #4 on: 31 May 2007, 23:30:53 »
If U are happy with immediately sink into the ground effect U can use this line:

Code: [Select]
this addeventhandler["killed",{HideBody (_this select 0)}]
« Last Edit: 02 Jun 2007, 13:06:26 by FreeBird »
Call [This,Birth,School,Work,Death]execVM "Storyofmylife.sqf"
(_this select 1)ObjStatus "DONE";(_this select 2)ObjStatus "DONE";(_this select 3)ObjStatus "ACTIVE";(_this select 4)ObjStatus "HIDDEN";
if not((_this select 0) IsKindOf "Human")ExitWith{PlayMusic"Goodbye Cruel World"}

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: hiding the dead
« Reply #5 on: 01 Jun 2007, 02:16:28 »
@ LCD

Your syntax isn't correct for the part you put in the unit's init field for AddAction.

You have
Code: [Select]
this addaction "hidebody.sqs" When the correct (at least basic, working) syntax would be something like
Code: [Select]
this addaction ["Hide Body","hidebody.sqs"]
Just thought I would mention it  ;)

in unit init

Code: [Select]
this AddEventHandler ["killed",{this addaction "hidebody.sqs"}]
« Last Edit: 01 Jun 2007, 02:18:34 by JasonO »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #6 on: 01 Jun 2007, 06:22:22 »
lol.... dats wat happens wen u rush tings  :D... nyways... it fixed now... :D  :cool2:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline sharkattack

  • Former Staff
  • ****
Re: hiding the dead
« Reply #7 on: 01 Jun 2007, 18:48:48 »
hi  fellas   no  luck im afraid

@ mr peanut
error missing ]

@LCD
fault in script
-body * removeaction error  _act error removeaction type object.expected number ...

tried  fidiling  with  scripts  but  cant  fix it  ...  any  ideas  ?
many thanx  in advance
"HOLY SARDINE" - see Shark-Attack meet his match

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #8 on: 01 Jun 2007, 20:22:20 »
never do stuff in a rush  :no: i edited it tho :D

dont blame me blame my job :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline sharkattack

  • Former Staff
  • ****
Re: hiding the dead
« Reply #9 on: 01 Jun 2007, 20:26:21 »
thanx  a lot  LCD  ...
will try it out   and  let you know
cheers  mate !!  :good:

=========
EDIT
dosnt  work  body twitches   but is not removed
« Last Edit: 01 Jun 2007, 20:38:15 by shark attack »
"HOLY SARDINE" - see Shark-Attack meet his match

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #10 on: 01 Jun 2007, 21:47:08 »
after checkin da situation in arma... it seems da ground in arma dont like swallowing bodies (unlike OFP)  :dunno: so noting i can do bout dat sry... if none of da oder suggestions work... u can always replce da script w/ simple delete vehicle script

Code: [Select]
deleteVehicle (_this select 0)

exit

da effect is ugly but it works... nd u cud use some animation 2 make it nicer 2 da eye

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline DucusSumus

  • Members
  • *
  • I'm a llama!
Re: hiding the dead
« Reply #11 on: 01 Jun 2007, 21:53:03 »
NOTE: All of this was originally written by Fer and Raedor for the BAS Framework.  I've modified the code slightly to make it more general. 

Shark Attack:
To begin with, append this to your init.sqf or init.sqs file, replacing "dude1,dude2,etc" with the names of the units for which you want bodies to be removed:

Code: [Select]
_men = [dude1,dude2,etc];
{_x addEventHandler ["killed", {_this execVM "removeBody.sqf"}]} forEach _men;

If you'd rather not touch your init file, you could just add the previous line (minus the forEach stuff) to each unit's init line:

Code: [Select]
this addEventHandler ["killed", {_this execVM "removeBody.sqf"}]
Next, add this script to your mission directory, saving it as "removeBody.sqf:"

Code: [Select]
_body = _this select 0;

sleep 180;
deleteVehicle _body;

You can change the 180 to whatever you wish the delay to be before a body is removed. 

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #12 on: 01 Jun 2007, 21:55:00 »
i think dat will do da same as my script  :whistle: i just didnt put delay 2 it ?

:D :cheers:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline SEAL84

  • Members
  • *
  • Always lurking
Re: hiding the dead
« Reply #13 on: 02 Jun 2007, 01:18:41 »
Are you all aware that there's a hidebody command in ArmA now?

http://ofpec.com/COMREF/index.php?action=list&game=All&letter=h#hideBody

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: hiding the dead
« Reply #14 on: 02 Jun 2007, 07:29:35 »
LOL :D

no were not :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta