Sides help thread...

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
PAN-Fnord

Sides help thread...

Post by PAN-Fnord »

Hello, all. I was a programmer on BF2, and I worked extensively with Jedi and sides setup. I'm going to poke around for a while and see if I can be of help anywhere, but if you would like to ask a question in this thread, or if something in the Jedi doc is unclear, feel free.

First note:
You don't have to hex-edit a soldier's MSH file to change the texture name - you can specify override textures (up to 2, in the same order they're using in the MSH) by using:
OverrideTexture = "new_texture"
-and-
OverrideTexture2 = "new_second_texture"
in the character's ODF. (The 2nd texture is for if the character's MSH has 2 textures in it, not a whole second choice like a Player 2 color.)

Edit:
----
It was explained to me by our graphics programmer that OverrideTexture as a feature is model-specific. Turns out, if you want to be able to use OverrideTexture (or Texture2) with a model, that model has to have in the MSH file a node called "override_texture" (or _texture2). Then you have to specify in the model's .msh.option file "-keepmaterial override_texture" (or _texture2). This tells the munge process not to collapse that node. Then you can use OverrideTexture in the ODF.
Basically, OverrideTexture will only work on models that have been prepped this way, so I guess I'll list which models have the node in their MSH:
all_inf_marksperson (and low1)
all_inf_soldier (and low1)
all_inf_vanguard (and low1)
all_inf_wookiee (and low)
cis_inf_bdroid (and low1)
ewk_inf2_low1 and ewk_inf_low1 (not sure why these only)
nab_inf_gungan (and low1)
jed_inf_jedi (and low1)
jed_inf_sith (and low1)
rep_inf_arctrooper (and low1)
rep_inf_jettrooper (and low1)
rep_inf_pilot_low1 (not high res though...)
rep_inf_trooper (and low1)
wok_inf_wookiee (and low1)
all_inf_snowtrooper (and low1)
gar_inf_nabooguard (and low1)

For all others, you do indeed need to either hex edit the file or change the actual texture.
(^.^)
----

Mike Z - Programmer and Jedi designer, SWBF2
Last edited by PAN-Fnord on Mon Feb 27, 2006 4:07 pm, edited 1 time in total.
yodaminch

RE: Sides help thread...

Post by yodaminch »

Question for you. I'm trying to make leia a jedi. I followed the tutorial and got up to weapons. That's where I became confused. For simplicity I named the unit jdi_leia. Now do I need to rename any textures for the unit or the weapon? Also when I came to cloth, Is this correct:

// Top section, same as any other ODF
[GameObjectClass]
// this is cloth, so...
ClassLabel = "cloth"

// properties section – small for cloth
[Properties]

// This tells us the name of the model that the cloth piece is
// attached to. In our case, “all_inf_tatooinelukeskywalker”
AttachedMesh = "all_inf_deathstarleia"
ClothODF = “all_inf_leia_skirt”
PAN-Fnord

RE: Sides help thread...

Post by PAN-Fnord »

yodaminch --

First off, in response to your other thread: You need to LOAD the unit from the LVL of the side they're in:
ReadDataFile("dc:SIDE\\JED.lvl", "jed_sith_01") -- or whatever LVL your side's in...
but then you can put jed_sith_01 on either team using SetupTeams. But it appears you got that figured out.

You shouldn't need to rename any textures for the unit or weapon - the ODF name doesn't need to match the MSH name, and all you changed was the ODF name. You just need to make sure you actually have all the textures.

For the cloth: Yes, the name of her cloth is all_inf_leia_skirt, and her model is all_inf_deathstarleia. But...
The line
ClothODF = "all_inf_leia_skirt"
goes into Leia's main character ODF. This tells the character to look for that cloth ODF, and apply the properties in it to the cloth piece of the same name.
Then you create the actual all_inf_leia_skirt.odf, which needs
----
[GameObjectClass]
ClassLabel = "cloth"

[Properties]
AttachedMesh = "all_inf_deathstarleia"
----
in it. (In fact, this file can be found in SIDES\all\ :^)

That should work. Note that AttachedMesh is the actual .msh file name, not the ODF name.

Mike Z
yodaminch

RE: Sides help thread...

Post by yodaminch »

Ok thanks. I'll try that and get back to you.
And yes, I finally figured out my side issues after a while of testing.
maxloef
Major General
Major General
Posts: 654
Joined: Mon Jan 03, 2005 4:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by maxloef »

yes i myself would like to know how u actualy make new units with diferent stats and weapons i was easely able to do this in batlefront 1 but in battlefront 2 it just doesnt seem to work.
If you could be so kind to post a short tutorial on how to actualy set everything up for a new side lets say republic.

want im trieing to make is:

Light Clone Trooper with a dc 15 blaser carbine (uses pistol model but with rifle animation (been done in swbf 1) and eddited stats for the clone so he is weaker.

could u please write a short tutorial. :)
OOM-9

Post by OOM-9 »

I have deciphered the unit creation.

All units are based off of a single unit class depending on which one, here is an example.

com_inf_default.odf

This has basic stats that are similar across all infantry units. Like base health of like 300 and base speeds and etc.

Then you branch out to each faction.

For instance there is 'rep_inf_default' This odf overrides some of the common defaults to specialize the unit to the republic faction.

Then from here you branch into the specific unit classes. Examples:

'rep_inf_default_rifleman'

This odf overrides the republic's common infantry statistics to further specialize the rifleman. Weapon loadouts are here, as well as any health upgrades, or speed increases.

Basically, if you give your 'rep_inf_default_rifleman' 400000000 Health, that huge number overrides the common unit default of 300, so your rifleman will have the resulting REDICULOUS health.

The republic faction branches one more time because they have 2 types of look. Ep2 and Ep3 Clones.

The final branch of the Republic unit odf tree is the appearance specialization, and you have examples like this.

"rep_inf_ep3rifleman"

This odf overrites the default unit appearances and tells the unit to call on EP3 models.

This makes it more complicated to alter your whole side, but ends up making it easier to tweak as you go.=====




As to the programmer fellow who is answering questions. I dunno if you know how they added objectives in the campaign, I am trying to add a 20 min timer to the republic side for a siege type map.

I don't know where the scripting is to add triggered ambushes, voice overs, and timers... where are all of those campaign style controls?




~00M-9
yodaminch

Post by yodaminch »

No matter what I do with editing leia, once i load up the game and select the map it goes to the battlefront 2 loading screen and right when the level should start it crashes to desktop. I then tried making han a jedi since there were no cloth odf's to worry about. No good. Also crashes. I can only conclude this error is with animations since the rest of the files seem ok. but even that looks fine. :oops:
Blaaguuu

Post by Blaaguuu »

i managed to get leia working with lukes animations, though during the cprocess there wer several times when the game crashed on loading my map, too. i think the thign taht finaly fixed ti was when i properly set her animations. Very carefuly read through the animations section in the creating a jedi documentation... i just copied and renamed lukes combo file and all of his animations, and did all the munge stuff.

However, i still cant get her skirt to show up... I have the leia mesh, and the leia character and skirt odfs in my side folder ( all renamed - shoudl taht be a problem?), and set up as described above, but still no go. though she doesnt look too bad without the skirt.
C-26

Post by C-26 »

Thanks for the help Fnord :D

This is from the Jedi doc....
From there, in your mod’s mission scripts, you can load your character into your level:
ReadDataFile(“dc:SIDE\\jdi.lvl”, “jdi_demojedi”)
The “dc:” tells the game that this lvl file is located in your mod’s folder, rather than in the normal game data folder. The first parameter is the side’s lvl file to open, and the rest are individual soldiers to load from within that side’s lvl – in our case jdi_demojedi, and if we had made one, jdi_otherdemojedi or jdi_demojedi2, etc…
My question is...

Where is my mod's mission script located?
Mikey_bizzle441

Post by Mikey_bizzle441 »

yeah like maxloef said, could you please make a short tutorial on how to make custom sides? that would really be nice because the one on making your own jedi really confused me.
PAN-Fnord

Post by PAN-Fnord »

00M-9 is exactly correct - BF2 uses inheritance to define weapons. You put all your parameters in a parent weapon class, and if you want to make a new child weapon, you override or add whichever parameters you want to change. This allows you to change something about, say, all rifles in the game just by editing com_weap_inf_rifle. So if you want to know something about a weapon/soldier that's not in its ODF, you need to look in the parent ODF, and if it's not in there look in the parent of that, etc.

Animations take a bit of time to get used to, but it's fairly straightforward - just make sure you're not trying to use an animation that she doesn't have. As for getting the missile to appear at the right time, use SalvoDelay and InitialSalvoDelay (look at the Wookiee Bowcaster).

The cloth ODF MUST be named the same name as the cloth piece, which would be all_inf_leia_skirt. Only the soldier ODF name would be different.

Edit: C-26 - your mod's mission scripts are the LUAs in [your mod dir]\common\scripts\[your mod name]\

Mike Z
yodaminch

Post by yodaminch »

For the animations, What I did was copy the demojedi ones, rename them from tat_luke_whateveritwas to lea_leia_whatever it was. I edited the bat file and everything. I also generated the three files in the munged area. I really don't know what I did wrong.

If it is the animations, I noticed this in the odf

// the next line can be one of 3 choices:
// - Not included (blank), if the model wants to use the
// “human_sabre” skeleton and animations.
// (Those are Luke Skywalker’s animations, but we
// will be defining our own so we are going to
// use this line anyway).
// - AnimationName if this model uses the basic human
// skeleton, but wants to provide its own animations
// as a set of files in the “munged” folder.
// - SkeletonName if this model wants to use its own
// skeleton in addition to its own animations.


So rather then make custom animations could I just put:

AnimationName = ""

And will that just pull the human skeleton animations?
PAN-Fnord

Post by PAN-Fnord »

If you rename them from tat_luke* to lea_leia*, leaving basepose.msh alone of course, then the munged files you generate from the bat file should be lea_leia.*. And your AnimationName = "lea_leia".
If you use the bf2_modtools exe, it should give you an error when you load the level, telling you which animation it couldn't find.

Did you get the demo Jedi zip to work?

If you want to use normal human sabre animations, leave out the AnimationName line entirely - AnimationName = "" will crash. However, if you use defaults a lot of the animations aren't there (aayla, mace, etc) so it'd crash unless you used the all_hero_luke_jedi combo file (uke's animations are the default ones).

If you want to see what animations are available as default human sabre, they're in the assets data folder, under animations/human_sabre.

Also, if want to be sure, pick your side, then Clean, then Munge, just to minimize errors.

Mike Z
maxloef
Major General
Major General
Posts: 654
Joined: Mon Jan 03, 2005 4:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by maxloef »

wel i got my clone to work only the override texture doesnt work :P also i would like to know HOW to do the localization :P
OOM-9

Post by OOM-9 »

You able to tell me anything about campiagn stle scripting?
yodaminch

Post by yodaminch »

Ok. I've gotten leia in game, with saber, and no skirt. I am at a loss as to why she has no skirt. I've gone over the all_inf_leia_skirt thrice and it looks fine. I've opened up the jedi leia odf and it points to all_inf_leia_skirt for the cloth odf like it should. Is it at all related to the animations?
Last edited by yodaminch on Sat Feb 25, 2006 2:26 pm, edited 1 time in total.
Slayer_Hunter_J

Post by Slayer_Hunter_J »

Ooooh, let me see! JK
I read in the tutorial that it has something to do with the clothing.

I am trying to put my jedi into the mission.lvl. I just dont know where exactly. Im pretty sure it said to put it after the Read Data File, but i found three of those in the .lvl file. So which one or am i doing it wrong?
LordofEntropy

Post by LordofEntropy »

@slayer: The tutorial says to put the ReadDataFile(dc:Sides\XXX.lvl) line into the mission.LUA file (what the author refers to as the mission scripts file, it took me a bit to figure that part out too). You simply put dc: in front of the target file so that the game, on loading your map, knows to look in your mod's Sides folder, rather than the default Sides folder shipped with the game. Then, you replace one of the target character classes with your Jedi so that instead of say, a sniper, you can play as your jedi.

EDIT: oh yeah, i forgot... the mission script file is in: C:\BF2_ModTools\data_ModID\Common\scripts\ModID\ and you should open any of the several .LUA files. ModIDc_con would refer to the clone wars conquest version of your map, where ModIDg_con would refer to GCW conquest, and so on. You edit it before you munge from C:\BF2_ModTools\data_ModID\_BUILD
yodaminch

Post by yodaminch »

Another question for you. If I want to pull a side from another custom map, I can't just have:

dc:SIDE//whatever.lvl. "custom unit")
dc:SIDE//whatever2.lvl, "2nd unit")


Do I need a longer path like C/Program Files/Lucasarts/Battlefront 2/gamedata/addon or is it not possible to add an unit from another custom map?
Slayer_Hunter_J

Post by Slayer_Hunter_J »

LordofEntropy wrote:@slayer: The tutorial says to put the ReadDataFile(dc:Sides\XXX.lvl) line into the mission.LUA file (what the author refers to as the mission scripts file, it took me a bit to figure that part out too). You simply put dc: in front of the target file so that the game, on loading your map, knows to look in your mod's Sides folder, rather than the default Sides folder shipped with the game. Then, you replace one of the target character classes with your Jedi so that instead of say, a sniper, you can play as your jedi.

EDIT: oh yeah, i forgot... the mission script file is in: C:\BF2_ModTools\data_ModID\Common\scripts\ModID\ and you should open any of the several .LUA files. ModIDc_con would refer to the clone wars conquest version of your map, where ModIDg_con would refer to GCW conquest, and so on. You edit it before you munge from C:\BF2_ModTools\data_ModID\_BUILD
Thanks for the info for the .lua mission scripts, but where do I put the ReadDataFile(dc:Sides\XXX.lvl) exactly? Just any place? Or is there a space that im not seeing?
Post Reply