Hey Guys,
so I discovered GameGuru 2 Weeks ago, and I decided to make an advanced Horror Game.
I don't want to bother you with this stuff so I get to the point:
I watched LeeBambers Weeping Stone Babies Video yesterday, and I was fascinated with the Idea of Moving Statues.
Now I watched the Video severall Times, and did exactly what Lee did... but somehow in my Game, the Statues sometimes move when I look at them..
And now my Question: Can someone send me the moveunseen.lua script ? Maybe there is a mistake in mine.
I'll post it here so you can check it out:
-- LUA Script - precede every function and global member with lowercase name of script
g_StatueWait = {}
function ai_moveunseen_init(e)
g_StatueWait[e] = 0
end
function ai_moveunseen_main(e)
-- finds the viewing angle differene to the entity
dx = g_Entity[e]['x'] - g_PlayerPosX
dz = g_Entity[e]['z'] - g_PlayerPosZ
da = math.atan2(dx,dz) / 6.28 * 360.0
plra = g_PlayerAngY
if plra < 0 then
plra = plra + 360
end
if plra >=360 then
plra = plra - 360
end
diffa = plra - da
if diffa < 0 then
diffa = diffa + 360
end
if plra > 180 then
diffa = diffa - 360
end
PlayerDist = GetPlayerDistance(e)
if diffa<-45 or diffa>45 then
-- move the creature towards the player
if PlayerDist > 50 then
RotateToPlayerSlowly (e, 10.0)
MoveForward ( e, 100.0 )
end
else
if PlayerDist<= 50 then
--kill the player!!
if GetTimer(e) > g_StatueWait[e] then
HurtPlayer (e, 10 )
g_StatueWait[e] = GetTimer(e) + 100
end
end
end
--Prompt ( "plra=" .. plra .. " da=" .. math.floor(da .." diffa=" .. diffa
end