Power Attack - Alternate attack

Post your Feature Requests here...
Post Reply
Veleran
Posts: 895
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Power Attack - Alternate attack

Post by Veleran »

melee and projectile weapons right click Alternate Power "altattack" (for the default player and weapons)
that does more damage and consumes more ammunition if you set it so.
altattack =
altattackammopershot =

Most possibly you would need another 30 attack animations to the player and playersettup ini so that this special attack has its own animation,since now there is only fire up and fire down,but i would make those extra 30 attack animations for my player if i had that extra attack.

Otherwise i ll keep it as simple as it is and make some weapons stronger,to consume more ammo and have slower fire rate like heavy flails etc.
Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: Power Attack - Alternate attack

Post by Allanon »

You can probably write a script to do this. Just write a script that is activated when the right mouse button is pressed. You should be able to use script commands to change the animations and use the FireProjectile() command to fire the weapon with a different projectile.
Veleran
Posts: 895
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Power Attack - Alternate attack

Post by Veleran »

Im using default player in isometric camera where i use just one animation for attack-straight (not fire up/down) b the way.
You mean have a pawn script running for each weapon i want to have that special attack,that will wait until you click the right mouse button to play the special attack player animation and fire the projectile?

Would that low level command AnimateEntity (without hold at end) work on the player then?
I hope after the attack is done,the player will go back to the normal controls.

I also hope that firing projectiles from a bone that is inside the monster bounding boxes is nt a collision problem.
I have also thought using damage at bone (although have nt done it ever yet).
Looks like i will post to the scripting section.
Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: Power Attack - Alternate attack

Post by Allanon »

For an example you can look at the genericplayer.s script file that comes with RF. It doesn't include an alternative fire button but it does have a scripted fire button that looks like this:

Code: Select all

if(IsKeyDown(K_FIRE))
{
    // fire
    if(ANC < 1)
    {
        //only go to shoot anim if at idle
        ANIM=StringCopy(SHOOTANIM);
        ANC=1;
    }
    // Check fire rate
    if(self.time > TM+FIRERATE)
    {
        TM=self.time;
        FireProjectileBlind(FIREAMMO, WEAPONHAND, 0, 0, 0, DAMAGEATTRIB);
        AddExplosion(FIREEFFECT, WEAPONHAND, 0, 0, 0);
        TM=self.time;
    }
}
You can add an alternative fire button to the script that looks something like this:

Code: Select all

if(IsKeyDown(K_ALTFIRE))
{
    // alternative fire
    if(ANC < 1)
    {
        //only go to shoot anim if at idle
        ANIM=StringCopy(ALTSHOOTANIM);
        ANC=1;
    }
    // Check fire rate
    if(self.time > TM+ALTFIRERATE)
    {
        TM=self.time;
        FireProjectileBlind(ALTFIREAMMO, WEAPONHAND, 0, 0, 0, ALTDAMAGEATTRIB);
        AddExplosion(ALTFIREEFFECT, WEAPONHAND, 0, 0, 0);
        TM=self.time;
    }
}
Of course you would have to define the K_ALTFIRE, ALTSHOOTANIM, ALTDAMAGEATTRIB, ALTFIREEFFECT, and ALTFIRERATE variables at the top of the script. And with a little more scripting you would be able to add a lot of different types of weapons. And if you want to use the mouse button then just replace the IsKeyDown() command with the IsButtonDown() command. The player script allow you customize the player a lot more than the default player system.
Veleran
Posts: 895
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Power Attack - Alternate attack

Post by Veleran »

I dont use the scripted player,that needs lot to add to save manually the state of all pawns triggers etc. otherwise when you exit a level and go back inside all go back to life-or at least it use to be this way five-six years ago.

If i tried to make it like i said,would the projectile fire at the fire rate of the current used weapon or i would have to script that too?
I wanted the alt attack animation to play,the projectile to be fired rapidly and when animation stops to go back to idle or whatever movement you command.

Would it be better to try to use damageatbone instead fireprojectile so every frame of the animation the player does damage to an arc area in front of him with a cleave around the weapon bone?
Post Reply