full badguy 1 script help

Topics regarding Scripting with Reality Factory
Post Reply
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

full badguy 1 script help

Post by megatop » Fri Nov 25, 2011 2:48 pm

I did all the coding for the pawn.ini and everything like that and I place the actor in my rf editor but hes not in the game. Please help thanks.

Code: Select all

{
Spawn[() // spawn actor
{
Console(false); //display console
AttributeOrder("enemy_health",100,"Die"); //Set health attribute, ammount of health, and death seen
FindTargetOrder(200,"Alert","health"); //sets vision distance, section called when target is found
SetFOV(360); //set field of vision
HostilePlayer(true); //Hostile to player
HostileSame(false); //Hostile to each other
HostileDifferent(false); //Hostile to other pawns
SetGroup("Enemy"); // Enemy Group
}]

Die[()
{
AnimateStop("die",0,""); //Death Animation
FadeOut(3,0); //Fade out actor
Remove(true); //remove pawn after death
}]

Alert[() // page 126
{
PlayerDistOrder(-800,"LostTarget"); //Distance at which it can detect a target
AnimateStop("idle",0,""); //play idle animatino when lost
NewOrder("Attack"); //play attack animation when found
}]

Attack[() // page 128
{
RotateToPlayer("walk",160,false,""); //page 129
FireProjectile("pistol_shell","BIP01 R FOREARM",0,0,0,"health","");
//Delay("hit",1,"");
if(self.player_range>96)
{
MoveForward("walk",50,50,"");
}
else
{
Delay("hit",1,"");
}
RestartOrder();
}]

LostTarget[()
{
BlendToAnimation("idle", 1, true, "");
FindTargetOrder(200,"Alert","health");
}]

User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: full badguy 1 script help

Post by bernie » Fri Nov 25, 2011 5:12 pm

First of all make the Console true, that way you can then see where problems are when you run the script. When you have got the script working you can then set it to false for the game.
Console(true); //display console
I notice you have no close in bracket at the the end of your script either.
"{" at the start needs a "}" at the end and make sure you have a couple of linefeeds after the closing bracket when you insert it. Not having linefeeds at the end of the script has been known to cause problems in the past.

The following should work although I have not tested it.

Code: Select all


{
Spawn[() // spawn actor
{
Console(true); //display console
AttributeOrder("enemy_health",100,"Die"); //Set health attribute, ammount of health, and death seen
FindTargetOrder(200,"Alert","health"); //sets vision distance, section called when target is found
SetFOV(360); //set field of vision
HostilePlayer(true); //Hostile to player
HostileSame(false); //Hostile to each other
HostileDifferent(false); //Hostile to other pawns
SetGroup("Enemy"); // Enemy Group
}]

Die[()
{
AnimateStop("die",0,""); //Death Animation
FadeOut(3,0); //Fade out actor
Remove(true); //remove pawn after death
}]

Alert[() // page 126
{
PlayerDistOrder(-800,"LostTarget"); //Distance at which it can detect a target
AnimateStop("idle",0,""); //play idle animatino when lost
NewOrder("Attack"); //play attack animation when found
}]

Attack[() // page 128
{
RotateToPlayer("walk",160,false,""); //page 129
FireProjectile("pistol_shell","BIP01 R FOREARM",0,0,0,"health","");
//Delay("hit",1,"");
if(self.player_range>96)
{
MoveForward("walk",50,50,"");
}
else
{
Delay("hit",1,"");
}
RestartOrder();
}]

LostTarget[()
{
BlendToAnimation("idle", 1, true, "");
FindTargetOrder(200,"Alert","health");
}]
}


megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: full badguy 1 script help

Post by megatop » Fri Nov 25, 2011 7:10 pm

Thanks bernie :D.

Post Reply