Code: Select all
Mover (mover) -> Trigger -> Animate -> Entity -> SimpleEntity -> Listener -> Class
movedone( Entity finishedEntity )
Sent to commanding thread when done with move .Moderator: Moderators
Code: Select all
Mover (mover) -> Trigger -> Animate -> Entity -> SimpleEntity -> Listener -> Class
movedone( Entity finishedEntity )
Sent to commanding thread when done with move .or this from the global/movecrate.scr ( notice animdone as well )follow_player local.followed:
self.destination = local.followed
local.movethread = -1
self.movedoneradius = self.distance
if (vector_length (self.destination.origin - self.origin) > self.distance + self.friendrange)
{
self runto self.destination.origin
local.stand = 0
self waittill movedone
if !(self.destination)
self.destination = null
if (vector_length (self.destination.origin - self.origin) < self.distance + self.friendrange)
{
self exec global/stand.scr
}
}
else
{
if (local.stand == 0)
{
self exec global/stand.scr
local.stand = 1
}
wait 1
}
if (vector_length (self.destination.origin - self.origin) > self.distance + self.friendrange)
{
self runto self.destination.origin
local.stand = 0
thread movedone
local.movethread = parm.previousthread
}
if ((local.movethread != -1) && (local.movethread != NIL))
local.movethread delete
local.dest = self.destination.origin
local.runnertime = level.time + 2
while (((self.movedone == 0) && (vector_length (local.dest - self.origin) > (self.distance + self.friendrange))) && (local.runnertime > level.time))
{
if (self.waittime == -1)
waitframe
else
wait self.waittime
}
end
self holster
self type_attack "alarm"
self type_disguise "none"
local.o = local.cratetomove gettagposition "pickup"
self exec global/walkto.scr local.o
self waittill movedone
local.o = local.cratetomove gettagposition "box"
self exec global/turnto.scr local.o
local.distance = vector_length (self.origin - local.o)
println "distance to pickup crate '" local.o "' is " local.distance
if(local.distance > 45 )
{
println "crate guy " self.targetname " failed to get to " local.o
if(self.thinkstate == "curious")
println "cause of failure: curious"
self waitthread dropthecrate
end
}
self anim crate_pickup1
self waittill animdone
self.hasthecrate = 1
local.cratetomove hide
self anim crate_pickup2