Why the robot disppear as soon as they see me

Topics regarding Scripting with Reality Factory
Post Reply
planebus
Posts: 29
Joined: Thu Jan 14, 2010 7:23 am

Why the robot disppear as soon as they see me

Post by planebus » Wed Feb 10, 2010 5:55 am

Hi friends,
I get a question, Why the robot disppear as soon as they see me

{
start[ ()
{
//attribute
Console(true);
AttributeOrder("enemy_health",100,"Death");
HostilePlayer(true);
SetFOV(90);
FindTargetOrder(300,"FoundTarget","health");

//action
PlayAnimation("Idle", true, "");
Delay("Idle",3,"");
RotateMoveToPoint("walk",100,20,true,"footsteps\\m1.wav");
MoveToPoint("walk",50,"footsteps\\m1.wav");
NewOrder("Patrol");
} ]

FoundTarget[()
{

//DelTimerOrder(1);
LowLevel("AttackStart");
}
]

AttackStart[ ()
{
self.ThinkTime = 0.1; // start thinking on next frame
UpdateEnemyVis(); // upadte position of enemy
self.ideal_yaw = enemy_yaw; // set yaw direction to fly
ChangeYaw(); // rotate to face enemy
self.yaw_speed = 40;
walkmove(current_yaw, 40);
SetHoldAtEnd(true); // stop current animation
if (self.animate_at_end)
{
Animate("shoot"); // select jumping animation
SetHoldAtEnd(true); // repeat animation
}
} ]


Death[ ()
{
AnimateStop("die_1",3.58,"");
SetEventState("Enemy1Dead",true);
//FadeOut(0,10);
//Remove(true);
}
]

Patrol [()
{
NextPoint();
RotateMoveToPoint("walk",100,20,true,"footsteps\\m1.wav");
MoveToPoint("walk",100,"footsteps\\m1.wav");
RestartOrder();
}
]
}

Post Reply