Page 1 of 1

How can I add a gun to my hero?

Posted: Wed Nov 06, 2013 1:37 pm
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.

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

Posted: Wed Nov 06, 2013 1:57 pm
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 ;)

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

Posted: Wed Nov 06, 2013 1:59 pm
by Marth8880

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

Posted: Wed Nov 06, 2013 2:03 pm
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.

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

Posted: Wed Nov 06, 2013 2:23 pm
by JimmyAngler
thanks everybody I will now make my own modding question thread. please go there for all my questions.