Jedi block

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
chrisaxnix98
Posts: 1
Joined: Tue Feb 16, 2021 4:47 pm
Projects :: No Mod project currently.
Games I'm Playing :: yet
xbox live or psn: No gamertag set

Jedi block

Post by chrisaxnix98 »

Does anyone know if it’s possible to make Jedi in bf2 block all blaster shots automatically like in bf1? If so how could I do it?
User avatar
Benoz
Corporal
Corporal
Posts: 140
Joined: Tue May 28, 2013 12:34 pm
Projects :: Clone Wars Era Mod Version 2
Games I'm Playing :: OldFront - EAFront
xbox live or psn: No gamertag set
Location: Germany

Re: Jedi block

Post by Benoz »

You have to look at the .combo file of the jedi you want to change the blocking for. Let's take all_hero_luke_jedi.combo for example. In line 109 of the code you'll find the State("DEFLECT"), which defines the Deflect parameters of the unit using that .combo file. A few lines below you'll find this:

Code: Select all

Deflect()
{
        DeflectAngle(-110, 110);    // deflect anything from forward arc
        EnergyCost(0.0);

        DeflectAnimation("stand_block_front1", "Forward")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_front2", "Forward")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_left1", "Left")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_left2", "Left")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_right1", "Right")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_right2", "Right")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
}
Copy this and put it under State("IDLE") (found at line 48). So it looks like this:

Code: Select all

State("IDLE")
{
    Duration(0.0);  // infinite duration
    EnergyRestoreRate();    // (0.0, "FromSoldier")
    InputLock(0.15, "Sprint", "Jump", "Crouch");
	
	Deflect()
    {
        DeflectAngle(-110, 110);    // deflect anything from forward arc
        EnergyCost(0.0);

        DeflectAnimation("stand_block_front1", "Forward")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_front2", "Forward")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_left1", "Left")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_left2", "Left")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_right1", "Right")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
        DeflectAnimation("stand_block_right2", "Right")
        {
            // AimType("Torso");
            BlendInTime(0.00);
            BlendOutTime(0.05);
            LowResPose(5, "Frames");
        }
    }

    Transition("DEFLECT")
    {
        If()
        {
            Break();    // all transitions are breaking if Duration is 0
            Posture("Stand", "Crouch");
            Energy(">=", 2.5);  // at least half a second worth of deflect time 
            Button("FireSecondary", "Press");
        }
    }
    Transition("BACK_ATTACK")
    {
        If()
        {
            Break();    // all transitions are breaking if Duration is 0
            Posture("Stand", "Crouch");
            Button("Fire", "Press");
	    Thrust(">", 0.25);
	    ThrustAngle(135, 225);	
        }
    }
    Transition("ATTACK1")
    {
        If()
        {
            Break();    // all transitions are breaking if Duration is 0
            Posture("Stand", "Crouch");
            Button("Fire", "Press");
        }
    }
    Transition("DASHATTACK")
    {
        If()
        {
            Break();    // all transitions are breaking if Duration is 0
            Posture("Sprint");
            Button("Fire", "Press");
        }
    }
    Transition("JUMPATTACK_FALL")
    {
        If()
        {
            Break();    // all transitions are breaking if Duration is 0
            Posture("Jump", "Jet");
            //The following should be true during a jetjump, jump, or fall 
            // unless we're more than 0.35 seconds from the apex
            //NOTE: This may not allow luke to jump attack during longer falls
            // or falling from a force jump when it could.
            //VelocityY(">", -6.3);
            Button("Fire", "Press");
        }
    }
}
After you munge it the jedi using this .combo should deflect when idling.

Same can be applied to any other state. Although when using in an attack state, I recommend only copying the following line, so the deflect stance doesn't interfere with the attack stance:

Code: Select all

Deflect()
{
DeflectAngle(-110, 110);    // deflect anything from forward arc
EnergyCost(0.0);
}
EDIT: I haven't tested this out, but in theory it should work.
Post Reply