OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: CaptainBravo on 25 Feb 2010, 11:28:12
-
Hey everyone,
I have been trying different vector commands with no sucsess in getting what I want. I want a bag fence to be facings down (towards ground)
I have managed to get it in all sorts of angles but down facing. Any help with the vectors are highly appreciated.
-
_obj = your_fence_object;
_angh = getDir _obj; // Desired horizontal direction (current direction of the fence)
_angv = -89; // Desired vertical inclination (inverted)
_angvu = _angv + 90;
_anghu = 0;
if (_angvu > 90) then
{
_angvu = 90 - _angv;
_anghu = _angh + 180;
}
else
{
_anghu = _angh;
};
_obj setVectorDirAndUp [[sin(_angh)*cos(_angv),cos(_angh)*cos(_angv), sin(_angv)], [sin(_anghu)*cos(_angvu),cos(_anghu)*cos(_angvu),sin(_angvu)]];
-
Thanks Mandoble , I appreciate your quick response. I hate to sound like a NooB but how do you use this script?
Is it possible to use the setVectorDirAndUp command or we need script?
this setVectorDirAndUp [[-89, -89, 0],[0, 0, 0]]
Thanks for your help.
-
Cough Cough .. hmm .. anyone with clairifccation? :whistle:
-
first you need to create the scriptfile like myscript.sqf .. then you need to call the script with something like this..
this execvm "myscript.sqf";