If you have one Helicopter, then change in the Avram's plane.lua script just few settings (see the picture).
Script "helicopter.lua" here (you can increase some numbers in "rotate", and add the sound with Volume level).
The script was upgraded now:
-- script by Avram, adapted for helicopter
-- save as helicopter.lua
-- the entity (helicopter) must be set as this: always active = on, physics = off
planes = planes or {}
SndPlaying = SndPlaying or {}
function helicopter_main(e)
planes[e] = planes[e] or {} --initialize plane data
planes[e]['speed'] = planes[e]['speed'] or 1600 + math.random(100,500) -- set plane speed (1600-2000)
planes[e]['turnspeed'] = planes[e]['turnspeed'] or 700 -- set turning speed
planes[e]['fallspeed'] = planes[e]['fallspeed'] or 1000 -- set falling speed
planes[e]['takeoffspeed'] = planes[e]['takeoffspeed'] or 700 -- set takeoff speed
local this = aEntity:new(e, "mustang") -- initialize entity obj
local state = this:attr("state") or "init" -- get current state [defaults to "init"]
local timer = aTimer:new(e) -- initialize timer
local dist = aPlayer:distance(this) -- get distance to player
this:watch_death() -- watch entity for it's death so we can respond to it
-- taking off
if state=="takeoff" then
timer:start() -- start timer
GravityOff(e) -- turn off gravity
if timer:between(0,3) then
MoveUp(e, planes[e]['takeoffspeed'] - (planes[e]['takeoffspeed'] * 0.7) ) -- start slower (3 secs)
elseif timer:between(3,6) then
MoveUp(e, planes[e]['takeoffspeed']) -- go at takeoff speed (another 3 secs)
elseif timer:greater(6) then
if (g_Entity[e]['y'] <= g_PlayerPosY+500) then -- pull nose up and increase height (takeoff) while below player
SendMessageF("setrotationx",e,-5);
SendMessageF("setpositiony",e,g_Entity[e]['y']+5)
else -- push nose down and set state to fly when above player, also stop the timer
SendMessageF("setrotationx",e,0);
state = "fly"
timer:stop()
end
MoveForward(e, planes[e]['takeoffspeed'] + (planes[e]['takeoffspeed'] * 0.7)) -- move at increased speed while taking off
end
end
-- turning
if state=="turn" then
MoveForward(e, planes[e]['turnspeed']) -- move at turning speed
timer:start() -- start timer
if timer:between(0,6) then -- rotate towards player for 6 seconds
RotateToPlayerSlowly(e, 2)
else -- after 6 seconds do this:
RotateToPlayerSlowly(e, 100) -- rotate to player
timer:stop() -- stop timer
state = "fly" -- set the plane into flying mode
end
end
-- falling down
if state=="fall" then
MoveForward(e, planes[e]['fallspeed']) -- move at falling speed
RotateX(e, 3) -- rotate a bit
RotateZ(e, 3)
RotateY(e, 3)
RotateX(e, 5) -- rotate a bit again
RotateZ(e, 5)
RotateY(e, 0)
RotateX(e, 7) -- rotate a bit again
RotateZ(e, 7)
RotateY(e, 0)
SendMessageF("setpositiony",e,g_Entity[e]['y']-1); -- move down
timer:start() -- start timer
if timer:greater(3) or g_Entity[e]['y']<=650 then -- after 3 seconds of falling down or if hit the ground
state = "down" -- change state to down
timer:stop() -- stop the timer
StopParticleEmitter(e) -- stop smoke
SetEntityHealth(e, 0) -- destory (explode) the plane
end
end
-- flying straight
if state=="fly" then
MoveForward(e, planes[e]['speed']) -- move at defined speed
if (math.random(1, 10) == 2) then -- in 10% cases rotate plane a bit and change it's height
RotateX(e, math.random(-10, 10))
RotateZ(e, math.random(-10, 10))
SendMessageF("setpositiony",e,g_Entity[e]['y']+math.random(-10, 10));
end
end
-- initialization
if state=="init" then
GravityOff(e) -- turn gravity off
state = "takeoff" -- take off
end
-- if too far from the player, set to turning state
if state=="fly" and dist > 9000 then
state = "turn"
end
if state=="fly" and dist < 9000 then
LoopSound(e, 0)
SetSoundVolume(80)
end
-- if flying and is shot to death (while keeping entity alive), set falling state and start smoke
if state=="fly" and this:is_dead(true) then
state = "fall"
StartParticleEmitter(e)
StopSound(e, 0)
end
this:attr('state', state) -- store the (modified) state
end
And one small video here:
Smile today, tomorrow could be worse
http://bestradiolarry.ro/fpsarea
"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."