Why don't Jedi's fall over when killed?

Started by Bluetothestars, June 15, 2022, 04:12:08 AM

Previous topic - Next topic
Game version has nothing to do with ODF settings.
Never let a person named AnthonyBF2 touch your BF2.

Quote from: AnthonyBF2 on August 28, 2022, 10:13:18 PMGame version has nothing to do with ODF settings.
Hmm. Does it matter where I put the "FleeLikeAHero"? In my common folder there is no odf for characters, but in the actual side folder the char odf's are in the side files (ie all, rep, cis). For the mission scripts, I've been putting the "SetClassProperty("example_name", "FleeLikeAHero", "0")" right under ScriptPostLoad(). For actual char odfs I'm putting "FleeLikeAHero = 0" under "JetEnergyDrain      = 40.0".

Okay, I dunno if this will be helpful at all, but I went and tried to make this work myself. I'm kinda novice when it comes to BF2 modding (more of a BF1 guy), so I just combined all the specs from both the com_inf_jedi with my individual unit .odf. The fleelikeahero line is right under the geometry and override texture lines. I did NOT put anything into the LUAs. It works perfectly in-game:

[GameObjectClass]
ClassLabel              = "soldier"
GeometryName            = "jed_inf_jedi.msh"

[Properties]
FootWaterSplashEffect   = "com_sfx_watersplash_sm"
WaterSplashEffect       = "com_sfx_watersplash_md"
WakeWaterSplashEffect   = "com_sfx_watersplash_wade"

AISizeType              = "HOVER"

GeometryName        = "jed_inf_jedi"
GeometryLowRes      = "jed_inf_jedi_low1"
OverrideTexture     = "jed_inf_jedi01"

FleeLikeAHero = 0

AnimationName        = "aalya"

MapTexture              = "troop_icon"
MapScale                = 1.4
MapViewMin = 50
MapViewMax = 50
MapSpeedMin = 0
MapSpeedMax = 100


FirstPersonFOV          = "70"
ThirdPersonFOV          = "65"

CAMERASECTION           = "STAND"
EyePointOffset          = "0.0 2.0 0.0"
TrackCenter = "0.0 1.7 0.0"
TrackOffset             = "0.0 0.0 5.2"
TiltValue               = "10"

CAMERASECTION        = "STANDZOOM"
EyePointOffset      = "0.0 1.8 0.0"
TrackCenter          = "0.0 1.8 0.0
TrackOffset          = "0.4 0.05 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "CROUCH"
EyePointOffset      = "0.0 1.3 0.0"
TrackCenter          = "0.0 1.3 0.0
TrackOffset          = "0.0 0.15 3.0"
TiltValue            = "10.0"
CameraBlendTime      = "0.75"

CAMERASECTION        = "CROUCHZOOM"
EyePointOffset      = "0.0 1.3 0.0"
TrackCenter          = "0.0 1.3 0.0
TrackOffset          = "0.4 0.2 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "PRONE"
EyePointOffset      = "0.0 0.5 0.0"
TrackCenter          = "0.0 0.5 0.0"
TrackOffset          = "0.0 0.0 3.0"
TiltValue            = "5.0"
CameraBlendTime      = "1.0"

CAMERASECTION        = "PRONEZOOM"
EyePointOffset      = "0.0 0.5 0.0"
TrackCenter          = "0.0 0.5 0.0"
TrackOffset          = "0.4 0.2 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "SPRINT"
EyePointOffset      = "0.0 1.8 0.0"
TrackCenter          = "0.0 1.8 0.0
TrackOffset          = "0.0 0.0 4.0"
TiltValue            = "10.0"
CameraBlendTime      = "0.75"



HealthType              = "person"
//MaxHealth               = 1200.0
MaxHealth           = 200.0
AddHealth           = 20.0

NoEnterVehicles      = 0


MaxSpeed                = 9.0 //8.0
MaxStrafeSpeed          = 6.6 //6.0
MaxTurnSpeed            = 5.0
JumpHeight              = 3.5
RecoverFromTumble       = "1"

JumpForwardSpeedFactor  = 1.3
JumpStrafeSpeedFactor   = 1.0
RollSpeedFactor         = 1.5

Acceleration            = 70.0      // accelerate to full run in about 7/70 = 0.1 seconds
SprintAccelerateTime    = 0.35      // accelerate from run to sprint in this time

ControlSpeed            = "stand  1.00 1.00 1.00"
ControlSpeed            = "crouch 0.70 0.60 1.00"
ControlSpeed            = "prone  0.30 0.20 0.50"
ControlSpeed            = "sprint 2.50 0.50 0.50"
ControlSpeed            = "jet    1.50 1.25 1.25"
ControlSpeed            = "jump   0.10 0.10 0.60"
ControlSpeed            = "roll   0.02 0.02 0.35"
ControlSpeed            = "tumble 0.00 0.00 0.10"

// Energy bar defaults
EnergyBar               = 100.0     // Max energy
EnergyRestore           = 15.0      // energy regained per second if moving
EnergyRestoreIdle       = 25.0      // energy regained per second if not
EnergyDrainSprint       = 15.0      // energy spent per second of sprinting
EnergyMinSprint         = 20.0      // min energy to start sprinting
EnergyCostJump          = 0.0      // energy cost to jump
EnergyCostRoll          = 25.0      // energy cost to roll



NoEnterVehicles      = 1

BlurEffect          = "0.8"

//Jet Jump
JetJump             = "10.0"    //The initial jump-push given when enabling the jet
JetPush             = "0.0"     //The constant push given while the jet is enabled (20 is gravity)
JetAcceleration     = "10.0"    // for characters with jet jump, use this acceleration for in air control
JetEffect           = ""
JetFuelRechargeRate = "0.0" //Additional fuel per second (fuel is 0 to 1)
JetFuelCost         = "0.0" //Cost per second when hovering (only used for jet-hovers)(fuel is 0 to 1)
JetFuelInitialCost  = "0.0" //4initial cost when jet jumping(fuel is 0 to 1)
JetFuelMinBorder    = "0.0" //minimum fuel to perform a jet jump(fuel is 0 to 1)
JetShowHud          = 0
JetEnergyDrain      = 40.0

CollisionScale      = "0.0 0.0 0.0" // don't take damage from collisions
//Jet Jump End


WEAPONSECTION = 1
WeaponName1           = "all_weap_lightsaber"
WeaponAmmo1           = 0

//SOUND
//SndHeroSelectable           = ""
//SndHeroSpawned              = "hero_secura_spawn"
//SndHeroDefeated             = "hero_secura_exhausted"
//SndHeroKiller               = "hero_secura_exhausted"

//VOSound = "hero_secura_AcquiredTarget      AcquiredTarget"
//VOSound = "hero_secura_KillingSpree4      KillingSpree4"

VOUnitType                  = 0181
//SoldierMusic            = "rep_hero_secura_lp"
HurtSound                   = ""
DeathSound                  = ""
AcquiredTargetSound         = ""
HidingSound                 = ""
//ApproachingTargetSound    = ""
FleeSound               = ""
PreparingForDamageSound = ""
HeardEnemySound         = ""
ShockFadeOutTime        = ""
ShockFadeInTime         = ""
ShockFadeOutGain        = ""
ShockSound              = ""
ClothingRustleSound     = ""
//LowHealthSound          = "com_inf_saber_ambient"
LowHealthThreshold      = "1.1"
FoleyFXClass            = "all_inf_soldier"


DropItemClass           = "com_item_powerup_ammo"
DropItemProbability     = 0.05
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_health100"
DropItemProbability     = 0.05
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_dual"
DropItemProbability     = 0.20
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_energy"
DropItemProbability     = 0.10
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_offense"
DropItemProbability     = 0.15
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_defense"
DropItemProbability     = 0.15



Quote from: Ty294 on September 02, 2022, 06:55:17 PMOkay, I dunno if this will be helpful at all, but I went and tried to make this work myself. I'm kinda novice when it comes to BF2 modding (more of a BF1 guy), so I just combined all the specs from both the com_inf_jedi with my individual unit .odf. The fleelikeahero line is right under the geometry and override texture lines. I did NOT put anything into the LUAs. It works perfectly in-game:

[GameObjectClass]
ClassLabel              = "soldier"
GeometryName            = "jed_inf_jedi.msh"

[Properties]
FootWaterSplashEffect   = "com_sfx_watersplash_sm"
WaterSplashEffect       = "com_sfx_watersplash_md"
WakeWaterSplashEffect   = "com_sfx_watersplash_wade"

AISizeType              = "HOVER"

GeometryName        = "jed_inf_jedi"
GeometryLowRes      = "jed_inf_jedi_low1"
OverrideTexture     = "jed_inf_jedi01"

FleeLikeAHero = 0

AnimationName        = "aalya"

MapTexture              = "troop_icon"
MapScale                = 1.4
MapViewMin = 50
MapViewMax = 50
MapSpeedMin = 0
MapSpeedMax = 100


FirstPersonFOV          = "70"
ThirdPersonFOV          = "65"

CAMERASECTION           = "STAND"
EyePointOffset          = "0.0 2.0 0.0"
TrackCenter = "0.0 1.7 0.0"
TrackOffset             = "0.0 0.0 5.2"
TiltValue               = "10"

CAMERASECTION        = "STANDZOOM"
EyePointOffset      = "0.0 1.8 0.0"
TrackCenter          = "0.0 1.8 0.0
TrackOffset          = "0.4 0.05 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "CROUCH"
EyePointOffset      = "0.0 1.3 0.0"
TrackCenter          = "0.0 1.3 0.0
TrackOffset          = "0.0 0.15 3.0"
TiltValue            = "10.0"
CameraBlendTime      = "0.75"

CAMERASECTION        = "CROUCHZOOM"
EyePointOffset      = "0.0 1.3 0.0"
TrackCenter          = "0.0 1.3 0.0
TrackOffset          = "0.4 0.2 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "PRONE"
EyePointOffset      = "0.0 0.5 0.0"
TrackCenter          = "0.0 0.5 0.0"
TrackOffset          = "0.0 0.0 3.0"
TiltValue            = "5.0"
CameraBlendTime      = "1.0"

CAMERASECTION        = "PRONEZOOM"
EyePointOffset      = "0.0 0.5 0.0"
TrackCenter          = "0.0 0.5 0.0"
TrackOffset          = "0.4 0.2 2.8"
TiltValue            = "3.5"

CAMERASECTION        = "SPRINT"
EyePointOffset      = "0.0 1.8 0.0"
TrackCenter          = "0.0 1.8 0.0
TrackOffset          = "0.0 0.0 4.0"
TiltValue            = "10.0"
CameraBlendTime      = "0.75"



HealthType              = "person"
//MaxHealth               = 1200.0
MaxHealth           = 200.0
AddHealth           = 20.0

NoEnterVehicles      = 0


MaxSpeed                = 9.0 //8.0
MaxStrafeSpeed          = 6.6 //6.0
MaxTurnSpeed            = 5.0
JumpHeight              = 3.5
RecoverFromTumble       = "1"

JumpForwardSpeedFactor  = 1.3
JumpStrafeSpeedFactor   = 1.0
RollSpeedFactor         = 1.5

Acceleration            = 70.0      // accelerate to full run in about 7/70 = 0.1 seconds
SprintAccelerateTime    = 0.35      // accelerate from run to sprint in this time

ControlSpeed            = "stand  1.00 1.00 1.00"
ControlSpeed            = "crouch 0.70 0.60 1.00"
ControlSpeed            = "prone  0.30 0.20 0.50"
ControlSpeed            = "sprint 2.50 0.50 0.50"
ControlSpeed            = "jet    1.50 1.25 1.25"
ControlSpeed            = "jump   0.10 0.10 0.60"
ControlSpeed            = "roll   0.02 0.02 0.35"
ControlSpeed            = "tumble 0.00 0.00 0.10"

// Energy bar defaults
EnergyBar               = 100.0     // Max energy
EnergyRestore           = 15.0      // energy regained per second if moving
EnergyRestoreIdle       = 25.0      // energy regained per second if not
EnergyDrainSprint       = 15.0      // energy spent per second of sprinting
EnergyMinSprint         = 20.0      // min energy to start sprinting
EnergyCostJump          = 0.0      // energy cost to jump
EnergyCostRoll          = 25.0      // energy cost to roll



NoEnterVehicles      = 1

BlurEffect          = "0.8"

//Jet Jump
JetJump             = "10.0"    //The initial jump-push given when enabling the jet
JetPush             = "0.0"     //The constant push given while the jet is enabled (20 is gravity)
JetAcceleration     = "10.0"    // for characters with jet jump, use this acceleration for in air control
JetEffect           = ""
JetFuelRechargeRate = "0.0" //Additional fuel per second (fuel is 0 to 1)
JetFuelCost         = "0.0" //Cost per second when hovering (only used for jet-hovers)(fuel is 0 to 1)
JetFuelInitialCost  = "0.0" //4initial cost when jet jumping(fuel is 0 to 1)
JetFuelMinBorder    = "0.0" //minimum fuel to perform a jet jump(fuel is 0 to 1)
JetShowHud          = 0
JetEnergyDrain      = 40.0

CollisionScale      = "0.0 0.0 0.0" // don't take damage from collisions
//Jet Jump End


WEAPONSECTION = 1
WeaponName1           = "all_weap_lightsaber"
WeaponAmmo1           = 0

//SOUND
//SndHeroSelectable           = ""
//SndHeroSpawned              = "hero_secura_spawn"
//SndHeroDefeated             = "hero_secura_exhausted"
//SndHeroKiller               = "hero_secura_exhausted"

//VOSound = "hero_secura_AcquiredTarget      AcquiredTarget"
//VOSound = "hero_secura_KillingSpree4      KillingSpree4"

VOUnitType                  = 0181
//SoldierMusic            = "rep_hero_secura_lp"
HurtSound                   = ""
DeathSound                  = ""
AcquiredTargetSound         = ""
HidingSound                 = ""
//ApproachingTargetSound    = ""
FleeSound               = ""
PreparingForDamageSound = ""
HeardEnemySound         = ""
ShockFadeOutTime        = ""
ShockFadeInTime         = ""
ShockFadeOutGain        = ""
ShockSound              = ""
ClothingRustleSound     = ""
//LowHealthSound          = "com_inf_saber_ambient"
LowHealthThreshold      = "1.1"
FoleyFXClass            = "all_inf_soldier"


DropItemClass           = "com_item_powerup_ammo"
DropItemProbability     = 0.05
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_health100"
DropItemProbability     = 0.05
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_dual"
DropItemProbability     = 0.20
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_energy"
DropItemProbability     = 0.10
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_offense"
DropItemProbability     = 0.15
NextDropItem            = "-"
DropItemClass           = "com_item_powerup_defense"
DropItemProbability     = 0.15




Strange, my jedi inf odf doesn't have that line. The issue isn't with making the jedi inf on knightfall fall over when dying though, that works, for some reason the jedi heroes like anakin don't, unless it's in heroes vs. villains

Quote from: Bluetothestars on September 04, 2022, 03:11:11 AMStrange, my jedi inf odf doesn't have that line. The issue isn't with making the jedi inf on knightfall fall over when dying though, that works, for some reason the jedi heroes like anakin don't, unless it's in heroes vs. villains


Oh, I should have noted that the FleeLikeAHero line I added myself, that was the a new addition. The rest is a combination of the two defaults.



Anyway, so I think maybe there were some misunderstandings going on here in this thread. So Bluetothestars is talking about the unit in the actual hero slot, not necessarily the hero units, if I'm not mistaken? While I think Anthony was talking about the hero odf classes, but not the actual slot in the LUA they are put in.

Case in point here, I just went and tried putting my jedi unit in the hero slot, and it does the hero kneel down thing, even though it literally just had the regular death animation when it was in a trooper slot. So I decided to try adding the lines in the LUA, and in order cross-reference to see if they worked, I had one of them set a regular trooper in one of the common slots to do the kneel down.

    SetClassProperty("pct_inf_hero", "FleeLikeAHero", "0")
    SetClassProperty("pct_inf_assault", "FleeLikeAHero", "1")

So that assault trooper is in the "sniper" slot. While the hero unit is the one set to be a hero.

sniper = { "pct_inf_assault",1,4},



    SetHeroClass(IMP, "pct_inf_hero")

The LUA override works and makes the assault trooper kneel when killed, but it doesn't not affect the hero, which still kneels down like a normal hero. That same pct_inf_hero unit, if I remove it from the hero slot and put it into a common trooper slot, will do the regular death animation. I did several switches of different units and whatever unit is set as the hero class will always kneel. I even just copied the trooper in the rifleman slot so that it was in both the rifleman slot and the hero slot, and just being in the hero slot causes it to kneel down.

In other words, I think any unit that is put in the "SetHeroClass" slot will always kneel no matter what. I don't know if there is a different way to override that or not.

Hopefully all that rambling makes sense!

QuoteIn other words, I think any unit that is put in the "SetHeroClass" slot will always kneel no matter what. I don't know if there is a different way to override that or not.

Hopefully all that rambling makes sense!

This is absolutely correct. The SetHeroClass will always cause the character to kneel down. This is a hard coded limit in the game EXE.
I didn't understand the entire thread until you mentioned that but now I get it and it's not possible fix.
Never let a person named AnthonyBF2 touch your BF2.

Quote from: Ty294 on September 04, 2022, 08:12:41 AMOh, I should have noted that the FleeLikeAHero line I added myself, that was the a new addition. The rest is a combination of the two defaults.



Anyway, so I think maybe there were some misunderstandings going on here in this thread. So Bluetothestars is talking about the unit in the actual hero slot, not necessarily the hero units, if I'm not mistaken? While I think Anthony was talking about the hero odf classes, but not the actual slot in the LUA they are put in.

Case in point here, I just went and tried putting my jedi unit in the hero slot, and it does the hero kneel down thing, even though it literally just had the regular death animation when it was in a trooper slot. So I decided to try adding the lines in the LUA, and in order cross-reference to see if they worked, I had one of them set a regular trooper in one of the common slots to do the kneel down.

    SetClassProperty("pct_inf_hero", "FleeLikeAHero", "0")
    SetClassProperty("pct_inf_assault", "FleeLikeAHero", "1")

So that assault trooper is in the "sniper" slot. While the hero unit is the one set to be a hero.

sniper = { "pct_inf_assault",1,4},



    SetHeroClass(IMP, "pct_inf_hero")

The LUA override works and makes the assault trooper kneel when killed, but it doesn't not affect the hero, which still kneels down like a normal hero. That same pct_inf_hero unit, if I remove it from the hero slot and put it into a common trooper slot, will do the regular death animation. I did several switches of different units and whatever unit is set as the hero class will always kneel. I even just copied the trooper in the rifleman slot so that it was in both the rifleman slot and the hero slot, and just being in the hero slot causes it to kneel down.

In other words, I think any unit that is put in the "SetHeroClass" slot will always kneel no matter what. I don't know if there is a different way to override that or not.

Hopefully all that rambling makes sense!


Oh my god, thank you so much for this! That's what I meant this whole time! The heroes in the hero slots always kneel no matter what, so I did do everything right but it seems to be hard coded into the game. Thank you so much for your help  :cheer: