Jump to content

About weapon knockback..


Recommended Posts

So I'm trying to get a lightsaber to use the knockback ability that the base scepter uses. (The animation is where the character throws the weapon up in the air, catches it as it comes down and smashes it into the ground creating a blue/white-ish colored knockback, and then pulls it from the ground).

 

Of course I want the saber to still work normally, have it's saber blade turn on and off, and keep the regular saber trails etc.

 

I did follow this tutorial:

https://jkhub.org/topic/10138-how-to-create-a-shockwave-saber-with-knockback/

 

I do appreciate @@Asgarath83 for making it, but it's a bit of a mess. It's taking away saber styles and adding a dual saber style, totally not what I am trying to achieve.

 

This is my .npc file for the weapon currently.

evilgb
{
    name        "Evil Genius (Bent)"
    saberType    SABER_SINGLE
    saberModel    "models/weapons2/evilgen/egb.glm"
    saberColor    orange
    soundOn                        "sound/weapons/evil/saberon.mp3"
    soundLoop                    "sound/weapons/evil/saberhum1.wav"
        hitSound1                    "sound/weapons/evil/saberhit.wav"
        hitSound2                            "sound/weapons/evil/saberhit1.wav"
        hitSound3                            "sound/weapons/evil/saberhit2.wav"
        blockSound1                        "sound/weapons/evil/saberblock1.wav"
        blockSound2                             "sound/weapons/evil/saberblock2.wav"
        blockSound3                              "sound/weapons/evil/saberblock3.wav"
        swingSound1                         "sound/weapons/evil/saberhup1.mp3"
        swingSound2                             "sound/weapons/evil/saberhup2.mp3"
        swingSound3                              "sound/weapons/evil/saberhup3.mp3"
        spinSound                                       "sound/weapons/evil/saberspin.wav"
        bounceSound1                    "sound/weapons/evil/saberbounce1"
        bounceSound2                    "sound/weapons/evil/saberbounce2"
        bounceSound3                    "sound/weapons/evil/saberbounce3"
        fallSound1                    "sound/weapons/evil/bounce1.mp3"
        fallSound2                    "sound/weapons/evil/bounce2.mp3"
        fallSound3                    "sound/weapons/evil/bounce3.mp3"
    soundOff                    "sound/weapons/evil/saberoff.mp3"
    saberLength    40
    noIdleEffect                     0
    noDismemberment                 0
    noIdleEffect2                     0
    noDismemberment2                 0
    bounceOnWalls                     1
    returnDamage                     1
    blocking                     1
    lockable                     1
}

Basically what I want is to assign the knockback animation and damage to a regular saber without changing tons of other stuff such as saber styles or making the saber style dual. I want to keep it single.

Link to comment

splashradius, splashdamage, splashknockback and jumpatkfwdmove, katamove, lungeatkmove and other command like that on SAB files + bounceonwalls 1 can give you a saber that create shockwave damage when hit surfaces. change hitothereffect command fur customize the wall impact efx.

sorry, bur every other way of making a more workable saber knockback require code edit. : \

 

if you get katamove ls_jump_a_t_b__ or something like that (now i not remember all code animation you should fine the file sabers.sab with all sab commands availables) and bounceonwalls 1, when the blade hit the ground or a wall during this animation you should be able to generate a knockback. (not sure for animation, maybe for animation require code edit)

Daedra likes this
Link to comment

splashradius, splashdamage, splashknockback and jumpatkfwdmove, katamove, lungeatkmove and other command like that on SAB files + bounceonwalls 1 can give you a saber that create shockwave damage when hit surfaces. change hitothereffect command fur customize the wall impact efx.

sorry, bur every other way of making a more workable saber knockback require code edit. : \

 

if you get katamove ls_jump_a_t_b__ or something like that (now i not remember all code animation you should fine the file sabers.sab with all sab commands availables) and bounceonwalls 1, when the blade hit the ground or a wall during this animation you should be able to generate a knockback. (not sure for animation, maybe for animation require code edit)

 

I think I need to call different animations.

 

Like I said it is the animation that the npc tavion_scepter uses, and is actually the scepter weapon she throws up and smashes into the floor. Do you know what these animation names are? I've tried what you just said and ALORA doesn't use the scepter.

Link to comment

The thing is, that wile you can add the knockback and a hit effect - this will effect all saber attacks. So even normal swings will knock people back and randomly hitting a wall will produce the same visual effect.

 

The animations that you can use to replace other attack animations with in a .sab file are also kinda limited. You can only use attack animations, other animations don't seem to register hits properly. I don't know wether tavions slam is on that List, did you check our Wiki page on editing .sab files? That should have a list of all available commands you can use and also the "valid" animations.

 

TL;DR I think this might not be possible without a code mod :/

Link to comment

Use Modview and load tavion glm model or any other humanoid glm model. they use all animations ands yopu can see the model play EVER animation you want. i not remember now the exactly name of tavion animation you searching...mmm

Ok modview -> sequences ->, BOTH_TAVIONSCEPTERGROUND ... mmm not sure if work on Katamove becasue katamove read only "LS" animations. maybe on jumpatkfwdmove, lungeatkmove jumpatkleftmove, jumpatkupmove, jumpatkrightmove... but... i thing will not work much fine.

however, Ashura is right. NOT apply knockbackdamage and knockbackscale to you saber or you get damage on all swings.

use only splashradius, splashdamage and splashknockback.

and with bounceonwalls 1... mmm not sure however that work on scepterground animation. you need to try.

for what i remember this stuff require a little code hack.

Link to comment

The thing is, that wile you can add the knockback and a hit effect - this will effect all saber attacks. So even normal swings will knock people back and randomly hitting a wall will produce the same visual effect.

 

The animations that you can use to replace other attack animations with in a .sab file are also kinda limited. You can only use attack animations, other animations don't seem to register hits properly. I don't know wether tavions slam is on that List, did you check our Wiki page on editing .sab files? That should have a list of all available commands you can use and also the "valid" animations.

 

TL;DR I think this might not be possible without a code mod :/

 

Strange how it works fine on an npc with the scepter. It's like the code is already there, just needs redirecting onto a regular saber. Though I do notice that with the scepter, it literally only works on an npc. I don't think it works if you are the playermodel. There is an unused gla file for the scepter though. Weird.

Link to comment

Use Modview and load tavion glm model or any other humanoid glm model. they use all animations ands yopu can see the model play EVER animation you want. i not remember now the exactly name of tavion animation you searching...mmm

Ok modview -> sequences ->, BOTH_TAVIONSCEPTERGROUND ... mmm not sure if work on Katamove becasue katamove read only "LS" animations. maybe on jumpatkfwdmove, lungeatkmove jumpatkleftmove, jumpatkupmove, jumpatkrightmove... but... i thing will not work much fine.

however, Ashura is right. NOT apply knockbackdamage and knockbackscale to you saber or you get damage on all swings.

use only splashradius, splashdamage and splashknockback.

and with bounceonwalls 1... mmm not sure however that work on scepterground animation. you need to try.

for what i remember this stuff require a little code hack.

 

Tried that "BOTH_TAVIONSCEPTERGROUND" but alas it does not work. The animation is for the second saber (the scepter). The only way would be if you had a flipped animation to work on the right hand instead of the left.

Link to comment

I look forward to this. I find it strange how the scepter has this ability, yet we have not had this move added for regular saber combat yet.

That is most likely due to the lack of access to the source code during the first 8/9(?) years of Jedi Academy modding.

 

Fun fact: there are more "hidden" NPC-only abilities that are locked to certain npc names.

 

The cultist_commando uses dual pistols, the cultist_destroyer blows himself up when using dark rage.

 

And I'm sure that there's more stuff I'm missing right now.

 

On a side note: if you want to make a staff member happy, you could check out the multiquote function the next time you want to reply to/quote multiple people :D

Wasa and Daedra like this
Link to comment

That is most likely due to the lack of access to the source code during the first 8/9(?) years of Jedi Academy modding.

 

Fun fact: there are more "hidden" NPC-only abilities that are locked to certain npc names.

 

The cultist_commando uses dual pistols, the cultist_destroyer blows himself up when using dark rage.

 

And I'm sure that there's more stuff I'm missing right now.

 

On a side note: if you want to make a staff member happy, you could check out the multiquote function the next time you want to reply to/quote multiple people :D

 

Sorry about that. :P

 

And oh! I didn't know about the commando guy. That really is interesting. Might use him more often.

Link to comment

Okay, so far I've made a shock-wave scepter like @@AshuraDX suggested, and a force lightning replacement for the beam attack, as a bonus. Something I found out though: Special moves (i.e Katas, Butterflies, Twirls, Lunges, etc.) do NOT make a shock-wave like regular attacks do. Instead it behaves like a normal saber's special move - which is not what we're looking for. Are there any attacks that aren't used that often that wouldn't be considered a special move?

 

Or, better yet, is there a way to reverse it? To make it so that special moves create the shock-wave whereas the regular attacks don't?

 

Thanks :)

Link to comment

Okay, so does anyone know what animations these attacks use?

LS_A_TL2BR
LS_A_L2R
LS_A_BL2TR
LS_A_BR2TL
LS_A_R2L
LS_A_TR2BL
LS_A_T2B

These are attacks that can be made into a Kata (kinda Special Moves, but not really), that still go boom with that good ol' slam attack. Thanks :)

Link to comment

Okay, so does anyone know what animations these attacks use?

LS_A_TL2BR
LS_A_L2R
LS_A_BL2TR
LS_A_BR2TL
LS_A_R2L
LS_A_TR2BL
LS_A_T2B

These are attacks that can be made into a Kata (kinda Special Moves, but not really), that still go boom with that good ol' slam attack. Thanks :)

 

Does modview have an animation viewer? Like you can select one and the loaded model will go through that particular animation? Unless my memory is bad and I'm thinking of a different program for a different game.

Link to comment

Tried that "BOTH_TAVIONSCEPTERGROUND" but alas it does not work. The animation is for the second saber (the scepter). The only way would be if you had a flipped animation to work on the right hand instead of the left.

I expected that. tavion ground slam knockback is hardcode in AI_jedi.cpp i guess. or WP_saber.cpp ? Or g_combat.cpp? i not know :\

 

Should be on weapon scepter code. so you need to make this code available for saber. totally not easily thing. i have a workaround for that on my code but is little nasty because has a bug: if you type on consolle a name of saber is not present inside the game with correct SAB file, game crash.

 

on WP_saber.cpp

before

i get

 

  if ( Q_stricmp(ent->client->ps.saber[saberNum].fullName, "chargereaver")
                        && (hit_wall)
&& (ent->client->ps.saber[saberNum].saberFlags&SFL_BOUNCE_ON_WALLS)
&& (PM_SaberInAttackPure( ent->client->ps.saberMove ) //only in a normal attack anim
|| ent->client->ps.saberMove == LS_A_JUMP_T__B_ ) //or in the strong jump-fwd-attack "death from above" move
)
{//bounce off walls
//do anim
ent->client->ps.saberBlocked = BLOCKED_ATK_BOUNCE;
ent->client->ps.saberBounceMove = LS_D1_BR+(saberMoveData[ent->client->ps.saberMove].startQuad-Q_BR);
//do bounce sound & force feedback
WP_SaberBounceOnWallSound( ent, saberNum, bladeNum );
//do hit effect
if ( !g_saberNoEffects )
{
if ( !WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum )
&& ent->client->ps.saber[saberNum].hitOtherEffect )
{
G_PlayEffect( ent->client->ps.saber[saberNum].hitOtherEffect, saberHitLocation, saberHitNormal );
}
else if ( WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum )
&& ent->client->ps.saber[saberNum].hitOtherEffect2 )
{
G_PlayEffect( ent->client->ps.saber[saberNum].hitOtherEffect2, saberHitLocation, saberHitNormal );
}
else
{
G_PlayEffect( "saber/saber_cut", saberHitLocation, saberHitNormal );
}
}
//do radius damage/knockback, if any
if ( !WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum ) )
{
WP_SaberRadiusDamage( ent, saberHitLocation, ent->client->ps.saber[saberNum].splashRadius, ent->client->ps.saber[saberNum].splashDamage, ent->client->ps.saber[saberNum].splashKnockback );
}
else
{
WP_SaberRadiusDamage( ent, saberHitLocation, ent->client->ps.saber[saberNum].splashRadius2, ent->client->ps.saber[saberNum].splashDamage2, ent->client->ps.saber[saberNum].splashKnockback2 );
}
}
        }
 
        if ( WP_SaberApplyDamage( ent, baseDamage, baseDFlags, brokenParry, saberNum, bladeNum, (qboolean)(saberNum==0&&ent->client->ps.saberInFlight) ) )
        {//actually did damage to something
#ifndef FINAL_BUILD
                if ( d_saberCombat->integer )
                {
                        gi.Printf( "base damage was %4.2f\n", baseDamage );
                }
#endif
                WP_SaberHitSound( ent, saberNum, bladeNum );
        }
 
        if ( hit_wall )
        {
                //just so Jedi knows that he hit a wall
                ent->client->ps.saberEventFlags |= SEF_HITWALL;
                if ( ent->s.number == 0 )
                {
                        AddSoundEvent( ent, ent->currentOrigin, 128, AEL_DISCOVERED, qfalse, qtrue );//FIXME: is this impact on ground or not?
                        AddSightEvent( ent, ent->currentOrigin, 256, AEL_DISCOVERED, 50 );
                }
        }
}
 
void WP_SabersDamageTrace( gentity_t *ent, qboolean noEffects )
all saber named chargereaver with bounceofwalls  do knockback of katamoves in moment they blade collide with wall... ONLY when you using kata and special animations. not at every swing and bounce. .
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...