OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: sharkattack 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
-
in unit init
this AddEventHandler ["killed",{this addaction ["Hide Body","hidebody.sqs"]}]
hidebody.sqs
_body = _this select 0
_act = _this select 2
_body removeaction _act
hideBody _body
exit
hope it works :D
LCD OUT
-
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 !
-
From memory of someone's OFP script:
bury.sqf
_this removeAllEventHandlers "KILLED";
hideBody _this;
sleep 5;
deleteVehicle _this;
And in the unit init:
this addEventHandler ["KILLED", {nul = (_this select 0) execVM "bury.sqf"}]
Edit: ack! new command hideBody! changed my code above after reading post below!
-
If U are happy with immediately sink into the ground effect U can use this line:
this addeventhandler["killed",{HideBody (_this select 0)}]
-
@ LCD
Your syntax isn't correct for the part you put in the unit's init field for AddAction.
You have this addaction "hidebody.sqs"
When the correct (at least basic, working) syntax would be something like this addaction ["Hide Body","hidebody.sqs"]
Just thought I would mention it ;)
in unit init
this AddEventHandler ["killed",{this addaction "hidebody.sqs"}]
-
lol.... dats wat happens wen u rush tings :D... nyways... it fixed now... :D :cool2:
LCD OUT
-
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
-
never do stuff in a rush :no: i edited it tho :D
dont blame me blame my job :D
LCD OUT
-
thanx a lot LCD ...
will try it out and let you know
cheers mate !! :good:
=========
EDIT
dosnt work body twitches but is not removed
-
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
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
-
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:
_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:
this addEventHandler ["killed", {_this execVM "removeBody.sqf"}]
Next, add this script to your mission directory, saving it as "removeBody.sqf:"
_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.
-
i think dat will do da same as my script :whistle: i just didnt put delay 2 it ?
:D :cheers:
LCD OUT
-
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
-
LOL :D
no were not :D
LCD OUT
-
DucusSumus script works ... dead bodies are removed however id like the player to have a choice to hidebody with action menu ... any ideas ?
many thanx
hideBody works the same ... how do i add action
-
try da script now (in ma 1st post)
LCD OUT
-
perfect ...
many thanx mate ! :good:
-
finally :D
good luck w/ dat mision m8
:cool2:
LCD OUT
-
Hm, my code was missing a pair of curly braces.