Page 1 of 1

Use melee animations for non-melee sets? [Solved]

Posted: Wed Jul 02, 2014 5:32 pm
by commanderawesome
Is it possible to, say, replace the pistol firing animation with one of the saber slash animations? Because i'm trying to make a weapon based off the BFX knife (chargeable and cannot block things) but is two handed.

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 5:55 pm
by JimmyAngler
Why not just use a combo? Here is one that was used in the HaloFront v0.2 that might suit you.

The Combo:
Hidden/Spoiler:
OffhandAnimation("stand_throw", "FIRE")
{
Loop("FinalFrame");
AimType("Torso");
BlendInTime(0.15);
BlendOutTime(0.15);
}
OffhandAnimation("stand_useforce", "FIRE2");
OffhandAnimation("none", "CHARGE");

State("IDLE")
{
Duration(0.0); // infinite duration
EnergyRestoreRate(); // (0.0, "FromSoldier")
InputLock(0.15, "Sprint", "Jump", "Crouch");

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");
}
}
}

State("BACK_ATTACK")
{
Posture("Stand");
Animation("stand_attack_backwards")
{
BlendInTime(0.15);
BlendOutTime(0.15);
}

Sound("com_weap_melee_swing", 4, "Frames");

Duration(35, "Frames");

InputLock("All", "!Thrust");
AlignedToThrust();
Attack()
{
DamageTime(6, 10, "Frames");
DamageLength(1.5);
DamageWidth(0.75);
Damage(5000);

Push(0.0);
}

Attack()
{
DamageTime(17, 22, "Frames");
DamageLength(1.5);
DamageWidth(0.75);
Damage(800);

Push(0.0);
}

Transition("IDLE");
}

//Forward declare animations to allow BlendTimeTo references:
Animation("stand_vaderdash");
Animation("stand_obiwan1b");
Animation("stand_obiwan1b_end");
Animation("stand_gam_guard");

// Vader's dash attack - NOT _full
State("ATTACK1")
{
Posture("Stand");
Animation("stand_vaderdash")
{
//SyncType("sidious1");
BlendInTime(0.15);
BlendOutTime(0.15);
BlendTimeTo("stand_obiwan1b", 0.15);
}

Sound("com_weap_melee_swing");

AlignedToThrust();

Attack()
{
DamageTime(2, 7, "Frames");
DamageLength(1.5);
DamageWidth(.75);
Damage(5000);

Push(0.0);
}

Transition("ATTACK2")
{
If()
{
Break(13, "Frames");
TimeStart(5, "Frames");
TimeEnd(20, "Frames"); //, "SyncIfOvertime");
Posture("Stand");
Button("Fire", "Press");
}
}
Transition("IDLE");
}

// Obiwan final attack - _full
State("ATTACK2")
{
Posture("Stand");
Animation("stand_obiwan1b")
{
//SyncType("sidious1");
AimType("None");
BlendInTime(0.06);
BlendOutTime(0.15);
BlendTimeTo("stand_gam_guard", 0.3);
BlendTimeTo("stand_obiwan1b_end", 0.0);
}
Sound("com_weap_melee_swing");

//set a duration
AlignedToThrust();

// StrafeFactor(0.5);
// TurnFactor(0.5);

Attack()
{
DamageTime(-3, 7, "Frames");
DamageLength(1.5);
DamageWidth(0.75);
Damage(5000);

Push(0.0);
}

Transition("RECOVER2_ATTACK")
{
If()
{
Break(16, "Frames");
TimeStart(6, "Frames");
TimeEnd(16, "Frames"); //, "SyncIfOvertime");
Posture("Stand");
Button("Fire", "Press");
}
}

Transition("RECOVER2");
}

State("RECOVER2")
{
Posture("Stand");
Animation("stand_obiwan1b_end")
{
// SyncType("attack1c", "ByTime");
AimType("None");
BlendInTime(0.15);
BlendOutTime(0.15);
BlendTimeTo("stand_gam_guard", 0.3);
}

AlignedToThrust();

Transition("IDLE");
}

State("RECOVER2_ATTACK")
{
Posture("Stand");
Animation("stand_obiwan1b_end")
{
// SyncType("attack1c", "ByTime");
AimType("None");
BlendInTime(0.15);
BlendOutTime(0.15);
BlendTimeTo("stand_gam_guard", 0.3);
}

AlignedToThrust();

Duration(7, "Frames");

Transition("ATTACK3");
}

State("ATTACK3")
{
Posture("Stand");
Animation("stand_gam_guard")
{
// SyncType("attack1c", "ByTime");
AimType("None");
BlendInTime(0.15);
BlendOutTime(0.3);
}
Sound("com_weap_melee_swing", 6, "Frames");

//set a duration
//Duration(30, "Frames");

AlignedToThrust();

TurnFactor(0.5);

Duration(45, "Frames");

InputLock("All", "!Thrust"); // lock all controls for duration of state
Attack()
{
DamageTime(14, 24, "Frames");
DamageLength(1.5);
DamageWidth(1.25);
Damage(10000);

Push(0.0);
}

Transition("IDLE");
}
Please change the damage accordingly.
I marked all damage instances in red.
There are basically three moves in this combo. you can keep all three, or just delete two and have one for the melee.

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 6:02 pm
by commanderawesome
Basically, I want the weapon to be chargeable, with one attack animation, that can be used with guns without messing up the controls and cannot be used to block.

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 6:07 pm
by Nedarb7
Use the force push odfs as a base.
1. Make sure you remove OffHandWeapon = 1
2. Make a custom animation set that has a new kind of weapon bank, say "slash" (it would look like set_slash_stand_shoot)
3. Add this to the force push odf AnimationBank = "slash bazooka"
4. Make changes to the force push odf so that it turns out how you like

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 6:10 pm
by commanderawesome
Ok, i'll try that.

And, just to avoid confusion, this is a different weapon than the one in the other thread I made today.

EDIT:It crashes as soon as I switch to the weapon.

Odf:
Hidden/Spoiler:
[code][WeaponClass]

ClassLabel = "cannon"

[Properties]
HUDTag = "hud_force_push"
GeometryName = ""
HighResGeometry = ""

AnimationBank = "pike"
RoundsPerClip = "0"
ReloadTime = "0.3"
HeatRecoverRate = "0.2"
HeatThreshold = "0.0"

OrdnanceName = "geo_weap_pike_ord"

TriggerSingle = "1"
ShotDelay = "0.5"
HeatPerShot = "0.0"
MaxPressedTime = "0.0"

LockOnRange = "64.0"
LockTime = "0.0"
AutoAimSize = "2.0"

SalvoCount = "1"
ShotsPerSalvo = "1"
SalvoDelay = "0.0"
SalvoTime = "0.0"
InitialSalvoDelay = "0.5" // must have one or no animation - Mike Z

EnergyDrain = 50.0

TargetEnemy = "1"
TargetNeutral = "1"
TargetFriendly = "1"

TargetPerson = "1"
TargetAnimal = "1"
TargetDroid = "1"
TargetVehicle = "0"
TargetBuilding = "0"

AITargetPerson = "0"
AITargetAnimal = "0"
AITargetDroid = "0"
AITargetVehicle = "0"
AITargetBuilding = "0"

//SOUND
FireSound = "force_push_fire"
//ReloadSound = ""
WeaponChangeSound = ""
ChangeModeSound = ""
FireEmptySound = ""
ChargeSound = ""
ChargeSoundPitch = "0.05"
OverheatSound = ""
OverheatSoundPitch = "0.5"
OverheatStopSound = ""
[/code]
The animation used (for both standing and crouching) is Luke's first swing.

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 9:48 pm
by Maveritchell
Nedarb7 wrote:Use the force push odfs as a base.
1. Make sure you remove OffHandWeapon = 1
2. Make a custom animation set that has a new kind of weapon bank, say "slash" (it would look like set_slash_stand_shoot)
3. Add this to the force push odf AnimationBank = "slash bazooka"
4. Make changes to the force push odf so that it turns out how you like
That's uh... a circuitous way of going about it. It's way easier to make a custom animation bank for the weapon and just name one of the animations as a charging animation. Just about all weapon types support charging.

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 10:14 pm
by commanderawesome
What would the charging animation be called?

Re: Use melee animations for non-melee sets?

Posted: Wed Jul 02, 2014 11:56 pm
by TWINKEYRUNAWAY
It would be called whatever you want. You could name it in the custom animation set "charge" and add the line to the animation munge.

edit: Oh I see what you meant. Yeah I have no idea what the vanilla charge animation line would look like. Either way, nedarb7's way isnt as circuitous. Ive actually done something with his suggestion and got a really good result with it incase you wanted to give that a go. Its actually quite easy once you have the stand shoot and crouch shot lines with the custom animation bank name.

Re: Use melee animations for non-melee sets?

Posted: Thu Jul 03, 2014 10:07 am
by Nedarb7
Maveritchell wrote:That's uh... a circuitous way of going about it. It's way easier to make a custom animation bank for the weapon and just name one of the animations as a charging animation. Just about all weapon types support charging.
Isn't that almost exactly what I said? :o If not could you explain why? I'm curious to know this other method.

commanderawesome, change the animationbank = "pike" to CustomAnimationBank = "pike bazooka". The added "bazooka" bazooka can be any base weapon bank (rifle,tool, pistol, bazooka)

Re: Use melee animations for non-melee sets?

Posted: Thu Jul 03, 2014 1:54 pm
by commanderawesome
Added this:
AnimationBank = "pike rifle"

Still Crashes. :cpu:

I think it might be with the first person animations. How do you get a weapon to force 3rd perspective?

Re: Use melee animations for non-melee sets?

Posted: Thu Jul 03, 2014 2:47 pm
by Marth8880
commanderawesome wrote:Added this:
AnimationBank = "pike rifle"
It needs to be CustomAnimationBank, not AnimationBank.

Re: Use melee animations for non-melee sets?

Posted: Thu Jul 03, 2014 3:58 pm
by commanderawesome
It works! Thanks! :)