Page 1 of 1

Pawn problem

Posted: Sun Mar 23, 2008 4:48 am
by SSFlame
could anyone tell me why my pawn only does the animation that is specified in the bounding box animation instead of following what is written in the script

Re: Pawn problem

Posted: Sun Mar 23, 2008 11:21 am
by Sph!nx
You might want to add your script here so we could find it out for you.

Re: Pawn problem

Posted: Sun Mar 23, 2008 10:43 pm
by SSFlame
here is my script

{
Spawn[()
{
Console(true);
AttributeOrder("health",20,"Die");
FindTargetOrder(200,"Alert","health");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HoostileDifferent(false);
SetGroup("Enemy");
NewOrder("LostTarget");
}]

Alert[()
{
AnimateStop("alert",0,"");
LowLevel("Attack");
}]

LostTarget[()
{
PlayAnimation("idle",false,"");
FindTargetOrder(400,"Alert","health");
}]

Attack[()
{
self.ThinkTime=0.05;
self.yaw_speed=160
UpdateTarget();
if(self.enemy_vis=true)
{
self.ideal_yaw=self.enemy_yaw
ChangeYaw();
if(self.enemy_range>128)
{
SetHoldAtEnd(true);
Animate("attack");
self.think="Walk";
return 0;
}
else
{
TC=self.time;
Animate("attack");
self.think="Stand";
return 0;
}
}
}]

Walk[()
{
self.ThinkTime=0.05;
if(self.health=0)
{
HighLevel("Die");
return 0;
}
if(self.enemy_vis=true)
{
self.ideal_yaw=self.enemy_yaw
ChangeYaw();
}
else
{
SetHoldAtEnd(false);
HighLevel("LostTarget");
return 0;
}
if(self.animate_at_end=false)
{
if(walkmove(sled.ideal_yaw,50)=false)
{
if(random(1,10)>5)
{
ForceLeft(10);
}
else
{
ForceRight(10);
}
}
}
else
{
SetHoldAtEnd(false);
FireProjectile("sword","HandL",0,0,0,"health");
self.think="Attack";
return 0;
}
}]

Stand[()
{
self.ThinkTime=0.05;
if(self.health=0)
{
HighLevel("Die");
return 0;
}
if(self.enemy_vis=true)
{
self.ideal_yaw=self.enemy_yaw;
ChangYaw();
}
else
{
HighLevel("LostTarget");
return 0;
}
if(self.time>TC+1)
{
FireProjectile("sword","HandL",0,0,0,"health");
self.think="Attack";
return 0;
}
}]

Die[()
{
RestartOrder();
}]

}

Re: Pawn problem

Posted: Sun Mar 23, 2008 11:01 pm
by darksmaster923
maybe there has been no actions to trigger the pawn to do anything?

Re: Pawn problem

Posted: Sun Mar 23, 2008 11:19 pm
by SSFlame
is it because i did not put any script points

darksmaster923 how would i trigger these actions so the pawn will work

Re: Pawn problem

Posted: Mon Mar 24, 2008 12:09 am
by darksmaster923
well, it depends. if you didnt assign the pawn script points, it will not move, therefore playing the idle animation which is most likely the boundingbox animation. if there is no enemies, there will be no deaths, and it will idle.

Re: Pawn problem

Posted: Thu Mar 27, 2008 6:20 pm
by QuestOfDreams
You have some typos in your script e.g.
HoostileDifferent(false);
if(walkmove(sled.ideal_yaw,50)=false)