OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 01 Jul 2007, 13:19:31
-
it shud not b a very complex ting but it includes maths nd i used 2 skip dese classes wen i cud learn em :D :confused:
i wanna set my vehicles velocity streit ahead... now i know dat wen used simple da setvelocity [x,y,z] moves my vehicle on da map not considering my vehicles heading...
now i wanna push da vehicle streit 2 were it heads
LCD OUT
-
Try this
// Accelerate.sqf
_vehicle = _this select 0;
_speedmax = _this select 1;
_acceleration = _this select 2;
_seconds = _this select 3;
_vdir = vectorDir _vehicle;
_speed = speed _vehicle / 3.6;
_timeini = dayTime * 3600;
while {(dayTime * 3600) < (_timeini + _seconds)} do
{
if (_speed < _speedmax) then
{
_speed = _speed + _acceleration;
};
_vehicle setVectorDir _vdir;
_vehicle setVelocity [(_vdir select 0)*_speed, (_vdir select 1)*_speed, -1];
Sleep 0.01;
};
-
da prob is sometin else... i have a heli script (in my mision) were da heli seems 2 miss its target if he has 2 make right turn (i scripted da heli 2 avoid flyin above town)... what happens is dat it flies 2 much 2 da south (chop starts flyin north towards south) and misses its destination... so i have a setdir setting its heading 2 da right place but after dat it returns flying south all by itself (without turnin its face back south)
so i dont wanna accelrate da chopper toward da dirction 4 more dan a second or so
LCD OUT