you mean .lua right?
the soldier does stand still using pet.lua, you need to press e to tell him to follow when you get nearby (when you can see the prompt)
give it an animation list like this in the fpe
Quote: "
anim0 = 0-45; stand
anim1 = 46-226; idle
anim2 = 227-317; roar
anim3 = 318-363; attack1
anim4 = 364-409; attack2
anim5 = 410-425; hurt1
anim6 = 426-441; hurt2
anim7 = 442-464; run
anim8 = 465-507; death"
then try this script and tell me what you get
dino.lua
local alert_range = {}
local attack_range = {}
local attacked = {}
local turn_speed = {}
local damage = {}
local state = {}
local speed = {}
local action = {}
local health = {}
function dino_init(e)
alert_range[e] = 700
attack_range[e] = 150
damage[e] = 25
turn_speed[e] = 6.5
speed[e] = 200
attacked[e] = 0
state[e] = "idle"
SetAnimation(1)
end
function dino_main(e)
if health[e] == nil then
health[e] = g_Entity[e]['health']
end
if GetPlayerDistance(e) <= attack_range[e] then
if GetPlayerDistance(e) > attack_range[e] /2 then
MoveForward(e,speed[e]/2)
end
if state[e] ~= "attack" then
state[e] = "attack"
end
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,3.0)
SetAnimation(3)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetAnimationFrame(e) > 350 and GetAnimationFrame(e) <= 363 then
if attacked[e] == 0 then
HurtPlayer(e,damage[e])
attacked[e] = 1
end
else
attacked[e] = 0
end
RotateToPlayer(e)
elseif GetPlayerDistance(e) <= alert_range[e] or state[e] == "alert" then
health[e] = g_Entity[e]['health']
if state[e] ~= "alert" and state[e] ~= "attack" then
state[e] = "alert"
StopAnimation(e)
ModulateSpeed(e,1.2)
end
if g_Entity[e]['animating'] == 0 then
if state[e] == "attack" then
state[e] = "alert"
ModulateSpeed(e,1.2)
end
SetAnimation(7)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
RotateToPlayerSlowly(e,turn_speed[e])
if GetAnimationFrame(e) > 441 then
MoveForward(e,speed[e])
else
MoveForward(e,speed[e]/2)
end
elseif GetPlayerDistance(e) > alert_range[e] then
if g_Entity[e]['health'] < health[e] then
StopAnimation(e)
g_Entity[e]['animating'] = 0
state[e] = "alert"
else
action[e] = math.random(1,1000)
if action[e] <= 100 then
if g_Entity[e]['animating'] == 0 then
SetAnimation(1)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
elseif action[e] <= 200 then
if g_Entity[e]['animating'] == 0 then
SetAnimation(2)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
else
if g_Entity[e]['animating'] == 0 then
SetAnimation(7)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetAnimationFrame(e) >= 442 and GetAnimationFrame(e) < 465 then
ModulateSpeed(e,1)
RotateToPlayerSlowly(e,turn_speed[e]/4)
MoveForward(e,speed[e]/2)
end
end
end
end
CollisionOn(e)
GravityOn(e)
end --main
function dino_exit(e)
ModulateSpeed(e,1.0)
SetAnimation(8)
PlayAnimation(e)
end
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11