Can a Pawn fire up or down

Topics regarding Scripting with Reality Factory
Post Reply
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Can a Pawn fire up or down

Post by Veleran » Tue Dec 12, 2017 12:31 pm

I tried various angles for the projectile firing direction but it looked like the pawn can fire only to the front,where it faces.
If you can fire up and down,and know how,give me the projectile angles so i use rty them.

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

Re: Can a Pawn fire up or down

Post by Allanon » Wed Dec 13, 2017 7:06 pm

It's relative to the bone, here is the docs for the fireprojectile() pawn script function:

void PawnHigh::FireProjectile(
string projectile,
string boneName,
float offsetX,
float offsetY,
float offsetZ,
string attribute,
string sound
)


Shoot a projectile in the direction the pawn is facing.

Parameters:
projectile - String holding the name of the projectile type to fire.
boneName - String holding the name of a bone in the pawn (or the pawn's weapon actor if present) acting as launch location.
offsetX - Specifies the offset in x-direction (left) from the bone's orientation.
offsetY - Specifies the offset in y-direction (up) from the bone's orientation.
offsetZ - Specifies the offset in z-direction (in) from the bone's orientation.
attribute - String holding the name of the attribute to damage.
sound - String holding the name of the sound file to play while firing.

Returns:
Nothing.

User avatar
Grok
Posts: 137
Joined: Sat May 27, 2017 9:20 pm

Re: Can a Pawn fire up or down

Post by Grok » Fri Dec 15, 2017 6:11 pm

Veleran wrote:I tried various angles for the projectile firing direction but it looked like the pawn can fire only to the front,where it faces.
If you can fire up and down,and know how,give me the projectile angles so i use rty them.
One way to get a pawn to fire up or down would be to make it face at angle up or down and the fire.

If the pawn is to fire at the player you could start with RotateToPlayer() before FireProtectile()

If the player is higher than the pawn, the pawn should be fireing up (I think).

There are of course other rotate commands you could use if there is something else you want the pawn to fire at.

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Can a Pawn fire up or down

Post by Veleran » Sun Jan 07, 2018 9:49 pm

I mean the pawn to shoot up or down independently of the player location.
I will have to experiment rotating the pawn with general rotate commands,since the rotation through the pawn origin in the level editor did not make any difference.

Post Reply