How can I add a gun to my hero?

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

How can I add a gun to my hero?

Post by JimmyAngler »

Ok so I made my hero (he looks sharp) but now I want to add a gun as a primary option.
I don't exactly know what all the odfs are yet and want to know which files go where.
(which mshs do I use)(what tgas that go with it) Then could someone help with the scripting part?
I'm not to good at that either.

P.S. you will get credit for helping with my map.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: How can I add a gun to my hero?

Post by Anakin »

http://www.gametoast.com/forums/viewtop ... 27&t=13806

Sides
  • Custom side: How to
  • [...]

ODF
  • [...]
  • ODF Parameters for SWBF2
  • [...]
  • Dann's ODF for Dummies Guide
  • [...]
  • ODF, Weapon, Vehicle, Soldier etc. Guides and Tricks

Model (msh)
  • MSH file information
  • [...]
LUA
  • [...]
Skinning
  • [...]
please have a look at these before posting all these Threads. And you may can start one thread named JimmyAngler's Modding questions instead of making for each a new thread ;)
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: How can I add a gun to my hero?

Post by Marth8880 »

THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: How can I add a gun to my hero?

Post by THEWULFMAN »

If you don't know about it already, here is our modding Frequently Asked Questions (FAQ) thread. It answers over a hundred commonly asked modding questions.

forums/viewtopic.php?f=27&t=13806

Loads of useful stuff in there for learning how to create new sides(teams).

Anyway. Your question.

Let's look at a stock, gun wielding here shall we?

Here is Han's ODF.
Hidden/Spoiler:
[code][GameObjectClass]
ClassParent = "com_hero_default"
GeometryName = "all_inf_tatooinehansolo.msh"

[Properties]
UnitType = "pilot"

GeometryName = "all_inf_tatooinehansolo"
GeometryLowRes = "all_inf_tatooinehansolo_low1"
FirstPerson = "all\allhstat;all_1st_tatooinehansolo"

AnimationName = "hansolo"
HealthType = "person"
MaxHealth = 1500.0

WEAPONSECTION = 1
WeaponName1 = "all_weap_hero_hanpistol"
WeaponAmmo1 = 4

WEAPONSECTION = 2
WeaponName2 = "all_weap_inf_fusioncutter"
WeaponAmmo2 = 1

WEAPONSECTION = 3
WeaponName3 = "all_weap_inf_detpack"
WeaponAmmo3 = 5
WeaponChannel3 = 1

WEAPONSECTION = 4
WeaponName4 = "all_weap_inf_buff_defense"
WeaponAmmo4 = 1
WeaponChannel4 = 1[/code]
Now, you'll notice Han has 4 weapons. His pistol, a fusioncutter, detpacks and a defense buff.

Now the pistol and fusion cutter are Primary Weapons, and the detpack and defense buff are Secondary Weapons. Secondary Weapons are designated by the "WeaponChannel# = 1" line.

When adding new weapons you must remember to keep all of the numbers set up properly. You see Han has 4 WEAPONSECTIONs right now. The maximum is 8.

So the WEAPONSECTION, WeaponName, WeaponAmmo and WeaponChannel (if applicable) must have matching numbers, and the entire section must not be out of order.

For instance, you can not skip WEAPONSECTION = 3 and have 5 weapons (SECTIONS 1, 2, 4, 5, and 6). It will cause the game cease functioning properly.

Now with all that out of the way, let's say you want to give your hero a rifle. Let's find a rifle for him to use shall we? Let's go to the Alliance ODF folder, and look at the soldier's parent ODF with the important information (all_inf_default_rifleman). There you see the name of the rifle ODF you need, all_weap_inf_rifle.

Let's go back to our hero, and add the weapon in.
Hidden/Spoiler:
[code][GameObjectClass]
ClassParent = "com_hero_default"
GeometryName = "all_inf_tatooinehansolo.msh"

[Properties]
UnitType = "pilot"

GeometryName = "all_inf_tatooinehansolo"
GeometryLowRes = "all_inf_tatooinehansolo_low1"
FirstPerson = "all\allhstat;all_1st_tatooinehansolo"

AnimationName = "hansolo"
HealthType = "person"
MaxHealth = 1500.0

WEAPONSECTION = 1
WeaponName1 = "all_weap_inf_rifle"
WeaponAmmo1 = 4

WEAPONSECTION = 2
WeaponName2 = "all_weap_inf_fusioncutter"
WeaponAmmo2 = 1

WEAPONSECTION = 3
WeaponName3 = "all_weap_inf_detpack"
WeaponAmmo3 = 5
WeaponChannel3 = 1

WEAPONSECTION = 4
WeaponName4 = "all_weap_inf_buff_defense"
WeaponAmmo4 = 1
WeaponChannel4 = 1[/code]
Assuming you have all the pertinent meshes and other assorted files you need, you can munge and test out your hero. Feel free to experiment around and see what does and doesn't work, and read through the important side creation tutorials in the FAQ.
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: How can I add a gun to my hero?

Post by JimmyAngler »

thanks everybody I will now make my own modding question thread. please go there for all my questions.
Post Reply