Basic ODF Editing

Started by aeria., September 13, 2009, 12:24:00 PM

Previous topic - Next topic
September 13, 2009, 12:24:00 PM Last Edit: September 14, 2009, 07:58:07 PM by ag
NOTE: This is incomplete and will be a WIP. I'll add to this whenever I have the time. Eventually I'll make this more organized and easier to read.

Braeden posted a tutorial similar to this back in SWBFmac. That board is offline so I thought I might remake it. It's intended for the newer people want to mod Battlefront.

What are ODF files?
The proper name is Object Definition File (I think). Every object in the game is given these ODF files. The classes, the weapons, the buildings, etc. You can change how things work and how they interact. For example, let's say we want to make a weapon fire 2x faster than it's original value. That's possible with ODF files! we'll go into that later.

What are MSH files?

The MSH files are mesh files. Long story short they are the objects/geometry appeared ingame.

In this tutorial, I will go over three different ODF files (I may add more later on).
This may look confusing at first but if you break it down, it's very easy to understand!
The first will be the soldier ODF file.

This file is named
all_inf_soldier.odf:

[GameObjectClass]
ClassLabel       = "soldier"
--  Rebels, Clones, Droids, etc are all considered as a soldier. Leave this alone.
GeometryName       = "all_inf_soldier.msh" -- This has no affect ingame because GameObjectClass is for the ZeroEditor. We are editing the sides, not the world itself.

Now let's go into the next part of the ODF file:
[Properties]
FootWaterSplashEffect    = "watersplash_sm"
-- When you're walking in water, you make this visual effect.
WaterSplashEffect    = "watersplash_md" -- Similar to above. It's a splash effect.
WakeWaterSplashEffect   = "watersplash_wade" -- Similar to above. Just another water effect.

UnitType      = "Trooper" -- The type of unit. Unsure of the use of this (someone else might explain and then I'll update this). Better to leave this alone.
IconTexture       = "all_soldier_icon" -- Never seen it used ingame (you find the texture in the ALL MSH folder), possibly was used for a feature that didn't make it into the final game
MapTexture       = "troop_icon" -- This is regarding the minimap.
MapScale       = 1.4 -- How big the texture is on the minimap. 1.0 is default size

GeometryName       = "all_inf_soldier" -- This is the msh of the soldier. If you changed this to all_inf_pilot.msh for example, then the soldier would appear as a pilot instead.

AnimationName      = "all_inf_snowtrooper" -- The animations of the class. Almost all of the classes use the animation of the snowtrooper.

FirstPerson      = "all\alltroop;all_1st_trooper" -- This is the arms from the first person view. If you change it to let's say the pilot's 1st person view, it will appear as the pilot's hands.
FirstPersonFOV   = "70" -- The field of view. The field of view is how much you can view from one angle. The higher the better but if you put it too high, things will appear stretched and that is very displeasing.
ThirdPersonFOV   = "65" -- Same as above.
GeometryLowRes      = "all_inf_soldier_low1" -- The low resolution geometry. This is what we see when an object is very far away. If you do not have a low resolution geometry, it will disappear from afar. Snipers will hate that.

OK! Now we have the camera part of the ODF file.

CAMERASECTION       = "STAND"

EyePointOffset       = "0.0 1.8 0.0"
TrackCenter      = "0.0 1.8 0.0
TrackOffset       = "0.0 0.0 3.5"
TiltValue      = "5.0"

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.5"
TiltValue      = "5.0"

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"

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"

All of these regard how the camera works. You can try experimenting with these to change the camera angles ingame.

Now let's look at the interesting part. The weapons and health of the soldier!

AimValue       = "1.0" -- Have no idea what this is, I'll find out eventually.

HealthType      = "person" -- The type of health. Leave this alone if you ask me.
MaxHealth       = 300.0 -- This is how much health the soldier has.

Acceleraton       = 70.0 -- If you've studied physics in High School, you know what this is. The higher it is, the faster it is.
MaxSpeed       = 6.5 -- The maximum speed of your soldier. The higher the faster although be aware that the animations doesn't like this to be changed. Put it too high and you will literally glide.
MaxStrafeSpeed       = 4.5 -- The speed when you are going left and right.
MaxTurnSpeed       = 4.00 -- The speed when you are walking at an angle.

WeaponName1       = "all_weap_inf_rifle" -- This says that the primary weapon is the blaster rifle. If you want to give it the sniper rifle instead, change this value to all_weap_inf_ sniperrifle.
WeaponAmmo1       = 6 -- This is how much ammo you do have. You can allow it to hold more or to hold less to give yourself a challenge.
WeaponName2       = "all_weap_inf_pistol" -- The is the secondary weapon you have. You have a pistol by default.
WeaponAmmo2       = 0 -- The pistol is a charging weapon so it will be kept to zero.
WeaponName3       = "all_weap_inf_thermaldetonator" -- This is the grenade.
WeaponAmmo3       = 3 -- This says you have 3 grenades. You can give yourself 1 grenade, 100 grenades, whatever you want.
WeaponChannel3      = 1 -- If I'm not mistaken, this means that it is to be used as a secondary weapon.
WeaponName4       = "all_weap_inf_crackgrenade" -- This is the weaker grenade.
WeaponAmmo4       = 3 -- This is self explanatory by now.
WeaponChannel4      = 1 -- This is self explanatory by now.

AimFactorPostureSpecial = 50 -- This is regarding your aim. The lower, the better.
AimFactorPostureStand    = 100
AimFactorPostureCrouch    = 140
AimFactorPostureProne    = 160
AimFactorStrafe    = 60
AimFactorMove       = 70

Now finally the last part of the ODF file:

AISizeType      = "SOLDIER" -- Keep this alone

--The following are the different sounds the soldier will make. All of them are self explanatory.
HurtSound               = "all_inf_com_chatter_wound"
DeathSound              = "all_inf_com_chatter_death"
AcquiredTargetSound     = "all_inf_com_chatter_acquired"
HidingSound             = "all_inf_com_chatter_hide"
ApproachingTargetSound  = "all_inf_com_chatter_approach"
FleeSound               = "all_inf_com_chatter_flee"
PreparingForDamageSound = "all_inf_com_chatter_predamage"
HeardEnemySound         = "all_inf_com_chatter_heard"
//ShockFadeOutTime      = "0.8"
//ShockFadeInTime       = "2.0"
ShockFadeOutGain        = ""
ShockSound              = ""
ClothingRustleSound     = ""

LowHealthSound          = ""
//LowHealthThreshold    = ".25"
FoleyFXClass            = "all_inf_soldier"

// squad command VO -- All of these are the different commands that the bots say to each other like "move out" or "follow me". If you don't have any custom sounds, you're better off leaving these alone.
SCFieldMoveOutSound      = "all_inf_com_chatter_tac_moveout"
SCFieldHoldSound      = "all_inf_com_chatter_tac_hold"
SCFieldFollowSound      = "all_inf_com_chatter_tac_follow"
SCDriverGetInSound      = "all_inf_com_chatter_tac_needgunner"
SCDriverGetOutSound      = "all_inf_com_chatter_tac_moveout"
SCPassengerMoveOutSound   = "all_inf_com_chatter_tac_spreadout"
SCPassengerStopSound   = "all_inf_com_chatter_tac_stop"
SCPassengerGetInSound   = "all_inf_com_chatter_tac_needgunner"
SCPassengerGetOutSound   = "all_inf_com_chatter_tac_moveout"
SCGunnerAllClearSound   = "all_inf_com_chatter_tac_allclear"
SCGunnerSteadySound      = "all_inf_com_chatter_tac_stop"
SCGunnerGetInSound      = "all_inf_com_chatter_tac_needgunner"
SCGunnerGetOutSound      = "all_inf_com_chatter_tac_moveout"
SCResponseYessirSound   = "all_inf_com_chatter_tac_yes"
SCResponseNosirSound   = "all_inf_com_chatter_tac_no"

// AIsquad command VO
-- All of these are the different commands that the bots say to each other like "move out" or "follow me". If you don't have any custom sounds, you're better off leaving these alone.
AISCFieldMoveOutSound      = "ai_all_inf_com_chatter_tac_moveout"
AISCFieldHoldSound         = "ai_all_inf_com_chatter_tac_hold"
AISCFieldFollowSound      = "ai_all_inf_com_chatter_tac_follow"
AISCDriverGetInSound      = "ai_all_inf_com_chatter_tac_needgunner"
AISCDriverGetOutSound      = "ai_all_inf_com_chatter_tac_moveout"
AISCPassengerMoveOutSound   = "ai_all_inf_com_chatter_tac_spreadout"
AISCPassengerStopSound      = "ai_all_inf_com_chatter_tac_stop"
AISCPassengerGetInSound      = "ai_all_inf_com_chatter_tac_needgunner"
AISCPassengerGetOutSound   = "ai_all_inf_com_chatter_tac_moveout"
AISCGunnerAllClearSound      = "ai_all_inf_com_chatter_tac_allclear"
AISCGunnerSteadySound      = "ai_all_inf_com_chatter_tac_stop"
AISCGunnerGetInSound      = "ai_all_inf_com_chatter_tac_needgunner"
AISCGunnerGetOutSound      = "ai_all_inf_com_chatter_tac_moveout"
AISCResponseYessirSound      = "ai_all_inf_com_chatter_tac_yes"
AISCResponseNosirSound      = "ai_all_inf_com_chatter_tac_no"

DropItemClass          = "com_item_powerup_ammo"
-- When you're dead, you drop something. This is the item that it drops.
DropItemProbability    = 0.40 -- This is the probability that you will drop it. 1.00 means you will always drop it.
NextDropItem          = "-" -- uh.... Ask Pi about this...
DropItemClass          = "com_item_powerup_health100"
DropItemProbability    = 0.30
NextDropItem          = "-"
DropItemClass          = "com_item_powerup_dual"
DropItemProbability    = 0.10


#TYBG

Mine is still here, you just have to dig a bit deep :P

The topic is there but if you look inside it, it is empty.


#TYBG

Couple of slight technicalities that just bug me cuz I'm that way :P

The water splashes are visual effects, not audio effects
WeaponAmmo values of 0 make it recharge, not the other way around.
I believe AimValue is how accurate your aim is (not 100% sure)
Might want to note in maxspeed that you will slide if you change that value. The animation just doesn't like changes

In GameObjectClass, that is only read by ZeroEditor, so the GeometryName there has no effect ingame.

Viruses are like the New York Lottery. "Hey, you never know"

That is why I wub Pi. He'll correct my mistakes so that I don't have to XD


#TYBG


lol. I just noticed the ...ask pi about this :P

I have never seen it used in any ODF file, and I truly have never tested it

I do, however, have and idea of what it might do. It could be used for creating drop chains (ex you drop a health pack and an ammo pack in the same death. I'd assume the way to use it is you set the name of the next pack to drop, reading it from the drop list and checking if there is another one to drop. The - probably means "end of drops"

Viruses are like the New York Lottery. "Hey, you never know"

I put the "ask Pi" prompts everywhere LOL.


#TYBG

September 14, 2009, 07:07:55 PM #8 Last Edit: September 14, 2009, 07:09:46 PM by Radical_Pi
lol you're going to have to give me a list of questions.

I did a bit of looking, and here's what I found

IconTexture: Never seen it used ingame (you find the texture in the ALL MSH folder), possibly was used for a feature that didn't make it into the game

MapTexture: The icon that appears on the map

MapScale: resizes the MapTexture to make some units show up bigger or smaller. That's how some troops have different size map markers

Also with weaponchannel a 0 is a primary weapon (that's how nap got 3 weapons on left click once) and 1 is a secondary weapon. I haven't experimented to see if you can change it on the number 2 weapon

Viruses are like the New York Lottery. "Hey, you never know"

I'll edit those tomorrow afternoon. Thanks Pi.


#TYBG

http://www.secretsociety.com/forum/downloads/BF1/cis_hover_aat_odf_commented.txt

...from psych0fred's site. For those of you unfamiliar, psych0fred was with Pandemic when they made the Battlefront games, and his site is a wealth of information (and assets) for both Battlefront games. Most of the good information is found in the "downloads" section - the forums have information but it is all very basic.

http://www.secretsociety.com/forum/display_forum.asp


September 21, 2009, 02:13:12 PM #11 Last Edit: September 21, 2009, 02:16:30 PM by ggctuk
I've tried looking inside the Battlefront executeable for the ODF parameters (the LUA parameters exist in the exe) but there's seemingly nothing in there for ODF commands. Normally I would assume the manual is complete but there are things that have been tried in contradiction ot the instructions that work.

It could very well be that LUA dictates what can be entered in ODF.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1

September 21, 2009, 06:48:49 PM #12 Last Edit: September 21, 2009, 06:50:52 PM by Radical_Pi
Ya know, the ODF parameters are the biggest mystery ever to me. In the files, they are stored as a 4-byte (32 bit) integer and there is no sign of this integer anywhere in the exe file, and there is no sign of an interpreter in the munger. I could try hexing through the LUA, but highly doubt the LUA would have been used for something as mundane as that. AFAIK, ScriptCB_DoFile does all of the work for the LUA (Anything with ScriptCB on it points to a function in the battlefront EXE). And those integers are in more than just the ODFs. I've found them in the munged localization files which cannot have a plain table of xxx becomes yyy.

Viruses are like the New York Lottery. "Hey, you never know"

Quote from: ggctuk on September 21, 2009, 02:13:12 PM
I've tried looking inside the Battlefront executeable for the ODF parameters (the LUA parameters exist in the exe) but there's seemingly nothing in there for ODF commands. Normally I would assume the manual is complete but there are things that have been tried in contradiction ot the instructions that work.

It could very well be that LUA dictates what can be entered in ODF.
The BF1 tools have a list of ODF parameters for each classlabel; what are you asking?

Quote from: Maveritchell on September 21, 2009, 08:30:22 PM
The BF1 tools have a list of ODF parameters for each classlabel; what are you asking?

It's the curiosity of where the hashes are stored. So far, the only thing I have been able to figure out is that ODF parameters are hashed by the munger. That hash must be in a global table in the EXE that determines the function of the hash. I'm saying it's a hash because the same system is used on the localization files, and those need some sort of method to read from the LUA code.

Viruses are like the New York Lottery. "Hey, you never know"