Author Topic: Problems porting weapons to FOnline  (Read 10340 times)

Offline Luther Blissett

  • Moderator
Re: Problems porting weapons to FOnline
« Reply #15 on: May 28, 2013, 03:16:58 pm »
At the bottom of the _FOHuman.fo3d, you should have all the animation sets, and in the weapon.fopro, you'll have a line for "Weapon.Anim1" (there's also a Weapon.Anim2 which I'm unsure about). They're referred to by letter (ABCD etc) in the fo3d (which may correspond to the letters in the original .frms?) but by number (1234 etc) in the fopro.

Code: [Select]
# Unarmed Knife Club Hammer Spear Pistol Uzi Shootgun Rifle Minigun Rocket Launcher
#    A      D    E      F     G     H     I      J      K      L           M
# Unarmed  - A
# 1 handed - D E F G H I J
# 2 handed - K L M

Code: [Select]
[Proto]
Pid=13
Type=3
PicMapName=art\items\rlaunch.frm
PicInvName=art\inven\rlaunch.frm
[...]
Weapon.Anim1=13
[...]
Weapon.Anim2_0=10
[...]

As far as I'm aware, that's A=1, B=2, C=3 etc - so in the rocket launcher above, that's "Weapon.Anim1=13", and M=13 - which should go with the "M" set of animations listed above. All the animations we currently have will probably be listed somewhere in the fo3d file. For the rocket launcher, they're currently :

Code: [Select]
# Bazooka
Anim M 1  %anim%_bazooka.x bazooka_idle
Anim M 3  %anim%_bazooka.x bazooka_walk
Anim M 7  %anim%_bazooka.x bazooka_on
Anim M 8  %anim%_bazooka.x bazooka_off
Anim M 9  %anim%_bazooka.x bazooka_fidget
Anim M 10  %anim%_bazooka.x bazooka_fidget
Anim M 29 %anim%_bazooka.x bazooka_shoot
Anim M 35 %anim%_bazooka.x bazooka_shoot
Anim M 40 %anim%_bazooka.x bazooka_dodge

I'm not sure what happens if you get knocked down whilst carrying a bazooka - there doesn't seem to be any entry for knock down/get up etc. If needed, you should be able to add extra animation sets for other weapons- Karpov seems to have done some on "Q" and "T". I've not tried this myself.

Note you may have the animation stuff in the fo3d listed like this instead :

Code: [Select]
# Unarmed
# 1 handed - Knife Club Hammer Spear Pistol SMG Shootgun
# 2 handed - HeavyRifle Minigun RocketLauncher Flamer

Code: [Select]
Anim Anim1Knife Anim2Idle            %anim%_knife.x Knife_idleWhich is equivalent to :
Code: [Select]
Anim D 1  %anim%_knife.x knife_idle
The numbers for these are defined in the _animation.fos. As far as I can see, these numbers have changed over various SDK updates, so the "Anim Anim2Idle" may be a better option than the "Anim D 1"

You may also have lines such as :
Code: [Select]
AnimEqual 1 Anim1RocketLauncher Anim1HeavyRifle
Code: [Select]
AnimEqual 1 M K
Which would mean "for this animation set, use these animations". Comment those out if they're interfering. Hope something amongst all that helps you find what you need to know :)

Re: Problems porting weapons to FOnline
« Reply #16 on: May 29, 2013, 01:21:13 pm »
Okay, I have 2 questions.
1) How do I attach muzzle flashes on the end of any weapon? _FOHuman.fo3d had a layer for effects. Plus, I've seen someone around here did it, I think. I don't remember.

2) Is there any way to load _FOHuman.fo3d instead of _VBHuman.fo3d?

Offline Luther Blissett

  • Moderator
Re: Problems porting weapons to FOnline
« Reply #17 on: May 29, 2013, 05:31:27 pm »
1) I've not tried the muzzle flashes myself - I know Karpov has been working on them, and has something working. One of the newer FOHuman files (which is probably the same one you mentioned) has weapon effects on layer 11. I've not studied this myself, but however it works, Karpov's done all the difficult stuff, so it's just a matter of writing a couple of words in a fo3d file somewhere. You know as much as I do on this one at the moment.

2) I'm having difficulty remembering, but I think it's the following : In client_main.fos, there's a bit saying to load 3d files :

Code: [Select]
#ifdef PLAYERS_3D
[...]
// Critters
Load3dFile("VbFemaleFat.fo3d"     , PT_ART_CRITTERS);
Load3dFile("VbFemaleNormal.fo3d"  , PT_ART_CRITTERS);
Load3dFile("VbFemaleStrong.fo3d"  , PT_ART_CRITTERS);
Load3dFile("VbFemaleWiry.fo3d"    , PT_ART_CRITTERS);
Load3dFile("VbFemaleSkeleton.fo3d", PT_ART_CRITTERS);
Load3dFile("VbMaleFat.fo3d"       , PT_ART_CRITTERS);
Load3dFile("VbMaleNormal.fo3d"    , PT_ART_CRITTERS);
Load3dFile("VbMaleStrong.fo3d"    , PT_ART_CRITTERS);
Load3dFile("VbMaleWiry.fo3d"      , PT_ART_CRITTERS);
Load3dFile("VbMaleSkeleton.fo3d"  , PT_ART_CRITTERS);
#endif

Those files will be loaded. It also may be from the reference in server\data\CritterTypes.cfg, which has stuff like this :
Code: [Select]
# Van Buren 3d critters
#          Name            Alias MH  3d  Walk  Run  Aim Armor Rotate  A B C D E F G H I J K L M N O P Q R S T   Walk  Run   Walk steps Sound name
@  290    VbMaleNormal      290   0   1    1    1    1    1    1      1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0    400  200   0  0  0  0     3dMale
@  291    VbMaleWiry        290   0   1    1    1    1    1    1      1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0    400  200   0  0  0  0     3dMale
@  292    VbMaleStrong      290   0   1    1    1    1    1    1      1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0    400  200   0  0  0  0 

I think it's one or both of those (possibly something somewhere else too?) - anyway, that will link to the chosen model's fo3d file.

In turn, VbMaleStrong.fo3d should contain something suchlike :
Code: [Select]
Model           CR_HumanMaleStrong.x
Include _FOHuman.fo3d anim_file CR_HumanMaleStrong.x anim male atr malestr

The "Include _FOHuman.fo3d" is the important bit there.

That should mean the game gives us VbMaleStrong as a selectable character, and it uses the CR_HumanMaleStrong.x 3d model, and loads data from the _FOHuman.fo3d. Newer versions of our 3D stuff may have these as "FOMaleStrong" instead.

I think that's how it worked anyway.

3) I know you didn't ask a 3, but I just wanted to add that it's good that you're asking all these questions - it means all this info is available on the internet, instead of just in a few people's brains. All these little bits eventually add up to enough information to put together little wiki articles and tutorials and saving lots of people a lot of time :)

Re: Problems porting weapons to FOnline
« Reply #18 on: May 30, 2013, 01:50:32 am »
Hmm... I see why Karpov has problems with the _FOHuman.fo3d now.
1)How do I make animations and implement them into the game?

2) How would I make special properties for weapons like for example a rocket launcher that locks on to certain creatures?

Re: Problems porting weapons to FOnline
« Reply #19 on: June 05, 2013, 09:03:23 am »
I took a break for a few days to clear my head and relax. I'm ready to go back to help 3d development.

I have a new question: How would I get the game to recognize the bone or dummy that defines where the weapon will be held?

Also, is there a way to define a bone or dummy to do other things like muzzle flashes and laser/plasma particle emmiters? I seen some of Karpov's weapons and there are 2 bones, one on the trigger and on the front of the weapon.