for the adult/mother you can use the standard velociraptor script
for the baby you need to create a new .fpe file with this info (basically just assigns the script and scales it correctly so it appears on the floor while moving - if you want smaller babies you will need to adjust the offy value or they will float)
;header
desc = velociraptor baby
;visualinfo
textured = velociraptor_D.dds
effect = effectbank\reloaded\character_basic.fx
castshadow = 1
;ai
aiinit = appear.lua
aimain = velo_baby.lua
aidestroy = disappear.lua
;Sound
soundset =
soundset1 =
;orientation
model = velociraptor.X
offx = 0
offy = -10
offz = 0
rotx = 0
roty = 0
rotz = 0
fixnewy = 0
defaultstatic = 0
materialindex = 3
isimmobile = 0
notanoccluder = 1
collisionmode = 1
scale = 66
;identity details
ischaracter = 1
isobjective = 0
;statistics
strength = 100
explodable = 0
debrisshape = 1
;spawn
spawnmax = 0
spawndelay = 0
spawnqty = 0
;anim
animmax = 8
anim0 = 546,661 ;idle
anim1 = 20,49 ;walk
anim2 = 128,150 ;run
anim3 = 176,265 ;look left
anim4 = 266,370 ;look right
anim5 = 371,470 ;bite
anim6 = 475,545 ;claw
anim7 = 662,705 ;death
playanimineditor = 0
you will also want to duplicate the bmp so you have a thumbnail for the model
once you have placed the mother you will need to get it's entity number and then input that into the baby script here (in place of the '?')
Quote: "--entity number of mum to follow
mum[e] = ?"
if you want to place more than 1 parent you need to specify which baby goes with which parent e.g.
Quote: "mum[6] = 5
mum[7] = 5
mum[8] = 5"
means babies with entity numbers 6 ,7 & 8 are following mum with entity number 5
there's no limit to the number of babies but it gets a bit crowded
now the script is here
velo_baby.lua
local alert_range = {}
--gets doubled if mum not nearby
local follow_speed = 90
--how fast to run if player gets near
local run_speed = 250
local angle_found = {}
local angle = {}
local mum = {}
local mum_range = 250
local scalesize = {}
local randomspeed = {}
local delay = {}
local heading_back = {}
local health = {}
local alert = {}
local turn = {}
--set animation frames here
--walking
local walk_start = 20
local walk_last = 45
--running / alerted
local run_start = 128
local run_last = 145
function velo_baby_init(e)
alert_range[e] = 600
angle_found[e] = 0
angle[e] = 0
heading_back[e] = 1
alert[e] = 0
--entity number of mum to follow
mum[e] = 2
--for other parents set them here
--number in [] is number of the baby and the number after the = is the mother
--[[ remove this line if using more than 1 parent
mum[6] = 5
mum[7] = 5
mum[8] = 5
--]] --remove this line too
randomspeed[e] = 50
delay[e] = 500
end
function velo_baby_main(e)
if health[e] == nil then
health[e] = g_Entity[e]['health']
ent = g_Entity[e]['obj']
end
--Scale(e,66)
--inital setup of model
if g_Entity[mum[e]] ~= nil then
if angle_found[e] < 0 then
local x = g_PlayerPosX - g_Entity[e]['x']
local z = g_PlayerPosZ - g_Entity[e]['z']
angle[e] = math.atan2(x,z)
angle[e] = angle[e] * (180.0 / math.pi)
if angle[e] < 0 then
angle[e] = 360 + angle[e]
elseif angle[e] > 360 then
angle[e] = angle[e] - 360
end
SetRotation(e,0,angle[e],0)
angle_found[e] = angle[e]
end
if GetPlayerDistance(e) <= alert_range[e] or g_Entity[e]['health'] < health[e] or AIGetEntityHeardSound(g_Entity[e]['obj']) == 1 or alert[e] == 1 then
alert[e] = 1
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,1)
SetAnimationFrames(run_start,run_last)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
MoveForward(e,run_speed)
--find the angle required to face the player
x = g_PlayerPosX - g_Entity[e]['x']
z = g_PlayerPosZ - g_Entity[e]['z']
angle[e] = math.atan2(x,z)
angle[e] = angle[e] * (180.0 / math.pi)
angle[e] = angle[e] - 180
if angle[e] < 0 then
angle[e] = 360 + angle[e]
elseif angle[e] > 360 then
angle[e] = angle[e] - 360
end
--update the new angle to be closer to player's position
SetRotation(e,0,angle[e],0)
heading_back[e] = 0
if GetPlayerDistance(e) > alert_range[e] * 2 then
health[e] = g_Entity[e]['health']
alert[e] = 0
end
else
if alert[e] == 0 then
if g_Entity[mum[e]]['health'] < 1 and GetDistance(e,mum[e]) < 150 and g_Entity[e]['health'] == health[e] and GetPlayerDistance(e) > alert_range[e] then
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,1)
SetAnimationFrames(walk_start,walk_last)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
else
if g_Entity[mum[e]]['health'] < 1 then
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,1)
SetAnimationFrames(walk_start,walk_last)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
turn[e] = math.random(1,20)
RotateY(e,turn[e])
MoveForward(e,follow_speed)
else
if GetDistance(e,mum[e]) < 50 then
CollisionOff(e)
else
CollisionOn(e)
end
if GetPlayerDistance(e) > alert_range[e] + 150 then
RotateToEntity(e,mum[e])
heading_back[e] = 1
end
if GetDistance(e,mum[e]) >= mum_range and heading_back[e] == 1 then
if GetTimer(e) > delay[e] then
randomspeed[e] = math.random(0,follow_speed)
delay[e] = GetTimer(e) + 500
end
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,1)
SetAnimationFrames(run_start,run_last)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
MoveForward(e,(follow_speed * 2) - randomspeed[e])
else
if GetTimer(e) > delay[e] then
randomspeed[e] = math.random(0,follow_speed/2)
delay[e] = GetTimer(e) + 500
end
if g_Entity[e]['animating'] == 0 then
ModulateSpeed(e,1)
SetAnimationFrames(walk_start,walk_last)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
MoveForward(e,follow_speed - randomspeed[e])
end
end
end
end
end
end
end --main
function velo_baby_exit(e)
StopAnimation(e)
ModulateSpeed(e,1.0)
SetAnimationFrames(662,705)
PlayAnimation(e)
end
function GetDistance(e,v)
if g_Entity[e] ~= nil and g_Entity[e] ~= 0 and g_Entity[v] ~= nil and g_Entity[v] ~= 0 then
local disx = g_Entity[e]['x'] - g_Entity[v]['x']
local disz = g_Entity[e]['z'] - g_Entity[v]['z']
local disy = g_Entity[e]['y'] - g_Entity[v]['y']
return math.sqrt(disx^2 + disz^2 + disy^2)
end
end
function RotateToEntity(e,v)
if g_Entity[e] ~= nil and g_Entity[e] ~= 0 and g_Entity[v] ~= nil and g_Entity[v] ~= 0 then
local x = g_Entity[v]['x'] - g_Entity[e]['x']
local z = g_Entity[v]['z'] - g_Entity[e]['z']
local angle = math.atan2(x,z)
angle = angle * (180.0 / math.pi)
if angle < 0 then
angle = 360 + angle
elseif angle > 360 then
angle = angle - 360
end
SetRotation(e,0,angle,0)
return angle
end
end
not my cleanest script ever but it works
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11