Scripted a turret but i don't take damage from it

Topics regarding Scripting with Reality Factory
Post Reply
DjPoppyT
Posts: 12
Joined: Fri Jul 15, 2011 9:01 pm

Scripted a turret but i don't take damage from it

Post by DjPoppyT » Fri Jul 15, 2011 9:22 pm

I've scripted a turret out of badguy1, he rotates towards me and fires but there is no bullet explosion when he shoots at the wall. when he fires on me i don't take damage.

Code: Select all

{

Spawn[()

{
Console(true);

AttributeOrder("health",20,"Die");
FindTargetOrder(250,"Alert","health");
SetFOV(360);
HotsilePlayer(true);
HostileSame(false);
HosileDifferent(false);
SetGroup("Enemy");

}]

Alert[()

{

AnimateStop("hit",0,"");
NewOrder("Attack");
}]


Attack[()

{

RotateToPlayer("idle",160,false,"");
FireProjectile("10mm_shell","BIP01 R FOREARM",0,0,0,"health","");
Delay("stattack",0.5,"");
RestartOrder();

}]
This is most of the script. Is there perhaps a value that must be increased to cause dmg to the player?
Another problem i have is the pawn only takes dmg if i shoot him in the feet. The crosshair only lights if i aim at his feet. Any help would be greatly appreciated.

DjPoppyT
Posts: 12
Joined: Fri Jul 15, 2011 9:01 pm

Re: Scripted a turret but i don't take damage from it

Post by DjPoppyT » Fri Jul 15, 2011 9:49 pm

I re-compiled and the turret hit me once then i sat as he kept shooting and about 12 shots later i got hit again. Also, I still can't hit anything but his legs, And the c8 and the scattergun don't dmg him.

DjPoppyT
Posts: 12
Joined: Fri Jul 15, 2011 9:01 pm

Re: Scripted a turret but i don't take damage from it

Post by DjPoppyT » Fri Jul 15, 2011 11:04 pm

Figured out the issue with badguys invincible torso. His bounding box is not positioned properly. Direction to a chapter in the pdf or from the manual on altering the bounding box would be much appreciated.

Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: Scripted a turret but i don't take damage from it

Post by Allanon » Sat Jul 16, 2011 12:12 am

Use the BoxWidth() and BoxHeight() commands in the Spawn order to change the pawn's bounding box width and height.

BoxWidth(float Width); - Set the Pawn actor's bounding box width and depth to Width. The height remains unchanged.

BoxHeight(float Height); - Set the Pawn actor's bounding box height to Height. The width remains unchanged.

DjPoppyT
Posts: 12
Joined: Fri Jul 15, 2011 9:01 pm

Re: Scripted a turret but i don't take damage from it

Post by DjPoppyT » Sat Jul 16, 2011 1:23 am

WOW. Such a simple solution. I'm still learning the commands, but making progress. Thanks for the help.

DjPoppyT
Posts: 12
Joined: Fri Jul 15, 2011 9:01 pm

Re: Scripted a turret but i don't take damage from it

Post by DjPoppyT » Sat Jul 16, 2011 5:55 pm

turret couldn't hit me because projectile position was set at 0,0,0 I changed it to 5,0,0 and it worked.

Post Reply