Adding weapons to units from different 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

User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Adding weapons to units from different sides

Post by Fiodis »

I tried to give Yoda the imperial's flamethrower, and it failed. Do I have to move the flamethrower assets from my imp folder over to my rep one?

Here's the odf:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "com_jedi_default"
GeometryName = "rep_inf_yoda.msh"

[Properties]
AISizeType = "HOVER"

GeometryName = "rep_inf_yoda"
GeometryLowRes = "rep_inf_yoda_low1"
SkeletonName = "yoda"
// lowrez must be different from high-rez or things go wacky wacky....
SkeletonLowRes = "yodalz"
SkeletonRootScale = "0.342974"
SkeletonRootScaleLowRes = "0.342974"
CollisionRootScale = "0.42"

NoEnterVehicles = 1

ClothODF = "rep_inf_yoda_cloth"

ControlSpeed = "sprint 3.50 0.50 0.50"

MaxSpeed = 6.0
MaxStrafeSpeed = 4.0
MaxTurnSpeed = 5.0
JumpHeight = 3.5
RecoverFromTumble = "1"

TargetPointOffsetStand = "0.0 0.5 0.0"
TargetPointOffsetCrouch = "0.0 0.3 0.0"


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 = 30.0

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

WEAPONSECTION = 1
WeaponName1 = "imp_weap_hero_flamethrower"
WeaponAmmo1 = 10

WEAPONSECTION = 2
WeaponName2 = "imp_weap_inf_thermaldetonator"
WeaponAmmo2 = 6
WeaponChannel2 = 1

WEAPONSECTION = 3
WeaponName3 = "imp_weap_inf_detpack"
WeaponAmmo3 = 0
WeaponChannel3 = 1

CAMERASECTION = "STAND"
EyePointOffset = "0.0 1.4 0.0"
TrackOffset = "0.0 -0.25 3.6"
TiltValue = "10"

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

CAMERASECTION = "CROUCH"
EyePointOffset = "0.0 1.4 0.0"
TrackOffset = "0.0 -0.25 3.6"
TiltValue = "10"

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 = "SPRINT"
EyePointOffset = "0.0 1.4 0.0"
TrackCenter = "0.0 1.4 0.0
TrackOffset = "0.0 -0.25 4.2"
TiltValue = "10.0"
CameraBlendTime = "0.5"

//SOUND
SndHeroSelectable = ""
SndHeroSpawned = "hero_yoda_spawn"
SndHeroDefeated = "hero_yoda_exhausted"
SndHeroKiller = "hero_yoda_exhausted"

VOSound = "rep_off_response_hero_command SC_Follow"
VOSound = "rep_off_response_hero_command SC_StopFollow"
VOSound = "rep_off_response_hero_command SC_VehicleWaitUp"
VOSound = "rep_off_response_hero_command SC_GetIn"
VOSound = "rep_off_response_hero_command SC_GetOut"

VOSound = "hero_yoda_AcquiredTarget AcquiredTarget"
VOSound = "hero_yoda_KillingSpree4 KillingSpree4"

VOUnitType = 186
SoldierMusic = "rep_hero_Yoda_lp"
HurtSound = ""
DeathSound = ""
AcquiredTargetSound = ""
HidingSound = ""
//ApproachingTargetSound = ""
FleeSound = ""
PreparingForDamageSound = ""
HeardEnemySound = ""
ShockFadeOutTime = ""
ShockFadeInTime = ""
ShockFadeOutGain = ""
ShockSound = ""
ClothingRustleSound = ""
//LowHealthSound = "com_inf_saber_ambient"
LowHealthThreshold = "1.1"
FoleyFXClass = "npc_inf_small"
Did I set up the weapon sections right? Do I need to add anything? Should I move those files?

Does it matter if I try to add him to the CIS side?
Last edited by Fiodis on Thu Nov 27, 2008 1:59 pm, edited 1 time in total.
User avatar
Hero_Unit
Private First Class
Posts: 78
Joined: Tue Mar 13, 2007 3:15 pm

Re: Adding weapons to units from different sides

Post by Hero_Unit »

Moving the flamethrower files should work, yes - either that, or (I'm not certain about this) loading Boba Fett in your LUA.

On another note, I believe you will need to set up a gun/grenade/detpack-supporting animation set for Yoda (If you don't know how to do this, I'll explain).

Edit
Does it matter if I try to add him to the CIS side?
I don't believe so, no.
computergeek
General
General
Posts: 770
Joined: Thu Jun 07, 2007 6:26 pm
Projects :: Halo Warthog vehicle for SWBF2
Games I'm Playing :: Bioware RPGs - Halo
xbox live or psn: No gamertag set
Location: Far Far away....

Re: Adding weapons to units from different sides

Post by computergeek »

Hero_Unit- you were right about moving the files, although I do not think that loading Boba Fett will do anything to solve his problem
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Adding weapons to units from different sides

Post by Fiodis »

Hello, Hero!

I have no clue about gun/grenade/det animations. Could you help me out with those?

A question: I added Luke's lightsaber to Leia and didn't add any special animations for attacking/blocking/running etc. But it works all the same. How?
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Adding weapons to units from different sides

Post by Sky_216 »

Lukes anims are the default ones for any unit with a lightsabre. You only need to muck around with anims (and when I say muck around I mean copy a few files) if you use some other jedi's anims.
User avatar
Hero_Unit
Private First Class
Posts: 78
Joined: Tue Mar 13, 2007 3:15 pm

Re: Adding weapons to units from different sides

Post by Hero_Unit »

Fiodis wrote:I have no clue about gun/grenade/det animations. Could you help me out with those?
First off, head to the assets folder in BF2_ModTools, then to Animations, SoldierAnimationBank. Once there, copy the Yoda folder.

After you've done that, head to your three-letter map folder, Animations, SoldierAnimationBank. Paste the Yoda folder in there. Delete everything in it except for basepose.msh, and munge.bat.

Right click munge.bat, press Edit. A .txt window should pop up then - usually containing something similiar to this:
munge.bat wrote:@call ..\munge_animation.bat "/keepframe0 /rootscale bone_root 2.915673 /dest yoda.zaf /comp_debug 0 /debug" Sides/REP
Replace REP with whichever side you wish to add these animations to.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Adding weapons to units from different sides

Post by DarthD.U.C.K. »

why the yoda folder?
you dont need any "custom" anims for detpacks etc. they are loaded automatically, which anim is loaded depends on the classlabel
User avatar
Hero_Unit
Private First Class
Posts: 78
Joined: Tue Mar 13, 2007 3:15 pm

Re: Adding weapons to units from different sides

Post by Hero_Unit »

DarthD.U.C.K. wrote:why the yoda folder?
you dont need any "custom" anims for detpacks etc. they are loaded automatically, which anim is loaded depends on the classlabel
You're certain? I seem to recall a problem with Aayla Secura's Lekku if this wasn't done with her animations - thought there'd be a similiar problem with Yoda.

If I'm mistaken, I apologize.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Adding weapons to units from different sides

Post by DarthD.U.C.K. »

oh sorry, i got the question wrong
(you have to reference the new "anim" that you created as "skeleton" in your units odf by the way)
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Adding weapons to units from different sides

Post by Fiodis »

Well, I followed those instructions and it still crashes. I noticed there were two Yoda folders, Yoda and Yodalz. Do I have to copy over both?

Edit: Wait, what's a skeleton? And did I create one? When? How?

How would you reference it? And where in the odf?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Adding weapons to units from different sides

Post by DarthD.U.C.K. »

hmmm
you can try to add the yodalz anim files from the rep assets to your side folder
then paste the skeleton line from the yoda-odf into your units odf
User avatar
Hero_Unit
Private First Class
Posts: 78
Joined: Tue Mar 13, 2007 3:15 pm

Re: Adding weapons to units from different sides

Post by Hero_Unit »

Fiodis wrote:I noticed there were two Yoda folders, Yoda and Yodalz. Do I have to copy over both?
DarthD.U.C.K. is correct about moving the Yodalz animations.
Fiodis wrote:Edit: Wait, what's a skeleton? And did I create one? When? How?

How would you reference it? And where in the odf?
Looking over your unit's .odf, it appears you already have it referenced. I'd suggest adding an AnimationName = "yoda", though - just in case. It doesn't matter where you put it, as far as I know.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Adding weapons to units from different sides

Post by Fiodis »

Ok, I'll try those things. Thanks Hero!

As a side note, I'll be off-forum for the next few hours.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Adding weapons to units from different sides

Post by DarthD.U.C.K. »

im pretty shure that animation: yoda will crash battlefront, it would mean that swbf looks in the yoda animset for rifle and tool anims which are reasonably not included (you could include them though)
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Crifton
Contact:

Re: Adding weapons to units from different sides

Post by Tourny »

yes - either that, or (I'm not certain about this) loading Boba Fett in your LUA.
Actually. He is right.
yes - either that, or (I'm not certain about this) loading Boba Fett in your LUA.
lol. Precisely wrong. Loading Boba in the LUA before You load Yoda will help immensely. You will get all the weapons needed and save valuable file size! Note that it must be before!

EDIT: I seconde DUCK's notion.
User avatar
Hero_Unit
Private First Class
Posts: 78
Joined: Tue Mar 13, 2007 3:15 pm

Re: Adding weapons to units from different sides

Post by Hero_Unit »

DarthD.U.C.K. wrote:im pretty shure that animation: yoda will crash battlefront, it would mean that swbf looks in the yoda animset for rifle and tool anims which are reasonably not included (you could include them though)
Tried it out without adding rifle and tool animations, got the following results:
Image
Tourny wrote:Loading Boba in the LUA before You load Yoda will help immensely. You will get all the weapons needed and save valuable file size! Note that it must be before!
Good point. I had forgotten about the before part.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Adding weapons to units from different sides

Post by Fiodis »

Well, it crashed, and this time I have no idea why, seeing as I followed and understood all of the instructions.

I noticed that the Yodalz only had a "basepose" file and no munge.bat. Should I copy one in there?

Also, here's how I set up the AnimationName = "yoda" in Yoda's odf:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "com_jedi_default"
GeometryName = "rep_inf_yoda.msh"

AnimationName = "yoda"

[Properties]
AISizeType = "HOVER"

GeometryName = "rep_inf_yoda"
GeometryLowRes = "rep_inf_yoda_low1"
SkeletonName = "yoda"
// lowrez must be different from high-rez or things go wacky wacky....
SkeletonLowRes = "yodalz"
SkeletonRootScale = "0.342974"
SkeletonRootScaleLowRes = "0.342974"
CollisionRootScale = "0.42
Does it matter where I put it? I know Hero answered that but I'm not sure if putting it under [GameObjectClass] is good.

Also, a section of my ***c_con.lua where I load Boba Fett then Yoda:
Hidden/Spoiler:
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("DC:SIDE\\imp.lvl",
"imp_hero_bobafett")
ReadDataFile("DC:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_cloakedanakin",
"rep_hero_obiwan",
"rep_hero_yoda",
"rep_hover_barcspeeder")
Did I do it correctly? Do they have to be on the same team? Did I mess anything up?
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Crifton
Contact:

Re: Adding weapons to units from different sides

Post by Tourny »

The Animation name should be under properties, after the geometry section.

Code: Select all

[GameObjectClass]
ClassParent = "com_jedi_default"
GeometryName = "rep_inf_yoda.msh"

[Properties]
AISizeType = "HOVER"

GeometryName = "rep_inf_yoda"
GeometryLowRes = "rep_inf_yoda_low1"
AnimationName = "yoda"

CollisionRootScale = "0.42
You can't have skeleton and an animation at the same time.

This will most likely cause a problem. Next time you munge, run it using BF2_Modtools.exe
(In case you didn't know, you will find it in C:BF2_Modtools then you need to move it to your GameData folder) after you run it there will be a text file that is called "BF2log" or something. that is your error list. Post it here and we might be able to make something of it. If it doesn't crash then you don't have too bad of a problem.
EDIT: Your .LUA is fine, but you don't need the DC part to load Boba unless you are loading a custom version of him. Besides, the DC: command only works if you have a domesic imp.lvl file in your map's addon directory.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Adding weapons to units from different sides

Post by Fiodis »

Well, then, the changes:

Took DC: out of the LUA for the imp side

Moved Yodalz to data***/Animations/SoldierAnimationBank and didn't copy and paste any munge.bat's into it

Replaced
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "com_jedi_default"
GeometryName = "rep_inf_yoda.msh"

AnimationName = "yoda"

[Properties]
AISizeType = "HOVER"

GeometryName = "rep_inf_yoda"
GeometryLowRes = "rep_inf_yoda_low1"
SkeletonName = "yoda"
// lowrez must be different from high-rez or things go wacky wacky....
SkeletonLowRes = "yodalz"
SkeletonRootScale = "0.342974"
SkeletonRootScaleLowRes = "0.342974"
CollisionRootScale = "0.42
in my odf with
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "com_jedi_default"
GeometryName = "rep_inf_yoda.msh"

[Properties]
AISizeType = "HOVER"

GeometryName = "rep_inf_yoda"
GeometryLowRes = "rep_inf_yoda_low1"
AnimationName = "yoda"

CollisionRootScale = "0.42"
Munged, selected "Everything" from side dropdown menu (because I was unsure which side to munge, if any)

Copied BF2_Modtools to the Gamedata folder, ran it

Now, when I ran it a small window popped up with SWBF2 playing in it, except the top half of the screen was green. I suppose this is good. So I selected my account and played my map on instant action. It loaded fine, and when it normally crashes about a second after the side selection screen shows, this time it took 2+ seconds before it quit itself. I looked around for any text files and found none.

Is that a good thing?

EDIT - I guess not, because after this I ran the normal SWBFII and it crashed after about a second.
Last edited by Fiodis on Fri Nov 28, 2008 4:28 pm, edited 1 time in total.
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Crifton
Contact:

Re: Adding weapons to units from different sides

Post by Tourny »

There ought to be one in your GameData folder. In fact, there usually is one anyway. I think you're probably just not looking hard enough.
Post Reply