OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: tilyard on 23 Jun 2011, 20:23:29

Title: How do I get the C-130 Static?
Post by: tilyard on 23 Jun 2011, 20:23:29
I need a static C-130 and I don't know how to make it static. Do I give it a script/edit it/download it?
Title: Re: How do I get the C-130 Static?
Post by: Zipper5 on 25 Jun 2011, 12:08:00
You definitely need it for ArmA, not Arma 2?

With ArmA it may be a little bit more complex to accomplish, but it is still possible. A setVelocity (http://www.ofpec.com/COMREF/index.php?action=details&id=321&game=All) and setDir (http://www.ofpec.com/COMREF/index.php?action=details&id=293&game=All) loop is the easiest but perhaps not the most ideal, mainly because it can have a negative performance impact due to the never-ending loop. To accomplish this, you would need something like this script:
Code: [Select]
/*
_this select 0 - C130 name
_this select 1 - direction
_this select 2 - altitude
*/

_c130 = _this select 0;
_dir = _this select 1;
_alt = _this select 2;

if (!(isNull driver _c130)) then {
driver _c130 disableAI "MOVE";
};

while {true} do {
_c130 setDir _dir;
_c130 setPos [(getPos this select 0), (getPos this select 1), _alt];
sleep 0.05;
};