Pawn problem

Topics regarding Scripting with Reality Factory
Post Reply
SSFlame
Posts: 13
Joined: Mon Mar 17, 2008 10:26 pm

Pawn problem

Post 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
User avatar
Sph!nx
Posts: 297
Joined: Thu Feb 22, 2007 7:26 pm

Re: Pawn problem

Post by Sph!nx »

You might want to add your script here so we could find it out for you.
Regards Sph!nx

Sven Co-op, DevEd: Development & Editing
SSFlame
Posts: 13
Joined: Mon Mar 17, 2008 10:26 pm

Re: Pawn problem

Post 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();
}]

}
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: Pawn problem

Post by darksmaster923 »

maybe there has been no actions to trigger the pawn to do anything?
Herp derp.
SSFlame
Posts: 13
Joined: Mon Mar 17, 2008 10:26 pm

Re: Pawn problem

Post by SSFlame »

is it because i did not put any script points

darksmaster923 how would i trigger these actions so the pawn will work
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: Pawn problem

Post 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.
Herp derp.
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Pawn problem

Post by QuestOfDreams »

You have some typos in your script e.g.
HoostileDifferent(false);
if(walkmove(sled.ideal_yaw,50)=false)
Post Reply