Adding Melee Weapons to Sides

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
User avatar
Ant
Chief Warrant Officer
Chief Warrant Officer
Posts: 326
Joined: Sat Sep 29, 2012 8:16 am
Projects :: The Clone Wars Mod
Games I'm Playing :: Battlefront Series
Contact:

Adding Melee Weapons to Sides

Post by Ant »

I have a question, and I'm positive you guys have a answer....since I seen it done before.

How would I make, for example, the Imperial Officer, be armed with a custom weapon.
I put the weapon's .msh and .tga's in the Msh folder.
I made a new .odf with the following info:
Hidden/Spoiler:
[code][WeaponClass]

ClassLabel = "melee"
ClassParent = "com_weap_inf_lightsaber"

[Properties]

GeometryName = "gam_weap_vibrolance"
ComboAnimationBank = "human_sabre melee imp_hero_darthvader"

FirePointName = "hp_fire"
LightSaberLength = "0.4"
LightSaberWidth = "0.75"

MinRange = "0"
OptimalRange = "1.5"
MaxRange = "3"

HitSound = "com_weap_inf_grenade_bounce"

OnSound = "overrideparentsound"
TurnOnSound = "overrideparentsound"
TurnOffSound = "overrideparentsound"[/code]
I updated the units .odf so it has the weapon:
Hidden/Spoiler:
[code][GameObjectClass]
ClassParent = "imp_inf_default"

[Properties]
PointsToUnlock = 8

UnitType = "support"

AnimationName = "impofficer"

ScanningRange = 30.0
TransmitRange = 300.0

WEAPONSECTION = 1
WeaponName = "imp_weap_inf_vibrolance"
WeaponAmmo = 0

WEAPONSECTION = 2
WeaponName = "imp_weap_inf_mortar_launcher"
WeaponAmmo = 5

WEAPONSECTION = 3
WeaponName = "imp_weap_inf_buff_damage"
WeaponAmmo = 1
WeaponChannel = 1

WEAPONSECTION = 4
WeaponName = "imp_weap_inf_remotedroid"
WeaponAmmo = 1
WeaponChannel = 1



VOUnitType = 43

// VOSound = "imp_command_follow SC_Follow"
// VOSound = "imp_command_stopFollow SC_StopFollow"
// VOSound = "imp_command_stopVehicle SC_VehicleWaitUp"
// VOSound = "imp_command_getIn SC_GetIn"
// VOSound = "imp_command_getOut SC_GetOut"
// VOSound = "imp_response_follow SC_FollowResponse"
// VOSound = "imp_response_stopFollow SC_StopFollowResponse"
// VOSound = "imp_response_stopVehicle SC_VehicleWaitUpResponse"
// VOSound = "imp_response_getIn SC_GetInResponse"
// VOSound = "imp_response_getOut SC_GetOutResponse"

VOSound = "imp2_inf_pc_com_hostile SpottedVO"
VOSound = "imp2_inf_pc_com_bacta NeedMedicVO"
VOSound = "imp2_inf_pc_com_mechanic NeedRepairVO"
VOSound = "imp2_inf_pc_com_ammo NeedAmmoVO"
VOSound = "imp2_inf_pc_com_transport NeedPickupVO"
VOSound = "imp2_inf_pc_com_backup NeedBackupVO"
VOSound = "imp2_inf_pc_com_clear_area AttackPositionVO"
VOSound = "imp2_inf_pc_com_defend DefendPositionVO"

VOSound = "imp2_inf_pc_com_hostile_inVehicle SpottedVO +InVehicle"
VOSound = "imp2_inf_pc_com_bacta_inVehicle NeedMedicVO +InVehicle"
VOSound = "imp2_inf_pc_com_mechanic_inVehicle NeedRepairVO +InVehicle"
VOSound = "imp2_inf_pc_com_ammo_inVehicle NeedAmmoVO +InVehicle"
VOSound = "imp2_inf_pc_com_transport_inVehicle NeedPickupVO +InVehicle"
VOSound = "imp2_inf_pc_com_backup_inVehicle NeedBackupVO +InVehicle"
VOSound = "imp2_inf_pc_com_clear_area_inVehicle AttackPositionVO +InVehicle"
VOSound = "imp2_inf_pc_com_defend_inVehicle DefendPositionVO +InVehicle"

VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum1 AcquiredTarget +VOUnitNum1"
// VOSound = "imp2_inf_chatter_AcquiredTarget_left AcquiredTarget +left"
// VOSound = "imp2_inf_chatter_AcquiredTarget_right AcquiredTarget +right"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum2 AcquiredTarget +VOUnitNum2"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum3 AcquiredTarget +VOUnitNum3"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum5 AcquiredTarget +VOUnitNum5"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum6 AcquiredTarget +VOUnitNum6"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum6 NotShootingCriticalHit +VOUnitNum6"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum10 AcquiredTarget +VOUnitNum10"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum10 NotShootingCriticalHit +VOUnitNum10"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum12 AcquiredTarget +VOUnitNum12"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum11 AcquiredTarget +VOUnitNum11"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum11 NotShootingCriticalHit +VOUnitNum11"
VOSound = "imp2_inf_chatter_NearbyEnemySlaughter NearbyEnemySlaughter"
VOSound = "imp2_inf_chatter_NearbyFriendlySlaughter NearbyFriendlySlaughter"
// VOSound = "imp2_inf_chatter_KillingSpree4 KillingSpree4"
// VOSound = "imp2_inf_chatter_KillingSpree8 KillingSpree8"
// VOSound = "imp2_inf_chatter_HeadshotKill HeadshotKill"
VOSound = "imp2_inf_chatter_Grenade Grenade"
// VOSound = "imp2_inf_chatter_MissileIncoming MissileIncoming"
// VOSound = "imp2_inf_chatter_AcquiredTarget_IsSniper_VOUnitNum4 AcquiredTarget +IsSniper +VOUnitNum4"
// VOSound = "imp2_inf_chatter_FriendlyFire FriendlyFire"
// VOSound = "imp2_inf_chatter_RebelsShootDeadBody RebelsShootDeadBody"
VOSound = "imp2_inf_chatter_GivePowerup GivePowerup"
VOSound = "imp2_inf_chatter_AcquiredTarget_IsTurret AcquiredTarget +IsTurret"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum121 AcquiredTarget +VOUnitNum121"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum123 AcquiredTarget +VOUnitNum123"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum124 AcquiredTarget +VOUnitNum124"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum124 NotShootingCriticalHit +VOUnitNum124"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum125 AcquiredTarget +VOUnitNum125"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum125 NotShootingCriticalHit +VOUnitNum125"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum126 AcquiredTarget +VOUnitNum126"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum126 NotShootingCriticalHit +VOUnitNum126"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum127 AcquiredTarget +VOUnitNum127"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum127 NotShootingCriticalHit +VOUnitNum127"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum126 NotShootingCriticalHit +VOUnitNum126"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum132 AcquiredTarget +VOUnitNum132"
// VOSound = "imp2_inf_chatter_NotShootingCriticalHit_VOUnitNum132 NotShootingCriticalHit +VOUnitNum132"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum182 AcquiredTarget +VOUnitNum182"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum183 AcquiredTarget +VOUnitNum183"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum184 AcquiredTarget +VOUnitNum184"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum185 AcquiredTarget +VOUnitNum185"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum186 AcquiredTarget +VOUnitNum186"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum187 AcquiredTarget +VOUnitNum187"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum188 AcquiredTarget +VOUnitNum188"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum189 AcquiredTarget +VOUnitNum189"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum190 AcquiredTarget +VOUnitNum190"
// VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum83 AcquiredTarget +VOUnitNum83"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum82 AcquiredTarget +VOUnitNum82"
// VOSound = "imp2_inf_chatter_AcquiredTarget AcquiredTarget"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum176 AcquiredTarget +VOUnitNum176"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum175 AcquiredTarget +VOUnitNum175"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum177 AcquiredTarget +VOUnitNum177"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum172 AcquiredTarget +VOUnitNum172"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum174 AcquiredTarget +VOUnitNum174"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum173 AcquiredTarget +VOUnitNum173"
VOSound = "imp2_inf_chatter_AcquiredTarget_VOUnitNum171 AcquiredTarget +VOUnitNum171"
[/code]
But then when I munge, no weapon shows up at all. It's as if he is swinging in the air with nothing but his fist. Any help? :)
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Adding Melee Weapons to Sides

Post by JimmyAngler »

here is the melee from bfx:
Hidden/Spoiler:
[WeaponClass]

ClassLabel = "cannon"
GeometryName = "knife.msh"

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

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

FirePointName = "hp_fire"

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

MinRange = 0
OptimalRange = 1
MaxRange = 2

LockOnRange = "2.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

FireAnim = "2"
InstantPlayFireAnim = "1"
OffhandWeapon = 1

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

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

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

//SOUND
FireSound = "com_weap_throw"
//ReloadSound = ""
WeaponChangeSound = ""
ChangeModeSound = ""
FireEmptySound = ""
ChargeSound = ""
ChargeSoundPitch = "0.05"
OverheatSound = ""
OverheatSoundPitch = "0.5"
OverheatStopSound = ""

OrdnanceName = "com_weap_melee_ord"
EnergyDrain = 20.0

NEXTCHARGE = "0.8"

OrdnanceName = "com_weap_melee_ord_high"
EnergyDrain = 60.0
I had one in one of my maps and it worked fine.
User avatar
Ant
Chief Warrant Officer
Chief Warrant Officer
Posts: 326
Joined: Sat Sep 29, 2012 8:16 am
Projects :: The Clone Wars Mod
Games I'm Playing :: Battlefront Series
Contact:

Re: Adding Melee Weapons to Sides

Post by Ant »

Ugh I must be doing something wrong.
I added your odf and changed the
GeometryName = "knife"
HighResGeometry = "knife"
with the name of the model. Then when I go into it, it shows up but then crashes a second later :(
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Adding Melee Weapons to Sides

Post by JimmyAngler »

The geometry name knife is just the name of the model of a knife. you could use anything in its place. If you have a mesh named knife then it will work. If not then it will crash.
User avatar
Ant
Chief Warrant Officer
Chief Warrant Officer
Posts: 326
Joined: Sat Sep 29, 2012 8:16 am
Projects :: The Clone Wars Mod
Games I'm Playing :: Battlefront Series
Contact:

Re: Adding Melee Weapons to Sides

Post by Ant »

I am getting this error from the BFront2.log:

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(2119)
Weapon "imp_weap_inf_vibrolance" missing fire point "hp_fire"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(1719)
Weapon "imp_weap_inf_vibrolance" missing ordnance 0.000000 "com_weap_melee_ord"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(1719)
Weapon "imp_weap_inf_vibrolance" missing ordnance 0.800000 "com_weap_melee_ord_high"
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Adding Melee Weapons to Sides

Post by JimmyAngler »

sorry, here is the _ord file
Hidden/Spoiler:
[OrdnanceClass]

ClassLabel = "emitterordnance"

[Properties]

ConeLength = "3"
ConeAngle = "180"
FirstRadius = "0.0"
MaxTargets = "1" // Max number of targets to hit. Chaining is off so the damage will be split between the number of targets
NoChaining = "1" // No chaining - all bolts coming from the attacker

//OrdnanceSound = "com_weap_launcher_energy_dumbfire"

Damage = "350" // This is the min damage. Even if the initial damage is split between the number of targets, it will never go below this number for each target
MaxDamage = "350" // This is the max damage
JumpDeduction = "0" // No jump deduction. This is for chaining only
DamageThreshold = "0" // Always do damage (no threshold)
MaxJumpDistance = "0" // No max jump distance because the chaining is off

VehicleScale = "0.1"
ShieldScale = "1.0"
PersonScale = "1.0"
AnimalScale = "1.0"
DroidScale = "1.0"
BuildingScale = "0.1"

Push = "10.0"

PushDeadOnly = "0"

AffectFriends = "1"

//LightningEffect = ""
//LightningEffectScale = "0.25"
//NoTargetLightningEffectCount = "5" // The number of ligthning effects to display when the ordinance has no targets to hit
//NoTargetLightningEffectRandomSpread = "0.4" // The random rotation spread the ligthning effects does when the ordinance has no targets to hit
and the ord_high file
Hidden/Spoiler:
[OrdnanceClass]

ClassLabel = "emitterordnance"

[Properties]

ConeLength = "3"
ConeAngle = "180"
FirstRadius = "0.0"
MaxTargets = "1" // Max number of targets to hit. Chaining is off so the damage will be split between the number of targets
NoChaining = "1" // No chaining - all bolts coming from the attacker

//OrdnanceSound = "com_weap_launcher_energy_dumbfire"

Damage = "800" // This is the min damage. Even if the initial damage is split between the number of targets, it will never go below this number for each target
MaxDamage = "800" // This is the max damage
JumpDeduction = "0" // No jump deduction. This is for chaining only
DamageThreshold = "0" // Always do damage (no threshold)
MaxJumpDistance = "0" // No max jump distance because the chaining is off

VehicleScale = "0.1"
ShieldScale = "1.0"
PersonScale = "1.0"
AnimalScale = "1.0"
DroidScale = "1.0"
BuildingScale = "0.1"

Push = "10.0"

PushDeadOnly = "0"

AffectFriends = "1"

//LightningEffect = ""
//LightningEffectScale = "0.25"
//NoTargetLightningEffectCount = "5" // The number of ligthning effects to display when the ordinance has no targets to hit
//NoTargetLightningEffectRandomSpread = "0.4" // The random rotation spread the ligthning effects does when the ordinance has no targets to hit
and you need a hidden object such as a triangle named hp_fire in the mesh.
User avatar
Ant
Chief Warrant Officer
Chief Warrant Officer
Posts: 326
Joined: Sat Sep 29, 2012 8:16 am
Projects :: The Clone Wars Mod
Games I'm Playing :: Battlefront Series
Contact:

Re: Adding Melee Weapons to Sides

Post by Ant »

Why are the _ord and _ord_high identical?
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Adding Melee Weapons to Sides

Post by JimmyAngler »

idk but you need them both.
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Adding Melee Weapons to Sides

Post by Nedarb7 »

Ant wrote:Why are the _ord and _ord_high identical?
They aren't, look at the damage they deal, ord_high does more damage. This line in the odf of the weapon tells BF2 to use a different ordnance at a certain charge (in this case .8 ) :wink: :
The Weapon ODF wrote:OrdnanceName = "com_weap_melee_ord"
EnergyDrain = 20.0

NEXTCHARGE = "0.8"

OrdnanceName = "com_weap_melee_ord_high"
EnergyDrain = 60.0
User avatar
Ant
Chief Warrant Officer
Chief Warrant Officer
Posts: 326
Joined: Sat Sep 29, 2012 8:16 am
Projects :: The Clone Wars Mod
Games I'm Playing :: Battlefront Series
Contact:

Re: Adding Melee Weapons to Sides

Post by Ant »

I have a challenge for someone. Been playing around with the .odfs and got majoirty of the swords I need working. This one however:
http://www.gametoast.com/forums/viewtop ... 64&t=20909
seems to be impossible. Anyone who can get a working .odf for one (or both) of those two weapons wins a free cookie.

NOTE: Cookie will be charged with $100 Shipping with a $500 with not giving money after 5 seconds from receiving gift.
Any member who lacks particular in this challenge will be given cookies made by my mom...you don't want cookies made by my mom. *shivers.
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: Adding Melee Weapons to Sides

Post by CressAlbane »

I assure you the problem is not with the model, as I used that same model in my (long gone and defunct) Mega Man map.
Post Reply